diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-04-11 21:04:12 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-09-10 16:04:26 +0200 |
commit | 98843a29ebac33bbcecec8b31ba6619b81d9238c (patch) | |
tree | 78ca74dfb904b8e875fa99385ce5e4013e127c28 | |
parent | d1ec3974a4d81a9631ca1ed60a4078ded3e2f195 (diff) | |
download | ffmpeg-98843a29ebac33bbcecec8b31ba6619b81d9238c.tar.gz |
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 <michael@niedermayer.cc>
(cherry picked from commit c093eb30311b7148a4da1c7555498187c8cdf0db)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-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); |