From 329221eee7d643c9b417043dadba856a313c9817 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Sun, 28 Jul 2013 21:18:51 +0000 Subject: [PATCH] pnm: fix 255 < maxval < 65535 for pam with depth 1 Signed-off-by: Paul B Mahol --- libavcodec/pnm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/pnm.c b/libavcodec/pnm.c index 5a24befa36..578fe34a6a 100644 --- a/libavcodec/pnm.c +++ b/libavcodec/pnm.c @@ -118,6 +118,8 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s) avctx->pix_fmt = AV_PIX_FMT_MONOBLACK; } else if (maxval < 256) { avctx->pix_fmt = AV_PIX_FMT_GRAY8; + } else if (maxval < 65535) { + avctx->pix_fmt = AV_PIX_FMT_GRAY16; } else { avctx->pix_fmt = AV_PIX_FMT_GRAY16BE; }