aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-04-16 22:04:53 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2018-07-10 01:52:55 +0200
commit79cc326baba5ed80e752d9d03f110e7d3a15354b (patch)
tree89b844684fd2c55ea879ce8e20c825d66c9d655d
parentbd7231cad119894d79c4f05c2e5471caee66d197 (diff)
downloadffmpeg-79cc326baba5ed80e752d9d03f110e7d3a15354b.tar.gz
avcodec/dfa: Check dimension against maximum
The headers from where the dimensions are read in actual files are limited to 16bit per component. Fixes: Timeout Fixes: 6305/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DFA_fuzzer-4824270749302784 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 9d5a4fcfbb51edc871bdb1c67a88223cbfb1c0e4) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/dfa.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/dfa.c b/libavcodec/dfa.c
index 8067ac94e5..b8500a4995 100644
--- a/libavcodec/dfa.c
+++ b/libavcodec/dfa.c
@@ -41,7 +41,7 @@ static av_cold int dfa_decode_init(AVCodecContext *avctx)
avctx->pix_fmt = AV_PIX_FMT_PAL8;
- if (!avctx->width || !avctx->height)
+ if (!avctx->width || !avctx->height || FFMAX(avctx->width, avctx->height) >= (1<<16))
return AVERROR_INVALIDDATA;
av_assert0(av_image_check_size(avctx->width, avctx->height, 0, avctx) >= 0);