Browse Source

vcodec/agm: Alloc based on coded dimensions

Fixes: out of array read
Fixes: 18715/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AGM_fuzzer-5659333417500672

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>
(cherry picked from commit bfa8272f40)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.2.2
Michael Niedermayer 6 years ago
parent
commit
1c24ab39b6
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavcodec/agm.c

+ 1
- 1
libavcodec/agm.c View File

@@ -827,7 +827,7 @@ static int decode_intra(AVCodecContext *avctx, GetBitContext *gb, AVFrame *frame
static int decode_motion_vectors(AVCodecContext *avctx, GetBitContext *gb)
{
AGMContext *s = avctx->priv_data;
int nb_mvs = ((avctx->height + 15) >> 4) * ((avctx->width + 15) >> 4);
int nb_mvs = ((avctx->coded_height + 15) >> 4) * ((avctx->coded_width + 15) >> 4);
int ret, skip = 0, value, map;

av_fast_padded_malloc(&s->mvectors, &s->mvectors_size,


Loading…
Cancel
Save