[FFmpeg-devel] [PATCH 3/6] avcodec/pngdec: dont skip/read chunk twice

Michael Niedermayer michael at niedermayer.cc
Thu Jan 12 01:54:29 EET 2023


Fixes: out of array access
Fixes: 48567/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PNG_fuzzer-6668158952144896.fuzz

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/pngdec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index cb4162d2ab..95bcfb514a 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -1231,6 +1231,7 @@ static int decode_frame_common(AVCodecContext *avctx, PNGDecContext *s,
                 }
                 av_log(avctx, AV_LOG_ERROR, ", skipping\n");
                 bytestream2_skip(&s->gb, length + 8); /* tag */
+                continue;
             }
         }
         tag = bytestream2_get_le32(&s->gb);
-- 
2.17.1



More information about the ffmpeg-devel mailing list