FFmpeg does not support gray16a.
Fixes the crash in ticket #644.
(cherry picked from commit 0c5fd6372e6c257912d7ae64cbfc4d8541f0452f)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
... | ... |
@@ -471,7 +471,8 @@ static int decode_frame(AVCodecContext *avctx, |
471 | 471 |
avctx->pix_fmt = PIX_FMT_MONOBLACK; |
472 | 472 |
} else if (s->color_type == PNG_COLOR_TYPE_PALETTE) { |
473 | 473 |
avctx->pix_fmt = PIX_FMT_PAL8; |
474 |
- } else if (s->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) { |
|
474 |
+ } else if (s->bit_depth == 8 && |
|
475 |
+ s->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) { |
|
475 | 476 |
avctx->pix_fmt = PIX_FMT_GRAY8A; |
476 | 477 |
} else { |
477 | 478 |
goto fail; |