summaryrefslogtreecommitdiff
path: root/libavcodec/pnm.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/pnm.c')
-rw-r--r--libavcodec/pnm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/pnm.c b/libavcodec/pnm.c
index fa43c8d6e9..1defbc20e6 100644
--- a/libavcodec/pnm.c
+++ b/libavcodec/pnm.c
@@ -118,6 +118,9 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s)
} else {
avctx->pix_fmt = PIX_FMT_GRAY16BE;
}
+ } else if (depth == 2) {
+ if (maxval == 255)
+ avctx->pix_fmt = PIX_FMT_GRAY8A;
} else if (depth == 3) {
if (maxval < 256) {
avctx->pix_fmt = PIX_FMT_RGB24;