Assume gray8 if 1 < maxval <= 255 in pgm.
authorCarl Eugen Hoyos <cehoyos@ag.or.at>
Sun, 28 Jul 2013 16:12:23 +0000 (18:12 +0200)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Sun, 28 Jul 2013 16:12:23 +0000 (18:12 +0200)
libavcodec/pnm.c

index 308457b..6e2e96c 100644 (file)
@@ -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;