mirror of
https://github.com/imagemagick/imagemagick
synced 2024-10-18 17:02:34 +00:00
Another improvement of calculating the size of the extent.
This commit is contained in:
parent
b019133ef4
commit
3151fd858f
|
@ -1906,15 +1906,14 @@ static Image *ReadTIFFImage(const ImageInfo *image_info,
|
|||
*/
|
||||
strip_size=TIFFStripSize(tiff);
|
||||
stride=(ssize_t) TIFFVStripSize(tiff,1);
|
||||
extent=(size_t) ((samples_per_pixel+extra_samples)*strip_size);
|
||||
length=GetQuantumExtent(image,quantum_info,quantum_type);
|
||||
if (length > stride)
|
||||
extent+=length;
|
||||
extent=MagickMax((size_t) strip_size,rows_per_strip*
|
||||
(size_t) MagickMax(stride,length));
|
||||
strip_pixels=(unsigned char *) AcquireQuantumMemory(extent,
|
||||
sizeof(uint32));
|
||||
sizeof(*strip_pixels));
|
||||
if (strip_pixels == (unsigned char *) NULL)
|
||||
ThrowTIFFException(ResourceLimitError,"MemoryAllocationFailed");
|
||||
(void) memset(strip_pixels,0,extent*sizeof(uint32));
|
||||
(void) memset(strip_pixels,0,extent*sizeof(*strip_pixels));
|
||||
strip_id=0;
|
||||
p=strip_pixels;
|
||||
for (i=0; i < (ssize_t) samples_per_pixel; i++)
|
||||
|
|
Loading…
Reference in a new issue