]> granicus.if.org Git - imagemagick/blobdiff - MagickCore/mime.c
(no commit message)
[imagemagick] / MagickCore / mime.c
index 0377803f4d8634d0369c667db08a2f428fe7ba27..a441bcd6758f3adc757fc5f5385319a8c497f5db 100644 (file)
@@ -382,11 +382,11 @@ MagickExport const MimeInfo *GetMimeInfo(const char *filename,
     }
     p=(const MimeInfo *) GetNextValueInLinkedList(mime_cache);
   }
-  if (p != (const MimeInfo *) NULL)
+  if (mime_info != (const MimeInfo *) NULL)
     (void) InsertValueInLinkedList(mime_cache,0,
       RemoveElementByValueFromLinkedList(mime_cache,p));
   UnlockSemaphoreInfo(mime_semaphore);
-  return(p);
+  return(mime_info);
 }
 \f
 /*
@@ -764,14 +764,14 @@ MagickExport MagickBooleanType ListMimeInfo(FILE *file,ExceptionInfo *exception)
 %                                                                             %
 %                                                                             %
 %                                                                             %
-+   L o a d M i m e L i s t                                                   %
++   L o a d M i m e C a c h e                                                 %
 %                                                                             %
 %                                                                             %
 %                                                                             %
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %
-%  LoadMimeCache() loads the magic configurations which provides a mapping
-%  between magic attributes and a magic name.
+%  LoadMimeCache() loads the mime configurations which provides a mapping
+%  between mime attributes and a mime name.
 %
 %  The format of the LoadMimeCache method is:
 %
@@ -959,7 +959,8 @@ static MagickBooleanType LoadMimeCache(LinkedListInfo *mime_cache,
     if (attribute != (const char *) NULL)
       mime_info->priority=(ssize_t) strtol(attribute,(char **) NULL,0);
     attribute=GetXMLTreeAttribute(mime,"stealth");
-    mime_info->stealth=IsStringTrue(attribute);
+    if (attribute != (const char *) NULL)
+      mime_info->stealth=IsStringTrue(attribute);
     attribute=GetXMLTreeAttribute(mime,"type");
     if (attribute != (const char *) NULL)
       mime_info->type=ConstantString(attribute);