202
202
ept_info.tiff_length=ReadBlobLSBLong(image);
203
203
(void) ReadBlobLSBShort(image);
204
204
ept_info.postscript=(unsigned char *) AcquireQuantumMemory(
205
ept_info.postscript_length,sizeof(*ept_info.postscript));
205
ept_info.postscript_length+1,sizeof(*ept_info.postscript));
206
206
if (ept_info.postscript == (unsigned char *) NULL)
207
207
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
208
ept_info.tiff=(unsigned char *) AcquireQuantumMemory(ept_info.tiff_length,
208
(void) ResetMagickMemory(ept_info.postscript,0,(ept_info.postscript_length+1)*
209
sizeof(*ept_info.postscript));
210
ept_info.tiff=(unsigned char *) AcquireQuantumMemory(ept_info.tiff_length+1,
209
211
sizeof(*ept_info.tiff));
210
if ((ept_info.tiff_length != 0) && (ept_info.tiff == (unsigned char *) NULL))
212
if (ept_info.tiff == (unsigned char *) NULL)
211
213
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
214
(void) ResetMagickMemory(ept_info.tiff,0,(ept_info.tiff_length+1)*
215
sizeof(*ept_info.tiff));
212
216
offset=SeekBlob(image,ept_info.tiff_offset,SEEK_SET);
214
218
ThrowReaderException(CorruptImageError,"ImproperImageHeader");
215
219
count=ReadBlob(image,ept_info.tiff_length,ept_info.tiff);
216
220
if (count != (ssize_t) (ept_info.tiff_length))
217
ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
221
(void) ThrowMagickException(exception,GetMagickModule(),CorruptImageWarning,
222
"InsufficientImageDataInFile","`%s'",image->filename);
218
223
offset=SeekBlob(image,ept_info.postscript_offset,SEEK_SET);
220
225
ThrowReaderException(CorruptImageError,"ImproperImageHeader");
221
226
count=ReadBlob(image,ept_info.postscript_length,ept_info.postscript);
222
227
if (count != (ssize_t) (ept_info.postscript_length))
223
ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
228
(void) ThrowMagickException(exception,GetMagickModule(),CorruptImageWarning,
229
"InsufficientImageDataInFile","`%s'",image->filename);
224
230
(void) CloseBlob(image);
225
231
image=DestroyImage(image);
226
232
read_info=CloneImageInfo(image_info);