Browse Source

avcodec/dirac_vlc: Fix invalid shift in ff_dirac_golomb_read_32bit()

Fixes: runtime error: shift exponent 64 is too large for 64-bit type 'residual' (aka 'unsigned long')
Fixes: 2838/clusterfuzz-testcase-minimized-6260066086813696

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 c595139f1f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.3.4
Michael Niedermayer 8 years ago
parent
commit
8a640fc7cb
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      libavcodec/dirac_vlc.c

+ 3
- 0
libavcodec/dirac_vlc.c View File

@@ -56,6 +56,9 @@ int ff_dirac_golomb_read_32bit(DiracGolombLUT *lut_ctx, const uint8_t *buf,
if ((c_idx + 1) > coeffs)
return c_idx;

if (res_bits >= RSIZE_BITS)
res_bits = res = 0;

/* res_bits is a hint for better branch prediction */
if (res_bits && l->sign) {
int32_t coeff = 1;


Loading…
Cancel
Save