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

Submitted by Steven Liu on Oct. 10, 2019, 3:40 a.m.

Details

Message ID 20191010034011.1205-7-lq@chinaffmpeg.org
State Accepted
Commit b1071b405d57eb980f228f1ef17a97ca69cbf53f
Headers show

Commit Message

Steven Liu Oct. 10, 2019, 3:40 a.m.
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
---
 libavformat/mvdec.c | 2 ++
 1 file changed, 2 insertions(+)

Patch hide | download patch | download mbox

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")) {