Fix a crash when reading gray pam files.
authorCarl Eugen Hoyos <cehoyos@ag.or.at>
Wed, 28 Dec 2011 04:59:39 +0000 (05:59 +0100)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Wed, 28 Dec 2011 04:59:39 +0000 (05:59 +0100)
Fixes ticket #837.

libavcodec/pnm.c

index 09530f8..680034a 100644 (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;