%
*/
-static unsigned char *ExpandBuffer(unsigned char *pixels,
- MagickSizeType *bytes_per_line,const unsigned int bits_per_pixel)
+static const unsigned char *ExpandBuffer(const unsigned char *restrict pixels,
+ const unsigned int bits_per_pixel,MagickSizeType *bytes_per_line)
{
+ register const unsigned char
+ *p;
+
register ssize_t
i;
register unsigned char
- *p,
*q;
static unsigned char
MagickSizeType
number_pixels;
+ register const unsigned char
+ *p;
+
register ssize_t
i;
register unsigned char
- *p,
*q;
size_t
status=MagickFalse;
break;
}
- p=ExpandBuffer(scanline,&number_pixels,bits_per_pixel);
+ p=ExpandBuffer(scanline,bits_per_pixel,&number_pixels);
if ((q+number_pixels) > (pixels+(*extent)))
{
status=MagickFalse;
{
length=(size_t) ((scanline[j] & 0xff)+1);
number_pixels=length*bytes_per_pixel;
- p=ExpandBuffer(scanline+j+1,&number_pixels,bits_per_pixel);
+ p=ExpandBuffer(scanline+j+1,bits_per_pixel,&number_pixels);
if ((q-pixels+number_pixels) <= *extent)
(void) memcpy(q,p,(size_t) number_pixels);
q+=number_pixels;
{
length=(size_t) (((scanline[j] ^ 0xff) & 0xff)+2);
number_pixels=bytes_per_pixel;
- p=ExpandBuffer(scanline+j+1,&number_pixels,bits_per_pixel);
+ p=ExpandBuffer(scanline+j+1,bits_per_pixel,&number_pixels);
for (i=0; i < (ssize_t) length; i++)
{
if ((q-pixels+number_pixels) <= *extent)
Clipping rectangle.
*/
length=ReadBlobMSBShort(image);
- if (length > GetBlobSize(image))
+ if ((MagickSizeType) length > GetBlobSize(image))
ThrowPICTException(CorruptImageError,
"InsufficientImageDataInFile");
if (length != 0x000a)
if (pattern != 1)
ThrowPICTException(CorruptImageError,"UnknownPatternType");
length=ReadBlobMSBShort(image);
- if (length > GetBlobSize(image))
+ if ((MagickSizeType) length > GetBlobSize(image))
ThrowPICTException(CorruptImageError,
"InsufficientImageDataInFile");
if (ReadRectangle(image,&frame) == MagickFalse)
(void) ReadBlobMSBLong(image);
flags=(ssize_t) ReadBlobMSBShort(image);
length=ReadBlobMSBShort(image);
- if (length > GetBlobSize(image))
+ if ((MagickSizeType) length > GetBlobSize(image))
ThrowPICTException(CorruptImageError,
"InsufficientImageDataInFile");
for (i=0; i <= (ssize_t) length; i++)
Skip polygon or region.
*/
length=ReadBlobMSBShort(image);
- if (length > GetBlobSize(image))
+ if ((MagickSizeType) length > GetBlobSize(image))
ThrowPICTException(CorruptImageError,
"InsufficientImageDataInFile");
for (i=0; i < (ssize_t) (length-2); i++)
Skip region.
*/
length=ReadBlobMSBShort(image);
- if (length > GetBlobSize(image))
+ if ((MagickSizeType) length > GetBlobSize(image))
ThrowPICTException(CorruptImageError,
"InsufficientImageDataInFile");
for (i=0; i < (ssize_t) (length-2); i++)
*/
type=ReadBlobMSBShort(image);
length=ReadBlobMSBShort(image);
- if (length > GetBlobSize(image))
+ if ((MagickSizeType) length > GetBlobSize(image))
ThrowPICTException(CorruptImageError,
"InsufficientImageDataInFile");
if (length == 0)
ThrowPICTException(FileOpenError,"UnableToCreateTemporaryFile");
}
length=ReadBlobMSBLong(image);
- if (length > GetBlobSize(image))
+ if ((MagickSizeType) length > GetBlobSize(image))
ThrowPICTException(CorruptImageError,
"InsufficientImageDataInFile");
if (length > 154)
Skip reserved.
*/
length=ReadBlobMSBShort(image);
- if (length > GetBlobSize(image))
+ if ((MagickSizeType) length > GetBlobSize(image))
ThrowPICTException(CorruptImageError,
"InsufficientImageDataInFile");
for (i=0; i < (ssize_t) length; i++)
Skip reserved.
*/
length=(size_t) ((code >> 7) & 0xff);
- if (length > GetBlobSize(image))
+ if ((MagickSizeType) length > GetBlobSize(image))
ThrowPICTException(CorruptImageError,
"InsufficientImageDataInFile");
for (i=0; i < (ssize_t) length; i++)
(void) WriteBlobMSBShort(image,0x0000);
(void) WriteBlobMSBShort(image,(unsigned short) y_resolution);
(void) WriteBlobMSBShort(image,0x0000);
- (void) WriteBlobMSBLong(image,length);
+ (void) WriteBlobMSBLong(image,(unsigned int) length);
(void) WriteBlobMSBShort(image,0x0001);
(void) WriteBlobMSBLong(image,0x0B466F74U);
(void) WriteBlobMSBLong(image,0x6F202D20U);