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

Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
Paul B Mahol 2013-07-28 21:18:51 +00:00
parent 2c046c718a
commit 329221eee7

View File

@ -118,6 +118,8 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s)
avctx->pix_fmt = AV_PIX_FMT_MONOBLACK; avctx->pix_fmt = AV_PIX_FMT_MONOBLACK;
} else if (maxval < 256) { } else if (maxval < 256) {
avctx->pix_fmt = AV_PIX_FMT_GRAY8; avctx->pix_fmt = AV_PIX_FMT_GRAY8;
} else if (maxval < 65535) {
avctx->pix_fmt = AV_PIX_FMT_GRAY16;
} else { } else {
avctx->pix_fmt = AV_PIX_FMT_GRAY16BE; avctx->pix_fmt = AV_PIX_FMT_GRAY16BE;
} }