]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Thu, 25 Apr 2013 19:41:22 +0000 (19:41 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Thu, 25 Apr 2013 19:41:22 +0000 (19:41 +0000)
MagickCore/blob.c

index 70577427fc9581f36362cfd82fe5157bdf892950..8e973ba4592efdaf4c1b7367b7406d8e4d95cb8f 100644 (file)
@@ -2783,7 +2783,21 @@ MagickExport ssize_t ReadBlob(Image *image,const size_t length,
       break;
     case StandardStream:
     {
-      count=read(fileno(image->blob->file_info.file),q,length);
+      register ssize_t
+        i;
+
+      for (i=0; i < (ssize_t) length; i+=count)
+      {
+        count=read(fileno(image->blob->file_info.file),q+i,(size_t) 
+          MagickMin(length-i,(MagickSizeType) SSIZE_MAX));
+        if (count <= 0)
+          {
+            count=0;
+            if (errno != EINTR)
+              break;
+          }
+      }
+      count=i;
       break;
     }
     case FileStream: