StringInfo
*profile;
+ unsigned char
+ name_length;
+
unsigned int
- count,
- long_sans;
+ count;
unsigned short
id,
SetStringInfoDatum(profile,blocks);
(void) SetImageProfile(image,"8bim",profile,exception);
profile=DestroyStringInfo(profile);
- for (p=blocks; (p >= blocks) && (p < (blocks+length-16)); )
+ for (p=blocks; (p >= blocks) && (p < (blocks+length-7)); )
{
if (LocaleNCompare((const char *) p,"8BIM",4) != 0)
break;
- p=PushLongPixel(MSBEndian,p,&long_sans);
+ p+=4;
p=PushShortPixel(MSBEndian,p,&id);
- p=PushShortPixel(MSBEndian,p,&short_sans);
+ p=PushCharPixel(p,&name_length);
+ if (name_length % 2 == 0)
+ name_length++;
+ p+=name_length;
+ if (p > (blocks+length-4))
+ return;
p=PushLongPixel(MSBEndian,p,&count);
- if ((p+count) > (blocks+length-16))
+ if ((p+count) > (blocks+length))
return;
switch (id)
{
/*
Resolution info.
*/
+ if (count < 16)
+ return;
p=PushShortPixel(MSBEndian,p,&resolution);
image->resolution.x=(double) resolution;
(void) FormatLocaleString(value,MagickPathExtent,"%g",image->resolution.x);
}
case 0x0421:
{
- if (*(p+4) == 0)
+ if ((count > 3) && (*(p+4) == 0))
*has_merged_image=MagickFalse;
p+=count;
break;