]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Tue, 10 Aug 2010 21:37:49 +0000 (21:37 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Tue, 10 Aug 2010 21:37:49 +0000 (21:37 +0000)
coders/miff.c
magick/cache.c

index 53e74d9a093e4aa9c63f4ee42161e4a682f1c9e0..561f7c02863e2fc0d2288263339477a8b6176f87 100644 (file)
@@ -542,7 +542,7 @@ static Image *ReadMIFFImage(const ImageInfo *image_info,
             } while (c != EOF);
             *p='\0';
             p=options;
-            while (isspace((int) ((unsigned char) c)) != 0)
+            while ((isspace((int) ((unsigned char) c)) != 0) && (c != EOF))
               c=ReadBlobByte(image);
             if (c == (int) '=')
               {
index 64e360b43dab25c519d91218669114789bb1ca2e..0af1ded3d4a7b79e44b1062dd859f1cd2af5098c 100644 (file)
@@ -201,8 +201,8 @@ MagickExport Cache AcquirePixelCache(const size_t number_threads)
   if (cache_info->nexus_info == (NexusInfo **) NULL)
     ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
   GetPixelCacheMethods(&cache_info->methods);
-  cache_info->reference_count=1;
   cache_info->semaphore=AllocateSemaphoreInfo();
+  cache_info->reference_count=1;
   cache_info->disk_semaphore=AllocateSemaphoreInfo();
   cache_info->debug=IsEventLogging();
   cache_info->signature=MagickSignature;
@@ -2215,6 +2215,8 @@ MagickExport Cache GetImagePixelCache(Image *image,
             Clone pixel cache.
           */
           clone_image=(*image);
+          clone_image.semaphore=AllocateSemaphoreInfo();
+          clone_image.reference_count=1;
           clone_image.cache=ClonePixelCache(cache_info);
           clone_info=(CacheInfo *) clone_image.cache;
           status=ClonePixelCacheNexus(cache_info,clone_info,exception);
@@ -2233,6 +2235,7 @@ MagickExport Cache GetImagePixelCache(Image *image,
                     }
                 }
             }
+          DestroySemaphoreInfo(&clone_image.semaphore);
         }
       UnlockSemaphoreInfo(cache_info->semaphore);
     }