Support 8bpp grayscale Sun Rasterfile images.

Fixes ticket #865.
This commit is contained in:
Piotr Bandurski 2012-01-03 13:24:50 +01:00 committed by Carl Eugen Hoyos
parent 2ba3416362
commit 912e75169b
1 changed files with 2 additions and 2 deletions

View File

@ -93,7 +93,7 @@ static int sunrast_decode_frame(AVCodecContext *avctx, void *data,
avctx->pix_fmt = PIX_FMT_MONOWHITE;
break;
case 8:
avctx->pix_fmt = PIX_FMT_PAL8;
avctx->pix_fmt = maplength ? PIX_FMT_PAL8 : PIX_FMT_GRAY8;
break;
case 24:
avctx->pix_fmt = (type == RT_FORMAT_RGB) ? PIX_FMT_RGB24 : PIX_FMT_BGR24;
@ -121,7 +121,7 @@ static int sunrast_decode_frame(AVCodecContext *avctx, void *data,
if (depth != 8 && maplength) {
av_log(avctx, AV_LOG_WARNING, "useless colormap found or file is corrupted, trying to recover\n");
} else if (depth == 8) {
} else if (maplength) {
unsigned int len = maplength / 3;
if (!maplength) {