summaryrefslogtreecommitdiff
path: root/libavcodec/pnm.c
diff options
context:
space:
mode:
authorami_stuff <ami_stuff@o2.pl>2012-01-05 20:57:49 +0100
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2012-01-05 20:57:49 +0100
commit871e2f4fac18230abe4d7154d90cb5cba1479692 (patch)
tree53f6c88d3078b7d6aa16056656628e2457a50e7a /libavcodec/pnm.c
parent02026d08a9c21205a474f586236a7d255189b92a (diff)
Support 16bpp grayscale pam decoding.
Fixes ticket #881.
Diffstat (limited to 'libavcodec/pnm.c')
-rw-r--r--libavcodec/pnm.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/pnm.c b/libavcodec/pnm.c
index 680034a3d5..06ab7018ca 100644
--- a/libavcodec/pnm.c
+++ b/libavcodec/pnm.c
@@ -111,10 +111,13 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s)
avctx->height = h;
s->maxval = maxval;
if (depth == 1) {
- if (maxval == 1)
+ if (maxval == 1) {
avctx->pix_fmt = PIX_FMT_MONOWHITE;
- else
+ } else if (maxval == 255) {
avctx->pix_fmt = PIX_FMT_GRAY8;
+ } else {
+ avctx->pix_fmt = PIX_FMT_GRAY16BE;
+ }
} else if (depth == 3) {
if (maxval < 256) {
avctx->pix_fmt = PIX_FMT_RGB24;