Browse Source

avcodec/pixlet: Fix reading invalid numbers of bits

Fixes: asertion failure
Fixes: 1664/clusterfuzz-testcase-minimized-6587801187385344

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d32ebce8fd)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.3.2
Michael Niedermayer 8 years ago
parent
commit
fc7c379060
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      libavcodec/pixlet.c

+ 2
- 0
libavcodec/pixlet.c View File

@@ -229,6 +229,8 @@ static int read_high_coeffs(AVCodecContext *avctx, uint8_t *src, int16_t *dst, i
cnt1 = get_bits(b, nbits);
} else {
pfx = 14 + ((((uint64_t)(value - 14)) >> 32) & (value - 14));
if (pfx < 1 || pfx > 25)
return AVERROR_INVALIDDATA;
cnt1 *= (1 << pfx) - 1;
shbits = show_bits(b, pfx);
if (shbits <= 1) {


Loading…
Cancel
Save