~ubuntu-branches/ubuntu/oneiric/imagemagick/oneiric-updates

« back to all changes in this revision

Viewing changes to coders/ept.c

  • Committer: Bazaar Package Importer
  • Author(s): Nelson A. de Oliveira
  • Date: 2010-06-20 19:59:55 UTC
  • mfrom: (6.2.8 sid)
  • Revision ID: james.westby@ubuntu.com-20100620195955-n3eq0yenhycw888i
Tags: 7:6.6.2.6-1
* New upstream release;
* Change Recommends on ufraw to ufraw-batch (Closes: #579775);
* Fix FTBFS when using dash to run the configure script, by setting
  CONFIG_SHELL=/bin/bash (Closes: #582073, #583024). Thank you, Niko Tyni!

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
%                                 July 1992                                   %
18
18
%                                                                             %
19
19
%                                                                             %
20
 
%  Copyright 1999-2009 ImageMagick Studio LLC, a non-profit organization      %
 
20
%  Copyright 1999-2010 ImageMagick Studio LLC, a non-profit organization      %
21
21
%  dedicated to making software imaging solutions freely available.           %
22
22
%                                                                             %
23
23
%  You may not use this file except in compliance with the License.  You may  %
71
71
*/
72
72
typedef struct _EPTInfo
73
73
{
74
 
  unsigned long
 
74
  size_t
75
75
    magick;
76
76
 
77
77
  MagickOffsetType
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);
213
217
  if (offset < 0)
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);
219
224
  if (offset < 0)
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);
261
267
%
262
268
%  The format of the RegisterEPTImage method is:
263
269
%
264
 
%      unsigned long RegisterEPTImage(void)
 
270
%      size_t RegisterEPTImage(void)
265
271
%
266
272
*/
267
 
ModuleExport unsigned long RegisterEPTImage(void)
 
273
ModuleExport size_t RegisterEPTImage(void)
268
274
{
269
275
  MagickInfo
270
276
    *entry;