avcodec/pnm: Check magic bytes directly without pnm_get()
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 1 Aug 2019 18:04:15 +0000 (20:04 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 23 Aug 2019 20:26:50 +0000 (22:26 +0200)
commit1a0f106232f51cd20dc0ebab2c02de49ba26fa6b
tree9be814621ec52159fceadc82b65dcad896e5d318
parent77abf3145344341ec850e05d25a849c6f76fffa5
avcodec/pnm: Check magic bytes directly without pnm_get()

Fixes: Timeout (10sec -> 30ms) (case 15089)
Fixes: 15089/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PBM_fuzzer-5767535057698816
Fixes: 16001/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PGM_fuzzer-5199169645445120
Fixes: 16003/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PGMYUV_fuzzer-5076443270217728

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/pnm.c