diff options
author | Paul B Mahol <onemda@gmail.com> | 2013-07-29 00:00:42 +0200 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2013-07-29 00:00:42 +0200 |
commit | ef81f55ec7a95907ec0eb1cb8cbcc3c8fa68e2e6 (patch) | |
tree | 2b7a574347a2f1c78d15cfdf5db96af250ea01ee | |
parent | a1ac3c2d9cff3027d4d58300c5800084e1735619 (diff) | |
download | ffmpeg-ef81f55ec7a95907ec0eb1cb8cbcc3c8fa68e2e6.tar.gz |
Revert "pnm: remove nonsense code"
Breaks decoding pgms with 255 < maxval < 65535.
Found-by: Carl Eugen Hoyos <cehoyos@ag.or.at>.
This reverts commit a0348d0966a81a66f3a1bf061576b24d5296b933.
(cherry picked from commit 768e40b451a459fefaceed6b1b3d6e70c93596ac)
-rw-r--r-- | libavcodec/pnm.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/pnm.c b/libavcodec/pnm.c index 13ecbb057f..e73f5a7acb 100644 --- a/libavcodec/pnm.c +++ b/libavcodec/pnm.c @@ -163,6 +163,8 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s) if (s->maxval >= 256) { if (avctx->pix_fmt == AV_PIX_FMT_GRAY8) { avctx->pix_fmt = AV_PIX_FMT_GRAY16BE; + if (s->maxval != 65535) + avctx->pix_fmt = AV_PIX_FMT_GRAY16; } else if (avctx->pix_fmt == AV_PIX_FMT_RGB24) { avctx->pix_fmt = AV_PIX_FMT_RGB48BE; } else { |