]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Sat, 2 May 2015 21:12:52 +0000 (21:12 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Sat, 2 May 2015 21:12:52 +0000 (21:12 +0000)
MagickCore/blob.c

index 8b9e6d3666d3ad026cd5bb8502b8c8a04c1b936b..c2a1b90287c0e746e81d574d710764cf920b9822 100644 (file)
@@ -125,6 +125,7 @@ struct _BlobInfo
 
   MagickBooleanType
     exempt,
+    immutable,
     synchronize,
     status,
     temporary;
@@ -453,6 +454,7 @@ MagickExport BlobInfo *CloneBlobInfo(const BlobInfo *blob_info)
   clone_info->offset=blob_info->offset;
   clone_info->size=blob_info->size;
   clone_info->exempt=blob_info->exempt;
+  clone_info->immutable=blob_info->immutable;
   clone_info->status=blob_info->status;
   clone_info->temporary=blob_info->temporary;
   clone_info->type=blob_info->type;
@@ -692,6 +694,7 @@ MagickExport void *DetachBlob(BlobInfo *blob_info)
   blob_info->offset=0;
   blob_info->eof=MagickFalse;
   blob_info->exempt=MagickFalse;
+  blob_info->immutable=MagickFalse;
   blob_info->type=UndefinedStream;
   blob_info->file_info.file=(FILE *) NULL;
   data=blob_info->data;
@@ -2407,6 +2410,7 @@ MagickExport MagickBooleanType OpenBlob(const ImageInfo *image_info,
     {
       if (image_info->stream != (StreamHandler) NULL)
         image->blob->stream=(StreamHandler) image_info->stream;
+      image->immutable=MagickTrue;
       AttachBlob(image->blob,image_info->blob,image_info->length);
       return(MagickTrue);
     }
@@ -3767,7 +3771,8 @@ MagickExport MagickOffsetType SeekBlob(Image *image,
           image->blob->eof=MagickFalse;
           break;
         }
-      if (image->blob->mapped != MagickFalse)
+      if ((image->blob->mapped != MagickFalse) &&
+          (image->blob->immutable != MagickFalse))
         {
           image->blob->eof=MagickTrue;
           return(-1);