mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-08 06:09:50 +00:00
avformat/mvdec: Allocate extradata only once
Fixes: memleak Fixes: 28686/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5822961932173312 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
1a549efefb
commit
c35e456f54
1 changed files with 6 additions and 4 deletions
|
|
@ -213,10 +213,12 @@ static int parse_video_var(AVFormatContext *avctx, AVStream *st,
|
||||||
st->codecpar->width = var_read_int(pb, size);
|
st->codecpar->width = var_read_int(pb, size);
|
||||||
} 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");
|
if (!st->codecpar->extradata) {
|
||||||
if (!st->codecpar->extradata)
|
st->codecpar->extradata = av_strdup("BottomUp");
|
||||||
return AVERROR(ENOMEM);
|
if (!st->codecpar->extradata)
|
||||||
st->codecpar->extradata_size = 9;
|
return AVERROR(ENOMEM);
|
||||||
|
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")) {
|
||||||
var_read_metadata(avctx, name, size);
|
var_read_metadata(avctx, name, size);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue