diff options
author | Michael Niedermayer <[email protected]> | 2021-04-11 21:04:12 +0200 |
---|---|---|
committer | Michael Niedermayer <[email protected]> | 2021-10-06 14:41:41 +0200 |
commit | ef02e544546b2878e583a09e3a47144b7fc1c2f6 (patch) | |
tree | 5b64af6d01b8fdcdb81cdbd257211da92e4b4d30 | |
parent | 9a0a851fae22cbd080c16d58d296ec98399761ee (diff) |
avcodec/dpx: Check bits_per_color earlier
Fixes: shift exponent 251 is too large for 32-bit type 'int'
Fixes: 32147/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DPX_fuzzer-5519111675314176
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <[email protected]>
(cherry picked from commit c093eb30311b7148a4da1c7555498187c8cdf0db)
Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r-- | libavcodec/dpx.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c index b1833ed9ef..03cbd3c78f 100644 --- a/libavcodec/dpx.c +++ b/libavcodec/dpx.c @@ -206,6 +206,9 @@ static int decode_frame(AVCodecContext *avctx, return AVERROR_PATCHWELCOME; } + if (bits_per_color > 32) + return AVERROR_INVALIDDATA; + buf += 820; avctx->sample_aspect_ratio.num = read32(&buf, endian); avctx->sample_aspect_ratio.den = read32(&buf, endian); |