diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2016-09-17 19:19:51 +0800 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2016-09-18 12:42:39 +0800 |
commit | c7a7471c35c803c130d2bfa7fc1a57967364c91e (patch) | |
tree | 3926780baee684cd7f4c50e2e8713e5c39e35dc6 /source | |
parent | a7376dbdcdca7862d59951595b6faad31e200465 (diff) | |
download | mupdf-c7a7471c35c803c130d2bfa7fc1a57967364c91e.tar.xz |
tiff: Do not assume that images always have alpha component.
Diffstat (limited to 'source')
-rw-r--r-- | source/fitz/load-tiff.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/fitz/load-tiff.c b/source/fitz/load-tiff.c index 8f4c2629..ace925d8 100644 --- a/source/fitz/load-tiff.c +++ b/source/fitz/load-tiff.c @@ -871,6 +871,7 @@ fz_load_tiff_subimage(fz_context *ctx, unsigned char *buf, size_t len, int subim { fz_pixmap *image; struct tiff tiff = { 0 }; + int alpha; fz_try(ctx) { @@ -891,7 +892,8 @@ fz_load_tiff_subimage(fz_context *ctx, unsigned char *buf, size_t len, int subim fz_swap_tiff_byte_order(tiff.samples, tiff.imagewidth * tiff.imagelength * tiff.samplesperpixel); /* Expand into fz_pixmap struct */ - image = fz_new_pixmap(ctx, tiff.colorspace, tiff.imagewidth, tiff.imagelength, 1); + alpha = tiff.extrasamples != 0; + image = fz_new_pixmap(ctx, tiff.colorspace, tiff.imagewidth, tiff.imagelength, alpha); image->xres = tiff.xresolution; image->yres = tiff.yresolution; |