diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2011-12-31 20:45:04 +0100 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2011-12-31 20:46:36 +0100 |
commit | 714d2f9796b56771b4fa587db6e674b950c15bd4 (patch) | |
tree | 47e2eb0011e9fce504467abd2ce82497ff0905fa /libavcodec/tiff.c | |
parent | 9d9316ae34ea2a5e481ac15f31d42c87a8ef4380 (diff) | |
download | ffmpeg-714d2f9796b56771b4fa587db6e674b950c15bd4.tar.gz |
Only expand raw and packed 1bpp tiff horizontally if it is palettised.
Diffstat (limited to 'libavcodec/tiff.c')
-rw-r--r-- | libavcodec/tiff.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index b353677087..b0ccbace15 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -224,7 +224,8 @@ static int tiff_unpack_strip(TiffContext *s, uint8_t* dst, int stride, const uin if (ssrc + size - src < width) return AVERROR_INVALIDDATA; if (!s->fill_order) { - horizontal_fill(s->bpp, dst, 1, src, 0, width, 0); + horizontal_fill(s->bpp * (s->avctx->pix_fmt == PIX_FMT_PAL8), + dst, 1, src, 0, width, 0); } else { int i; for (i = 0; i < width; i++) @@ -241,7 +242,8 @@ static int tiff_unpack_strip(TiffContext *s, uint8_t* dst, int stride, const uin av_log(s->avctx, AV_LOG_ERROR, "Copy went out of bounds\n"); return -1; } - horizontal_fill(s->bpp, dst, 1, src, 0, code, pixels); + horizontal_fill(s->bpp * (s->avctx->pix_fmt == PIX_FMT_PAL8), + dst, 1, src, 0, code, pixels); src += code; pixels += code; }else if(code != -128){ // -127..-1 @@ -251,7 +253,8 @@ static int tiff_unpack_strip(TiffContext *s, uint8_t* dst, int stride, const uin return -1; } c = *src++; - horizontal_fill(s->bpp, dst, 0, NULL, c, code, pixels); + horizontal_fill(s->bpp * (s->avctx->pix_fmt == PIX_FMT_PAL8), + dst, 0, NULL, c, code, pixels); pixels += code; } } |