error_manager->profile=comment;
p=GetStringInfoDatum(comment);
for (i=0; i < (ssize_t) GetStringInfoLength(comment); i++)
- *p++=(unsigned char) GetCharacter(jpeg_info);
+ {
+ int
+ c;
+
+ c=GetCharacter(jpeg_info);
+ if (c == EOF)
+ break;
+ *p++=(unsigned char) c;
+ }
*p='\0';
error_manager->profile=NULL;
p=GetStringInfoDatum(comment);
if (length <= 14)
{
while (length-- > 0)
- (void) GetCharacter(jpeg_info);
+ if (GetCharacter(jpeg_info) == EOF)
+ break;
return(TRUE);
}
for (i=0; i < 12; i++)
Not a ICC profile, return.
*/
for (i=0; i < (ssize_t) (length-12); i++)
- (void) GetCharacter(jpeg_info);
+ if (GetCharacter(jpeg_info) == EOF)
+ break;
return(TRUE);
}
(void) GetCharacter(jpeg_info); /* id */
error_manager->profile=profile;
p=GetStringInfoDatum(profile);
for (i=(ssize_t) GetStringInfoLength(profile)-1; i >= 0; i--)
- *p++=(unsigned char) GetCharacter(jpeg_info);
+ {
+ int
+ c;
+
+ c=GetCharacter(jpeg_info);
+ if (c == EOF)
+ break;
+ *p++=(unsigned char) c;
+ }
error_manager->profile=NULL;
icc_profile=(StringInfo *) GetImageProfile(image,"icc");
if (icc_profile != (StringInfo *) NULL)
if (length <= 14)
{
while (length-- > 0)
- (void) GetCharacter(jpeg_info);
+ if (GetCharacter(jpeg_info) == EOF)
+ break;
return(TRUE);
}
/*
Not a IPTC profile, return.
*/
for (i=0; i < (ssize_t) length; i++)
- (void) GetCharacter(jpeg_info);
+ if (GetCharacter(jpeg_info) == EOF)
+ break;
return(TRUE);
}
/*
Remove the version number.
*/
for (i=0; i < 4; i++)
- (void) GetCharacter(jpeg_info);
+ if (GetCharacter(jpeg_info) == EOF)
+ break;
if (length <= 11)
return(TRUE);
length-=4;
error_manager->profile=profile;
p=GetStringInfoDatum(profile);
for (i=0; i < (ssize_t) GetStringInfoLength(profile); i++)
- *p++=(unsigned char) GetCharacter(jpeg_info);
+ {
+ int
+ c;
+
+ c=GetCharacter(jpeg_info);
+ if (c == EOF)
+ break;
+ *p++=(unsigned char) c;
+ }
error_manager->profile=NULL;
iptc_profile=(StringInfo *) GetImageProfile(image,"8bim");
if (iptc_profile != (StringInfo *) NULL)
error_manager->profile=profile;
p=GetStringInfoDatum(profile);
for (i=0; i < (ssize_t) GetStringInfoLength(profile); i++)
- *p++=(unsigned char) GetCharacter(jpeg_info);
+ {
+ int
+ c;
+
+ c=GetCharacter(jpeg_info);
+ if (c == EOF)
+ break;
+ *p++=(unsigned char) c;
+ }
error_manager->profile=NULL;
if (marker == 1)
{
if (memcmp(type,mng_DEFI,4) == 0)
{
if (mng_type == 3)
- (void) ThrowMagickException(exception,GetMagickModule(),
- CoderError,"DEFI chunk found in MNG-VLC datastream","`%s'",
- image->filename);
+ {
+ (void) ThrowMagickException(exception,GetMagickModule(),
+ CoderError,"DEFI chunk found in MNG-VLC datastream","`%s'",
+ image->filename);
+ chunk=(unsigned char *) RelinquishMagickMemory(chunk);
+ continue;
+ }
if (length < 2)
{
chunk=(unsigned char *) RelinquishMagickMemory(chunk);
+ mng_info=MngInfoFreeStruct(mng_info);
ThrowReaderException(CorruptImageError,"CorruptImage");
}
- object_id=(p[0] << 8) | p[1];
+ object_id=((unsigned int) p[0] << 8) | (unsigned int) p[1];
if (mng_type == 2 && object_id != 0)
(void) ThrowMagickException(exception,GetMagickModule(),