]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/flicvideo: Fix off by 1 error in flic_decode_frame_24BPP()
authorMichael Niedermayer <michael@niedermayer.cc>
Fri, 21 Jun 2019 21:45:36 +0000 (23:45 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 8 Jul 2019 06:44:24 +0000 (08:44 +0200)
Fixes: out of array access
Fixes: 15360/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FLIC_fuzzer-5653837190266880
Fixes: 15412/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FLIC_fuzzer-5740537648250880
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/flicvideo.c

index ba5bda48c4874576d944455af216bbf38a13b993..c0e1e16bcdc4a6a6c0d7ec015f6bce75d4c32ee2 100644 (file)
@@ -900,7 +900,7 @@ static int flic_decode_frame_24BPP(AVCodecContext *avctx,
                         } else {
                             if (bytestream2_tell(&g2) + 2*byte_run > stream_ptr_after_chunk)
                                 break;
-                            CHECK_PIXEL_PTR(2 * byte_run);
+                            CHECK_PIXEL_PTR(3 * byte_run);
                             for (j = 0; j < byte_run; j++, pixel_countdown--) {
                                 pixel = bytestream2_get_le24(&g2);
                                 AV_WL24(&pixels[pixel_ptr], pixel);