% o exception: return any errors or warnings in this structure.
%
*/
+
+static void *DestroyGIFProfile(void *profile)
+{
+ return((void *) DestroyStringInfo((StringInfo *) profile));
+}
+
static MagickBooleanType PingGIFImage(Image *image,ExceptionInfo *exception)
{
unsigned char
*image,
*meta_image;
- int
- number_extensionss=0;
+ LinkedListInfo
+ *profiles;
MagickBooleanType
status;
ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
}
}
+ profiles=(LinkedListInfo *) NULL;
duration=0;
opacity=(-1);
image_count=0;
count=ReadBlob(image,1,&c);
if (count != 1)
{
+ if (profiles != (LinkedListInfo *) NULL)
+ profiles=DestroyLinkedList(profiles,DestroyGIFProfile);
global_colormap=(unsigned char *) RelinquishMagickMemory(
global_colormap);
meta_image=DestroyImage(meta_image);
MagickTrue : MagickFalse;
iptc=LocaleNCompare((char *) buffer,"MGKIPTC0000",11) == 0 ?
MagickTrue : MagickFalse;
- number_extensionss++;
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" Reading GIF application extension");
info=(unsigned char *) AcquireQuantumMemory(255UL,
sizeof(*info));
if (info == (unsigned char *) NULL)
{
+ if (profiles != (LinkedListInfo *) NULL)
+ profiles=DestroyLinkedList(profiles,DestroyGIFProfile);
meta_image=DestroyImage(meta_image);
global_colormap=(unsigned char *) RelinquishMagickMemory(
global_colormap);
profile=BlobToStringInfo(info,(size_t) info_length);
if (profile == (StringInfo *) NULL)
{
+ if (profiles != (LinkedListInfo *) NULL)
+ profiles=DestroyLinkedList(profiles,DestroyGIFProfile);
meta_image=DestroyImage(meta_image);
global_colormap=(unsigned char *) RelinquishMagickMemory(
global_colormap);
else
(void) FormatLocaleString(name,sizeof(name),"gif:%.11s",
buffer);
- info=(unsigned char *) RelinquishMagickMemory(info);
- if (magick == MagickFalse)
- (void) SetImageProfile(meta_image,name,profile,exception);
- profile=DestroyStringInfo(profile);
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" profile name=%s",name);
+ info=(unsigned char *) RelinquishMagickMemory(info);
+ if (magick != MagickFalse)
+ profile=DestroyStringInfo(profile);
+ else
+ {
+ if (profiles == (LinkedListInfo *) NULL)
+ profiles=NewLinkedList(0);
+ SetStringInfoName(profile,name);
+ (void) AppendValueToLinkedList(profiles,profile);
+ }
}
break;
}
{
if ((MagickSizeType) image_count == max_image_count)
{
+ if (profiles != (LinkedListInfo *) NULL)
+ profiles=DestroyLinkedList(profiles,DestroyGIFProfile);
image=DestroyImageList(image);
global_colormap=(unsigned char *) RelinquishMagickMemory(
global_colormap);
AcquireNextImage(image_info,image,exception);
if (GetNextImageInList(image) == (Image *) NULL)
{
+ if (profiles != (LinkedListInfo *) NULL)
+ profiles=DestroyLinkedList(profiles,DestroyGIFProfile);
image=DestroyImageList(image);
global_colormap=(unsigned char *) RelinquishMagickMemory(
global_colormap);
meta_image->scene=image->scene;
(void) CloneImageProperties(image,meta_image);
DestroyImageProperties(meta_image);
- (void) CloneImageProfiles(image,meta_image);
- DestroyImageProfiles(meta_image);
+ if (profiles != (LinkedListInfo *) NULL)
+ {
+ StringInfo
+ *profile;
+
+ /*
+ Set image profiles.
+ */
+ ResetLinkedListIterator(profiles);
+ profile=(StringInfo *) GetNextValueInLinkedList(profiles);
+ while (profile != (StringInfo *) NULL)
+ {
+ (void) SetImageProfile(image,GetStringInfoName(profile),profile,
+ exception);
+ profile=(StringInfo *) GetNextValueInLinkedList(profiles);
+ }
+ }
+ if (profiles != (LinkedListInfo *) NULL)
+ profiles=DestroyLinkedList(profiles,DestroyGIFProfile);
image->storage_class=PseudoClass;
image->compression=LZWCompression;
image->columns=ReadBlobLSBShort(image);
image->alpha_trait=opacity >= 0 ? BlendPixelTrait : UndefinedPixelTrait;
if ((image->columns == 0) || (image->rows == 0))
{
+ if (profiles != (LinkedListInfo *) NULL)
+ profiles=DestroyLinkedList(profiles,DestroyGIFProfile);
global_colormap=(unsigned char *) RelinquishMagickMemory(
global_colormap);
meta_image=DestroyImage(meta_image);
*/
if (AcquireImageColormap(image,image->colors,exception) == MagickFalse)
{
+ if (profiles != (LinkedListInfo *) NULL)
+ profiles=DestroyLinkedList(profiles,DestroyGIFProfile);
global_colormap=(unsigned char *) RelinquishMagickMemory(
global_colormap);
meta_image=DestroyImage(meta_image);
MagickMax(local_colors,256),3UL*sizeof(*colormap));
if (colormap == (unsigned char *) NULL)
{
+ if (profiles != (LinkedListInfo *) NULL)
+ profiles=DestroyLinkedList(profiles,DestroyGIFProfile);
global_colormap=(unsigned char *) RelinquishMagickMemory(
global_colormap);
meta_image=DestroyImage(meta_image);
count=ReadBlob(image,(3*local_colors)*sizeof(*colormap),colormap);
if (count != (ssize_t) (3*local_colors))
{
+ if (profiles != (LinkedListInfo *) NULL)
+ profiles=DestroyLinkedList(profiles,DestroyGIFProfile);
global_colormap=(unsigned char *) RelinquishMagickMemory(
global_colormap);
colormap=(unsigned char *) RelinquishMagickMemory(colormap);
status=SetImageExtent(image,image->columns,image->rows,exception);
if (status == MagickFalse)
{
+ if (profiles != (LinkedListInfo *) NULL)
+ profiles=DestroyLinkedList(profiles,DestroyGIFProfile);
global_colormap=(unsigned char *) RelinquishMagickMemory(
global_colormap);
meta_image=DestroyImage(meta_image);
status=DecodeImage(image,opacity,exception);
if ((image_info->ping == MagickFalse) && (status == MagickFalse))
{
+ if (profiles != (LinkedListInfo *) NULL)
+ profiles=DestroyLinkedList(profiles,DestroyGIFProfile);
global_colormap=(unsigned char *) RelinquishMagickMemory(
global_colormap);
meta_image=DestroyImage(meta_image);
break;
}
image->duration=duration;
+ if (profiles != (LinkedListInfo *) NULL)
+ profiles=DestroyLinkedList(profiles,DestroyGIFProfile);
meta_image=DestroyImage(meta_image);
global_colormap=(unsigned char *) RelinquishMagickMemory(global_colormap);
if ((image->columns == 0) || (image->rows == 0))