[FFmpeg-cvslog] pnm: fix 255 < maxval < 65535 for pam with depth 1

Paul B Mahol git at videolan.org
Mon Jul 29 00:27:47 CEST 2013


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sun Jul 28 21:18:51 2013 +0000| [329221eee7d643c9b417043dadba856a313c9817] | committer: Paul B Mahol

pnm: fix 255 < maxval < 65535 for pam with depth 1

Signed-off-by: Paul B Mahol <onemda at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=329221eee7d643c9b417043dadba856a313c9817
---

 libavcodec/pnm.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/pnm.c b/libavcodec/pnm.c
index 5a24bef..578fe34 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;
             }



More information about the ffmpeg-cvslog mailing list