[FFmpeg-devel] [PATCH v1 7/8] avformat/mvdec: check av_strdup() return value

Steven Liu lq at chinaffmpeg.org
Thu Oct 10 06:40:10 EEST 2019


Signed-off-by: Steven Liu <lq at chinaffmpeg.org>
---
 libavformat/mvdec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/mvdec.c b/libavformat/mvdec.c
index 4f75dcacdb..f9f7e38137 100644
--- a/libavformat/mvdec.c
+++ b/libavformat/mvdec.c
@@ -211,6 +211,8 @@ static int parse_video_var(AVFormatContext *avctx, AVStream *st,
     } else if (!strcmp(name, "ORIENTATION")) {
         if (var_read_int(pb, size) == 1101) {
             st->codecpar->extradata      = av_strdup("BottomUp");
+            if (!st->codecpar->extradata)
+                return AVERROR(ENOMEM);
             st->codecpar->extradata_size = 9;
         }
     } else if (!strcmp(name, "Q_SPATIAL") || !strcmp(name, "Q_TEMPORAL")) {
-- 
2.15.1





More information about the ffmpeg-devel mailing list