1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avformat/ffmdec: cleanup on extradata memory allocation failure

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2016-12-03 18:32:04 +01:00
parent fdf588d7cf
commit b98510de5c

View File

@ -379,8 +379,10 @@ FF_ENABLE_DEPRECATION_WARNINGS
goto fail;
}
codecpar->extradata = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!codecpar->extradata)
return AVERROR(ENOMEM);
if (!codecpar->extradata) {
ret = AVERROR(ENOMEM);
goto fail;
}
codecpar->extradata_size = size;
avio_read(pb, codecpar->extradata, size);
}
@ -690,8 +692,10 @@ FF_ENABLE_DEPRECATION_WARNINGS
goto fail;
}
codecpar->extradata = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!codecpar->extradata)
return AVERROR(ENOMEM);
if (!codecpar->extradata) {
ret = AVERROR(ENOMEM);
goto fail;
}
codecpar->extradata_size = size;
avio_read(pb, codecpar->extradata, size);
}