Browse Source

avcodec/dvdec: Use av_clip_uint8 instead of ff_crop_tab

Fixes: out of array access
Fixes: 18788/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DVVIDEO_fuzzer-6254863113781248

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Baptiste Coudurier <baptiste.coudurier@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.3
Michael Niedermayer 6 years ago
parent
commit
d73f062706
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      libavcodec/dvdec.c

+ 1
- 2
libavcodec/dvdec.c View File

@@ -272,11 +272,10 @@ static inline void bit_copy(PutBitContext *pb, GetBitContext *gb)
static av_always_inline void put_block_8x4(int16_t *block, uint8_t *av_restrict p, int stride)
{
int i, j;
const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP;

for (i = 0; i < 4; i++) {
for (j = 0; j < 8; j++)
p[j] = cm[block[j]];
p[j] = av_clip_uint8(block[j]);
block += 8;
p += stride;
}


Loading…
Cancel
Save