diff --git a/libavcodec/pnm.c b/libavcodec/pnm.c index c5c600b841..1baf1a7d6c 100644 --- a/libavcodec/pnm.c +++ b/libavcodec/pnm.c @@ -163,8 +163,6 @@ 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) { if (s->maxval > 255) avctx->pix_fmt = AV_PIX_FMT_RGB48BE;