diff options
author | Piotr Bandurski <ami_stuff@o2.pl> | 2012-01-03 13:24:50 +0100 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2012-01-03 13:24:50 +0100 |
commit | 912e75169bcdf1599dc0991b99d7c717dd5c6769 (patch) | |
tree | 8656ef0eb9b0ddff342e6a78af4fbff84dd99e80 /libavcodec/sunrast.c | |
parent | 2ba3416362345f275c63e70f44f4cfbf9b66fb35 (diff) | |
download | ffmpeg-912e75169bcdf1599dc0991b99d7c717dd5c6769.tar.gz |
Support 8bpp grayscale Sun Rasterfile images.
Fixes ticket #865.
Diffstat (limited to 'libavcodec/sunrast.c')
-rw-r--r-- | libavcodec/sunrast.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/sunrast.c b/libavcodec/sunrast.c index 3e1cea6c36..c33265dc84 100644 --- a/libavcodec/sunrast.c +++ b/libavcodec/sunrast.c @@ -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) { |