avformat/mtv: check av_strdup() return value
authorSteven Liu <lq@chinaffmpeg.org>
Thu, 10 Oct 2019 05:47:04 +0000 (13:47 +0800)
committerSteven Liu <lq@chinaffmpeg.org>
Sat, 19 Oct 2019 04:54:53 +0000 (06:54 +0200)
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
libavformat/mtv.c

index 728f4a4..e731d91 100644 (file)
@@ -171,6 +171,8 @@ static int mtv_read_header(AVFormatContext *s)
     st->codecpar->width           = mtv->img_width;
     st->codecpar->height          = mtv->img_height;
     st->codecpar->extradata       = av_strdup("BottomUp");
+    if (!st->codecpar->extradata)
+        return AVERROR(ENOMEM);
     st->codecpar->extradata_size  = 9;
 
     // audio - mp3