]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Mon, 26 May 2014 01:25:55 +0000 (01:25 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Mon, 26 May 2014 01:25:55 +0000 (01:25 +0000)
MagickCore/blob.c

index 678c5cfa4834c1470f6709db9cfa0a4bf0d338df..59e4cf1757395c20948b05f095ab6bf5b2a57420 100644 (file)
@@ -3775,10 +3775,13 @@ MagickPrivate MagickBooleanType SetBlobExtent(Image *image,
       if (image->blob->synchronize != MagickFalse)
         {
           int
+            file,
             status;
 
-          status=posix_fallocate(fileno(image->blob->file_info.file),offset,
-            extent-offset);
+          file=fileno(image->blob->file_info.file);
+          if ((file == -1) || (offset < 0))
+            return(MagickFalse);
+          status=posix_fallocate(file,offset,extent-offset);
           if (status != 0)
             return(MagickFalse);
         }