mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-06 15:49:50 +08:00
pamdec: fix mono support.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@ -112,7 +112,7 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s)
|
||||
s->maxval = maxval;
|
||||
if (depth == 1) {
|
||||
if (maxval == 1) {
|
||||
avctx->pix_fmt = PIX_FMT_MONOWHITE;
|
||||
avctx->pix_fmt = PIX_FMT_MONOBLACK;
|
||||
} else if (maxval == 255) {
|
||||
avctx->pix_fmt = PIX_FMT_GRAY8;
|
||||
} else {
|
||||
@ -148,7 +148,7 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s)
|
||||
avctx->height = atoi(buf1);
|
||||
if(avctx->height <= 0 || av_image_check_size(avctx->width, avctx->height, 0, avctx))
|
||||
return -1;
|
||||
if (avctx->pix_fmt != PIX_FMT_MONOWHITE) {
|
||||
if (avctx->pix_fmt != PIX_FMT_MONOWHITE && avctx->pix_fmt != PIX_FMT_MONOBLACK) {
|
||||
pnm_get(s, buf1, sizeof(buf1));
|
||||
s->maxval = atoi(buf1);
|
||||
if (s->maxval <= 0) {
|
||||
|
Reference in New Issue
Block a user