Commit 190a0998 authored by Carl Eugen Hoyos's avatar Carl Eugen Hoyos

Fix a crash when reading gray pam files.

Fixes ticket #837.
parent c1bc1967
...@@ -109,6 +109,7 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s) ...@@ -109,6 +109,7 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s)
avctx->width = w; avctx->width = w;
avctx->height = h; avctx->height = h;
s->maxval = maxval;
if (depth == 1) { if (depth == 1) {
if (maxval == 1) if (maxval == 1)
avctx->pix_fmt = PIX_FMT_MONOWHITE; avctx->pix_fmt = PIX_FMT_MONOWHITE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment