mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
tiff: support inverted fill_order for packbits compression
Fixes #1995. Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
parent
30d7dcce4c
commit
7984ed87c1
@ -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");
|
av_log(s->avctx, AV_LOG_ERROR, "Read went out of bounds\n");
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
code = (int8_t) * src++;
|
code = s->fill_order ? (int8_t) ff_reverse[*src++]: (int8_t) *src++;
|
||||||
if (code >= 0) {
|
if (code >= 0) {
|
||||||
code++;
|
code++;
|
||||||
if (pixels + code > width) {
|
if (pixels + code > width) {
|
||||||
@ -578,6 +578,11 @@ static int tiff_unpack_strip(TiffContext *s, uint8_t *dst, int stride,
|
|||||||
pixels += code;
|
pixels += code;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (s->fill_order) {
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < width; i++)
|
||||||
|
dst[i] = ff_reverse[dst[i]];
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case TIFF_LZW:
|
case TIFF_LZW:
|
||||||
pixels = ff_lzw_decode(s->lzw, dst, width);
|
pixels = ff_lzw_decode(s->lzw, dst, width);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user