[FFmpeg-devel] [PATCH 1/2] avcodec/pnm_parser: clear state if buffer is discarded

Michael Niedermayer michael at niedermayer.cc
Sat May 4 02:38:37 EEST 2019


Fixes: Assertion failure
Fixes: 14484/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PGMYUV_fuzzer-5150016408125440

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

diff --git a/libavcodec/pnm_parser.c b/libavcodec/pnm_parser.c
index de0e32ba9c..5339bebde9 100644
--- a/libavcodec/pnm_parser.c
+++ b/libavcodec/pnm_parser.c
@@ -69,6 +69,7 @@ retry:
         if (pnmctx.bytestream < pnmctx.bytestream_end) {
             if (pc->index) {
                 pc->index = 0;
+                pnmpc->ascii_scan = 0;
             } else {
                 unsigned step = FFMAX(1, pnmctx.bytestream - pnmctx.bytestream_start);
 
-- 
2.21.0



More information about the ffmpeg-devel mailing list