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 <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2019-05-03 23:21:19 +02:00
parent 98541f7032
commit 3afdd3e11a

View File

@ -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);