Message ID | 20210711132634.14829-1-michael@niedermayer.cc |
---|---|
State | Accepted |
Commit | adae546f2462006c6deae63ecd6402c3a2f2f566 |
Headers | show |
Series | [FFmpeg-devel,1/3] avcodec/exr: Check uncompressed_size against max_pixels | expand |
Context | Check | Description |
---|---|---|
andriy/x86_make | success | Make finished |
andriy/x86_make_fate | success | Make fate finished |
andriy/PPC64_make | success | Make finished |
andriy/PPC64_make_fate | success | Make fate finished |
On Sun, Jul 11, 2021 at 03:26:32PM +0200, Michael Niedermayer wrote: > Fixes: Timeout > Fixes: 35286/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-6557139802914816 > Fixes: 31253/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-4901782326214656 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> > --- > libavcodec/exr.c | 3 +++ > 1 file changed, 3 insertions(+) will apply patchset [...]
diff --git a/libavcodec/exr.c b/libavcodec/exr.c index e7387ffd66..f7d59c8241 100644 --- a/libavcodec/exr.c +++ b/libavcodec/exr.c @@ -1299,6 +1299,9 @@ static int decode_block(AVCodecContext *avctx, void *tdata, axmax = FFMAX(0, (avctx->width - (s->xmax + 1))) * step; } + if (avctx->max_pixels && uncompressed_size > avctx->max_pixels * 16LL) + return AVERROR_INVALIDDATA; + if (data_size < uncompressed_size || s->is_tile) { /* td->tmp is use for tile reorganization */ av_fast_padded_malloc(&td->tmp, &td->tmp_size, uncompressed_size); if (!td->tmp)
Fixes: Timeout Fixes: 35286/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-6557139802914816 Fixes: 31253/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-4901782326214656 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> --- libavcodec/exr.c | 3 +++ 1 file changed, 3 insertions(+)