avformat/mvdec: check av_strdup() return value

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
This commit is contained in:
Steven Liu 2019-10-10 10:52:52 +08:00
parent 53928e0b49
commit b1071b405d

View File

@ -211,6 +211,8 @@ static int parse_video_var(AVFormatContext *avctx, AVStream *st,
} else if (!strcmp(name, "ORIENTATION")) { } else if (!strcmp(name, "ORIENTATION")) {
if (var_read_int(pb, size) == 1101) { if (var_read_int(pb, size) == 1101) {
st->codecpar->extradata = av_strdup("BottomUp"); st->codecpar->extradata = av_strdup("BottomUp");
if (!st->codecpar->extradata)
return AVERROR(ENOMEM);
st->codecpar->extradata_size = 9; st->codecpar->extradata_size = 9;
} }
} else if (!strcmp(name, "Q_SPATIAL") || !strcmp(name, "Q_TEMPORAL")) { } else if (!strcmp(name, "Q_SPATIAL") || !strcmp(name, "Q_TEMPORAL")) {