Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Feb 12, 2020
1 parent 60b4bb2 commit 2d96228
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions coders/tiff.c
Expand Up @@ -1799,6 +1799,9 @@ RestoreMSCWarning
register unsigned char
*p;

size_t
extent;

ssize_t
stride,
strip_id;
Expand All @@ -1812,11 +1815,12 @@ RestoreMSCWarning
/*
Convert stripped TIFF image.
*/
strip_pixels=(unsigned char *) AcquireQuantumMemory(TIFFStripSize(tiff)+
sizeof(uint32),sizeof(*strip_pixels));
extent=TIFFStripSize(tiff)+sizeof(uint32);
strip_pixels=(unsigned char *) AcquireQuantumMemory(extent,
sizeof(*strip_pixels));
if (strip_pixels == (unsigned char *) NULL)
ThrowTIFFException(ResourceLimitError,"MemoryAllocationFailed");
(void) memset(strip_pixels,0,TIFFStripSize(tiff)*sizeof(*strip_pixels));
(void) memset(strip_pixels,0,extent*sizeof(*strip_pixels));
stride=TIFFVStripSize(tiff,1);
strip_id=0;
p=strip_pixels;
Expand Down Expand Up @@ -1885,6 +1889,9 @@ RestoreMSCWarning
register unsigned char
*p;

size_t
extent;

uint32
columns,
rows;
Expand All @@ -1904,8 +1911,9 @@ RestoreMSCWarning
number_pixels=(MagickSizeType) columns*rows;
if (HeapOverflowSanityCheck(rows,sizeof(*tile_pixels)) != MagickFalse)
ThrowTIFFException(ResourceLimitError,"MemoryAllocationFailed");
tile_pixels=(unsigned char *) AcquireQuantumMemory(TIFFTileSize(tiff)+
sizeof(uint32),sizeof(*tile_pixels));
extent=TIFFTileSize(tiff)+sizeof(uint32);
tile_pixels=(unsigned char *) AcquireQuantumMemory(extent,
sizeof(*tile_pixels));
if (tile_pixels == (unsigned char *) NULL)
ThrowTIFFException(ResourceLimitError,"MemoryAllocationFailed");
(void) memset(tile_pixels,0,TIFFTileSize(tiff)*sizeof(*tile_pixels));
Expand Down

0 comments on commit 2d96228

Please sign in to comment.