X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=libavcodec%2Fxwddec.c;h=8b0845fc01376292129e47542d9813e963d3fca9;hb=f089e02fa2b7716d9fa5228c734e55678437db85;hp=64cd8418a2083ef2b54db1b476e049efeebc0413;hpb=e166fe2e1f0ae175a6b7f1f4b137c1366fd7f633;p=ffmpeg diff --git a/libavcodec/xwddec.c b/libavcodec/xwddec.c index 64cd8418a20..8b0845fc013 100644 --- a/libavcodec/xwddec.c +++ b/libavcodec/xwddec.c @@ -157,9 +157,9 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data, case XWD_GRAY_SCALE: if (bpp != 1 && bpp != 8) return AVERROR_INVALIDDATA; - if (pixdepth == 1) { + if (bpp == 1 && pixdepth == 1) { avctx->pix_fmt = AV_PIX_FMT_MONOWHITE; - } else if (pixdepth == 8) { + } else if (bpp == 8 && pixdepth == 8) { avctx->pix_fmt = AV_PIX_FMT_GRAY8; } break;