diff --git a/libavformat/oggparsetheora.c b/libavformat/oggparsetheora.c index 3d5785b74c..961096edaa 100644 --- a/libavformat/oggparsetheora.c +++ b/libavformat/oggparsetheora.c @@ -50,6 +50,8 @@ static int theora_header(AVFormatContext *s, int idx) if (!thp) { thp = av_mallocz(sizeof(*thp)); + if (!thp) + return AVERROR(ENOMEM); os->private = thp; }