*/
typedef struct _EPTInfo
{
- unsigned long
+ size_t
magick;
MagickOffsetType
ept_info.tiff_length=ReadBlobLSBLong(image);
(void) ReadBlobLSBShort(image);
ept_info.postscript=(unsigned char *) AcquireQuantumMemory(
- ept_info.postscript_length,sizeof(*ept_info.postscript));
+ ept_info.postscript_length+1,sizeof(*ept_info.postscript));
if (ept_info.postscript == (unsigned char *) NULL)
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
- ept_info.tiff=(unsigned char *) AcquireQuantumMemory(ept_info.tiff_length,
+ (void) ResetMagickMemory(ept_info.postscript,0,(ept_info.postscript_length+1)*
+ sizeof(*ept_info.postscript));
+ ept_info.tiff=(unsigned char *) AcquireQuantumMemory(ept_info.tiff_length+1,
sizeof(*ept_info.tiff));
- if ((ept_info.tiff_length != 0) && (ept_info.tiff == (unsigned char *) NULL))
+ if (ept_info.tiff == (unsigned char *) NULL)
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
+ (void) ResetMagickMemory(ept_info.tiff,0,(ept_info.tiff_length+1)*
+ sizeof(*ept_info.tiff));
offset=SeekBlob(image,ept_info.tiff_offset,SEEK_SET);
if (offset < 0)
ThrowReaderException(CorruptImageError,"ImproperImageHeader");
count=ReadBlob(image,ept_info.tiff_length,ept_info.tiff);
if (count != (ssize_t) (ept_info.tiff_length))
- ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
+ (void) ThrowMagickException(exception,GetMagickModule(),CorruptImageWarning,
+ "InsufficientImageDataInFile","`%s'",image->filename);
offset=SeekBlob(image,ept_info.postscript_offset,SEEK_SET);
if (offset < 0)
ThrowReaderException(CorruptImageError,"ImproperImageHeader");
count=ReadBlob(image,ept_info.postscript_length,ept_info.postscript);
if (count != (ssize_t) (ept_info.postscript_length))
- ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile");
+ (void) ThrowMagickException(exception,GetMagickModule(),CorruptImageWarning,
+ "InsufficientImageDataInFile","`%s'",image->filename);
(void) CloseBlob(image);
image=DestroyImage(image);
read_info=CloneImageInfo(image_info);
%
% The format of the RegisterEPTImage method is:
%
-% unsigned long RegisterEPTImage(void)
+% size_t RegisterEPTImage(void)
%
*/
-ModuleExport unsigned long RegisterEPTImage(void)
+ModuleExport size_t RegisterEPTImage(void)
{
MagickInfo
*entry;