Assume gray8 if 1 < maxval <= 255 in pgm.

pull/37/head
Carl Eugen Hoyos 12 years ago
parent ae4dc0b37a
commit 7e8e8ba9cc
  1. 2
      libavcodec/pnm.c

@ -116,7 +116,7 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s)
if (depth == 1) {
if (maxval == 1) {
avctx->pix_fmt = AV_PIX_FMT_MONOBLACK;
} else if (maxval == 255) {
} else if (maxval < 256) {
avctx->pix_fmt = AV_PIX_FMT_GRAY8;
} else {
avctx->pix_fmt = AV_PIX_FMT_GRAY16BE;

Loading…
Cancel
Save