From: Cristy Date: Tue, 26 Dec 2017 16:59:35 +0000 (-0500) Subject: ... X-Git-Tag: 7.0.7-17~17 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=336bb38beecd94390af872fe9c16aa7693a97ac0;p=imagemagick ... --- diff --git a/MagickCore/blob.c b/MagickCore/blob.c index e820c8b37..f6a7384e1 100644 --- a/MagickCore/blob.c +++ b/MagickCore/blob.c @@ -2710,12 +2710,19 @@ MagickExport MagickBooleanType IsBlobSeekable(const Image *image) blob_info=image->blob; switch (blob_info->type) { - case FileStream: case BlobStream: - case ZipStream: return(MagickTrue); - case UndefinedStream: case StandardStream: + case FileStream: + case ZipStream: + { + int + status; + + status=fseek(blob_info->file_info.file,0,SEEK_CUR); + return(status == -1 ? MagickFalse : MagickTrue); + } + case UndefinedStream: case BZipStream: case FifoStream: case PipeStream: @@ -3089,7 +3096,7 @@ MagickExport MagickBooleanType OpenBlob(const ImageInfo *image_info, if (strchr(type,'b') != (char *) NULL) setmode(fileno(blob_info->file_info.file),_O_BINARY); #endif - blob_info->type=StandardStream; + blob_info->type=FileStream; blob_info->exempt=MagickTrue; return(SetStreamBuffering(image_info,image)); } @@ -3105,7 +3112,7 @@ MagickExport MagickBooleanType OpenBlob(const ImageInfo *image_info, if (strchr(type,'b') != (char *) NULL) setmode(fileno(blob_info->file_info.file),_O_BINARY); #endif - blob_info->type=StandardStream; + blob_info->type=FileStream; blob_info->exempt=MagickTrue; return(SetStreamBuffering(image_info,image)); }