summaryrefslogtreecommitdiff
path: root/libavcodec/pnm.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2013-07-28 21:18:51 +0000
committerPaul B Mahol <onemda@gmail.com>2013-07-28 22:27:36 +0000
commit329221eee7d643c9b417043dadba856a313c9817 (patch)
tree02e1c1d0828bd83a7bc69f4a031dba617acff621 /libavcodec/pnm.c
parent2c046c718aefbc9f8223e22f85bb119da4fea04d (diff)
downloadffmpeg-329221eee7d643c9b417043dadba856a313c9817.tar.gz
pnm: fix 255 < maxval < 65535 for pam with depth 1
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/pnm.c')
-rw-r--r--libavcodec/pnm.c2
1 files changed, 2 insertions, 0 deletions
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;
}