Commit 7984ed87 authored by Paul B Mahol's avatar Paul B Mahol

tiff: support inverted fill_order for packbits compression

Fixes #1995.
Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 30d7dcce
......@@ -549,7 +549,7 @@ static int tiff_unpack_strip(TiffContext *s, uint8_t *dst, int stride,
av_log(s->avctx, AV_LOG_ERROR, "Read went out of bounds\n");
return AVERROR_INVALIDDATA;
}
code = (int8_t) * src++;
code = s->fill_order ? (int8_t) ff_reverse[*src++]: (int8_t) *src++;
if (code >= 0) {
code++;
if (pixels + code > width) {
......@@ -578,6 +578,11 @@ static int tiff_unpack_strip(TiffContext *s, uint8_t *dst, int stride,
pixels += code;
}
}
if (s->fill_order) {
int i;
for (i = 0; i < width; i++)
dst[i] = ff_reverse[dst[i]];
}
break;
case TIFF_LZW:
pixels = ff_lzw_decode(s->lzw, dst, width);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment