summaryrefslogtreecommitdiffstats
path: root/libavcodec/diracdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-02-25 21:37:45 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2019-03-03 13:17:02 +0100
commit1eb35eb50ed32c9f36b6f3e39e8058d13f693c5e (patch)
treee98ef914fc45fba864a5e801ddb36bce0aa09820 /libavcodec/diracdec.c
parent73b62f302695822bf05f9fa43c8967d05868d49b (diff)
downloadffmpeg-streaming-1eb35eb50ed32c9f36b6f3e39e8058d13f693c5e.zip
ffmpeg-streaming-1eb35eb50ed32c9f36b6f3e39e8058d13f693c5e.tar.gz
avcodec/diracdec: Correct max pixels check
Dirac internally allocates 5 images per plane and frame currently. One being the actual image the other 4 being filtered for motion compensation. Fixes: Out of memory Fixes: 12870/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5684825871089664 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/diracdec.c')
-rw-r--r--libavcodec/diracdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index db010b4..30b4bfa 100644
--- a/libavcodec/diracdec.c
+++ b/libavcodec/diracdec.c
@@ -2137,7 +2137,7 @@ static int dirac_decode_data_unit(AVCodecContext *avctx, const uint8_t *buf, int
return ret;
}
- if (CALC_PADDING((int64_t)dsh->width, MAX_DWT_LEVELS) * CALC_PADDING((int64_t)dsh->height, MAX_DWT_LEVELS) > avctx->max_pixels)
+ if (CALC_PADDING((int64_t)dsh->width, MAX_DWT_LEVELS) * CALC_PADDING((int64_t)dsh->height, MAX_DWT_LEVELS) * 5LL > avctx->max_pixels)
ret = AVERROR(ERANGE);
if (ret >= 0)
ret = ff_set_dimensions(avctx, dsh->width, dsh->height);
OpenPOWER on IntegriCloud