pnm: fix 255 < maxval < 65535 for pam with depth 1
authorPaul B Mahol <onemda@gmail.com>
Sun, 28 Jul 2013 21:18:51 +0000 (21:18 +0000)
committerPaul B Mahol <onemda@gmail.com>
Sun, 28 Jul 2013 22:27:36 +0000 (22:27 +0000)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavcodec/pnm.c

index 5a24bef..578fe34 100644 (file)
@@ -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;
             }