From 7e8e8ba9cc2b074b988e8ab28f69cfc5d454d674 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Sun, 28 Jul 2013 18:12:23 +0200 Subject: Assume gray8 if 1 < maxval <= 255 in pgm. --- libavcodec/pnm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libavcodec/pnm.c') diff --git a/libavcodec/pnm.c b/libavcodec/pnm.c index 308457bbe9..6e2e96c403 100644 --- a/libavcodec/pnm.c +++ b/libavcodec/pnm.c @@ -116,7 +116,7 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s) if (depth == 1) { if (maxval == 1) { avctx->pix_fmt = AV_PIX_FMT_MONOBLACK; - } else if (maxval == 255) { + } else if (maxval < 256) { avctx->pix_fmt = AV_PIX_FMT_GRAY8; } else { avctx->pix_fmt = AV_PIX_FMT_GRAY16BE; -- cgit v1.2.3