[FFmpeg-cvslog] avformat/mtv: check av_strdup() return value

Steven Liu git at videolan.org
Sat Oct 19 08:11:24 EEST 2019


ffmpeg | branch: master | Steven Liu <lq at chinaffmpeg.org> | Thu Oct 10 13:47:04 2019 +0800| [53928e0b49b9924a41905d20a26b965ecdd9abf5] | committer: Steven Liu

avformat/mtv: check av_strdup() return value

Signed-off-by: Steven Liu <lq at chinaffmpeg.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=53928e0b49b9924a41905d20a26b965ecdd9abf5
---

 libavformat/mtv.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/mtv.c b/libavformat/mtv.c
index 728f4a4781..e731d91077 100644
--- a/libavformat/mtv.c
+++ b/libavformat/mtv.c
@@ -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



More information about the ffmpeg-cvslog mailing list