diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-10-02 04:18:22 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-10-26 17:34:42 +0200 |
commit | 6b9ffcdb2bac691ff76febb7f0b60f31109f3fb0 (patch) | |
tree | 7c0f1fbb5f31850d6e865857aa82375b3d3880a5 | |
parent | 520daf8c0ec493d30a8737e667b2602a6aa9a802 (diff) | |
download | ffmpeg-6b9ffcdb2bac691ff76febb7f0b60f31109f3fb0.tar.gz |
avcodec/proresdec2: SKIP_BITS() does not work with len=32
Fixes: invalid shift
Fixes: 3482/clusterfuzz-testcase-minimized-5446915875405824
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 c37138e01a93da2f9dd2cc5d4b77e5a38581d130)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/proresdec2.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/proresdec2.c b/libavcodec/proresdec2.c index 779ae6a999..fe5fddc747 100644 --- a/libavcodec/proresdec2.c +++ b/libavcodec/proresdec2.c @@ -267,7 +267,7 @@ static int decode_picture_header(AVCodecContext *avctx, const uint8_t *buf, cons \ if (q > switch_bits) { /* exp golomb */ \ bits = exp_order - switch_bits + (q<<1); \ - if (bits > MIN_CACHE_BITS) \ + if (bits > FFMIN(MIN_CACHE_BITS, 31)) \ return AVERROR_INVALIDDATA; \ val = SHOW_UBITS(re, gb, bits) - (1 << exp_order) + \ ((switch_bits + 1) << rice_order); \ |