Browse Source

avcodec/midivid: Check vector index

Fixes: out of array read
Fixes: 20494/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MVDV_fuzzer-5681452423577600

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.3
Michael Niedermayer 6 years ago
parent
commit
b0eec1391e
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      libavcodec/midivid.c

+ 2
- 0
libavcodec/midivid.c View File

@@ -126,6 +126,8 @@ static int decode_mvdv(MidiVidContext *s, AVCodecContext *avctx, AVFrame *frame)
idx9bits--;
idx = bytestream2_get_byte(gb) | (((idx9val >> (7 - idx9bits)) & 1) << 8);
}
if (idx >= nb_vectors)
return AVERROR_INVALIDDATA;

dsty[x +frame->linesize[0]] = vec[idx * 12 + 0];
dsty[x+1+frame->linesize[0]] = vec[idx * 12 + 3];


Loading…
Cancel
Save