extent,
quantum;
+ BlobMode
+ mode;
+
MagickBooleanType
mapped,
eof;
blob_info->size=GetBlobSize(image);
image->extent=blob_info->size;
blob_info->eof=MagickFalse;
+ blob_info->mode=UndefinedBlobMode;
if (blob_info->exempt != MagickFalse)
{
blob_info->type=UndefinedStream;
return(MagickTrue);
}
(void) DetachBlob(blob_info);
+ blob_info->mode=mode;
switch (mode)
{
default: type="r"; break;
break;
}
}
- if (blob_info->offset < (MagickOffsetType) ((off_t) blob_info->length))
+ if (blob_info->offset <= (MagickOffsetType) ((off_t) blob_info->length))
{
blob_info->eof=MagickFalse;
break;
}
- if (blob_info->offset < (MagickOffsetType) ((off_t) blob_info->extent))
- break;
- return(-1);
+ if ((image->blob->mapped == MagickFalse) &&
+ ((image->blob->mode == WriteBlobMode) ||
+ (image->blob->mode == WriteBinaryBlobMode)))
+ {
+ image->blob->extent=(size_t) (image->blob->offset+
+ image->blob->quantum);
+ image->blob->quantum<<=1;
+ image->blob->data=(unsigned char *) ResizeQuantumMemory(
+ image->blob->data,image->blob->extent+1,sizeof(*image->blob->data));
+ (void) SyncBlob(image);
+ if (image->blob->data == (unsigned char *) NULL)
+ {
+ (void) DetachBlob(image->blob);
+ return(-1);
+ }
+ }
+ if (blob_info->offset > (MagickOffsetType) ((off_t) blob_info->extent))
+ return(-1);
+ break;
}
case CustomStream:
{