1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Do not stop decoding on pnm files with negative maxval.

Originally committed as revision 26304 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Carl Eugen Hoyos 2011-01-10 22:09:52 +00:00
parent c56e71309e
commit 8219782a6d

View File

@ -142,7 +142,7 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s)
s->maxval = atoi(buf1);
if (s->maxval <= 0) {
av_log(avctx, AV_LOG_ERROR, "Invalid maxval: %d\n", s->maxval);
return -1;
s->maxval = 255;
}
if (s->maxval >= 256) {
if (avctx->pix_fmt == PIX_FMT_GRAY8) {