mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-11-24 03:59:43 +00:00
avcodec/vc1dec: Allocate only as much space as is unescaped
Fixes: OOM Fixes: 18137/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-5723834900021248 Fixes: 20037/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-5683758976204800 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
feeef2f80c
commit
6a69f04927
@ -701,7 +701,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
|
||||
goto err;
|
||||
}
|
||||
slices = tmp;
|
||||
slices[n_slices].buf = av_mallocz(buf_size + AV_INPUT_BUFFER_PADDING_SIZE);
|
||||
slices[n_slices].buf = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE);
|
||||
if (!slices[n_slices].buf) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto err;
|
||||
@ -730,7 +730,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
|
||||
goto err;
|
||||
}
|
||||
slices = tmp;
|
||||
slices[n_slices].buf = av_mallocz(buf_size + AV_INPUT_BUFFER_PADDING_SIZE);
|
||||
slices[n_slices].buf = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE);
|
||||
if (!slices[n_slices].buf) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto err;
|
||||
|
Loading…
Reference in New Issue
Block a user