mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-01-07 22:55:27 +01:00
Revert "pnm: remove nonsense code"
Breaks decoding pgms with 255 < maxval < 65535. Found-by: Carl Eugen Hoyos <cehoyos@ag.or.at>. This reverts commita0348d0966. (cherry picked from commit768e40b451)
This commit is contained in:
committed by
Carl Eugen Hoyos
parent
a1ac3c2d9c
commit
ef81f55ec7
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user