[FFmpeg-devel] [PATCH 1/2] avcodec/mobiclip: check for pmode=2 ax/ay=0

Michael Niedermayer michael at niedermayer.cc
Sat Sep 12 17:35:54 EEST 2020


Fixes: out of array access
Fixes: 25452/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MOBICLIP_fuzzer-5081657055641600

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavcodec/mobiclip.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/mobiclip.c b/libavcodec/mobiclip.c
index 13f0edc89d..3ede370bef 100644
--- a/libavcodec/mobiclip.c
+++ b/libavcodec/mobiclip.c
@@ -914,6 +914,9 @@ static int predict_intra(AVCodecContext *avctx, AVFrame *frame, int ax, int ay,
             int shift = adjust(size, size) == 8 ? 3 : 2;
             uint8_t *block;
 
+            if (ax == 0 && ay == 0)
+                return -1;
+
             for (int x = 0; x < size; x++) {
                 int val = top[x];
                 arr1[x] = adjust(((bottommost - val) * (1 << shift)) + r6 * (x + 1), size);
-- 
2.17.1



More information about the ffmpeg-devel mailing list