Skip to content
Snippets Groups Projects
Commit b9c94e82 authored by Piotr Bandurski's avatar Piotr Bandurski Committed by Paul B Mahol
Browse files

xwddec: support 8bpp grayscale

parent 244682dd
No related branches found
No related tags found
No related merge requests found
...@@ -157,10 +157,13 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data, ...@@ -157,10 +157,13 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data,
switch (vclass) { switch (vclass) {
case XWD_STATIC_GRAY: case XWD_STATIC_GRAY:
case XWD_GRAY_SCALE: case XWD_GRAY_SCALE:
if (bpp != 1) if (bpp != 1 && bpp != 8)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
if (pixdepth == 1) if (pixdepth == 1) {
avctx->pix_fmt = PIX_FMT_MONOWHITE; avctx->pix_fmt = PIX_FMT_MONOWHITE;
} else if (pixdepth == 8) {
avctx->pix_fmt = PIX_FMT_GRAY8;
}
break; break;
case XWD_STATIC_COLOR: case XWD_STATIC_COLOR:
case XWD_PSEUDO_COLOR: case XWD_PSEUDO_COLOR:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment