Fix a crash when reading gray pam files.

Fixes ticket #837.
This commit is contained in:
Carl Eugen Hoyos 2011-12-28 05:59:39 +01:00
parent c1bc1967f3
commit 190a0998c3

View File

@ -109,6 +109,7 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s)
avctx->width = w;
avctx->height = h;
s->maxval = maxval;
if (depth == 1) {
if (maxval == 1)
avctx->pix_fmt = PIX_FMT_MONOWHITE;