ffmpeg | branch: master | Michael Niedermayer <[email protected]> | Thu 
Apr 11 00:36:48 2019 +0200| [3308e3da045e8a01ee08affa33a2d424629ca2e3] | 
committer: Michael Niedermayer

avcodec/agm: Check frame dimensions

Fixes: out of array access
Fixes: 
14110/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AGM_fuzzer-5649184864075776

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3308e3da045e8a01ee08affa33a2d424629ca2e3
---

 libavcodec/agm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/agm.c b/libavcodec/agm.c
index ab9b93a5f8..f5fd5d065e 100644
--- a/libavcodec/agm.c
+++ b/libavcodec/agm.c
@@ -1178,6 +1178,9 @@ static int decode_frame(AVCodecContext *avctx, void *data,
             av_log(avctx, AV_LOG_ERROR, "Missing reference frame.\n");
             return AVERROR_INVALIDDATA;
         }
+        if (s->prev_frame-> width != frame->width ||
+            s->prev_frame->height != frame->height)
+            return AVERROR_INVALIDDATA;
 
         if (!(s->flags & 2)) {
             ret = av_frame_copy(frame, s->prev_frame);

_______________________________________________
ffmpeg-cvslog mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to