aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-11-14 15:10:28 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2019-12-31 19:51:56 +0100
commit1c24ab39b6d46685d619a7b22d8da970ea8606db (patch)
tree865f960caece25aad77437f785d283cdc21a2165
parent922837561b928e31ac1fde5835a69680c385f23c (diff)
downloadffmpeg-1c24ab39b6d46685d619a7b22d8da970ea8606db.tar.gz
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 bfa8272f405314582e8f099ec1a9249232553c9c) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/agm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/agm.c b/libavcodec/agm.c
index 3b2c21e9a7..89f85f03c6 100644
--- a/libavcodec/agm.c
+++ b/libavcodec/agm.c
@@ -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,