diff options
-rw-r--r-- | gpdl/tifftop.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gpdl/tifftop.c b/gpdl/tifftop.c index 1ad40aaa5..365d75243 100644 --- a/gpdl/tifftop.c +++ b/gpdl/tifftop.c @@ -728,6 +728,8 @@ do_impl_process(pl_interp_implementation_t * impl, stream_cursor_read * pr, int goto fail_decode; } else if (tiff->tiled) { tiff->samples = gs_alloc_bytes(tiff->memory, TIFFTileSize(tiff->handle), "tiff_tile"); + } else if (planar == PLANARCONFIG_SEPARATE) { + tiff->samples = gs_alloc_bytes(tiff->memory, tiff->byte_width * tiff->num_comps, "tiff_scan"); } else { tiff->samples = gs_alloc_bytes(tiff->memory, tiff->byte_width, "tiff_scan"); } @@ -1002,8 +1004,10 @@ do_impl_process(pl_interp_implementation_t * impl, stream_cursor_read * pr, int goto fail_decode; } } else { - int span = tiff->byte_width / tiff->num_comps; + int span = tiff->byte_width; byte *in_row = tiff->samples; + if (planar != PLANARCONFIG_SEPARATE) + span /= tiff->num_comps; row = tiff->proc_samples; for (s = 0; s < tiff->num_comps; s++) { plane_data[s].data = row; |