From 3afdd3e11a2d1239aca7c6350110aee7371d862e Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Fri, 3 May 2019 23:21:19 +0200 Subject: [PATCH] avcodec/pnm_parser: clear state if buffer is discarded 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 Reviewed-by: Paul B Mahol Signed-off-by: Michael Niedermayer --- 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);