[FFmpeg-devel] [PATCH]Fix crash when reading gray pam

Carl Eugen Hoyos cehoyos at ag.or.at
Wed Dec 28 01:18:12 CET 2011


Hi!

Attached patch fixes ticket #837 for me.

Please comment, Carl Eugen
-------------- next part --------------
diff --git a/libavcodec/pnm.c b/libavcodec/pnm.c
index dfc18d6..b52cd27 100644
--- a/libavcodec/pnm.c
+++ b/libavcodec/pnm.c
@@ -107,6 +107,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;


More information about the ffmpeg-devel mailing list