~ubuntu-branches/ubuntu/gutsy/imagemagick/gutsy

« back to all changes in this revision

Viewing changes to coders/xcf.c

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2007-10-02 14:15:13 UTC
  • Revision ID: james.westby@ubuntu.com-20071002141513-9b4x384fhd4rb8qo
Tags: 7:6.2.4.5.dfsg1-2ubuntu1
* Merge with Debian unstable for CVE fixes.  Remaining changes:
  - Magick++/lib/Geometry.cpp: build fix for g++-4.3.
  - debian/control: Ubuntu maintainer address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
305
305
  XCFPixelPacket *xcfdata, *xcfodata;
306
306
  unsigned char  *graydata;
307
307
 
308
 
  xcfdata = xcfodata = (XCFPixelPacket *) AcquireMagickMemory(data_length);
 
308
  xcfdata = xcfodata = (XCFPixelPacket *) AcquireQuantumMemory(data_length,
 
309
    sizeof(*xcfdata));
309
310
  graydata = (unsigned char *)xcfdata;  /* used by gray and indexed */
310
311
  nmemb_read_successfully = ReadBlob(image, data_length, (unsigned char *) xcfdata);
311
312
 
352
353
 
353
354
  bpp = (int) inDocInfo->bpp;
354
355
 
355
 
  xcfdata = xcfodata = (unsigned char *)
356
 
    AcquireMagickMemory((size_t) data_length);
 
356
  xcfdata = xcfodata = (unsigned char *) AcquireQuantumMemory((size_t)
 
357
    data_length,sizeof(*xcfdata));
357
358
 
358
359
  nmemb_read_successfully = ReadBlob(image, (size_t) data_length, xcfdata);
359
360
 
899
900
  ssize_t
900
901
    count;
901
902
 
 
903
  size_t
 
904
    length;
 
905
 
902
906
  XCFDocInfo
903
907
    doc_info;
904
908
 
944
948
    else
945
949
      if ( image_type == GIMP_INDEXED )
946
950
        ThrowReaderException(CoderError,"ColormapTypeNotSupported");
 
951
  if (SetImageExtent(image,0,0) == MagickFalse)
 
952
    {
 
953
      InheritException(exception,&image->exception);
 
954
      return(DestroyImageList(image));
 
955
    }
947
956
  SetImageBackgroundColor(image);
948
957
  /*
949
958
    Read properties.
1149
1158
 
1150
1159
 
1151
1160
    /* allocate our array of layer info blocks */
1152
 
    layer_info=(XCFLayerInfo *)
1153
 
      AcquireMagickMemory(number_layers*sizeof(XCFLayerInfo));
 
1161
    length=(size_t) number_layers;
 
1162
    layer_info=(XCFLayerInfo *) AcquireQuantumMemory(length,
 
1163
      sizeof(*layer_info));
1154
1164
    if (layer_info == (XCFLayerInfo *) NULL)
1155
1165
      ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
1156
1166
    (void) ResetMagickMemory(layer_info,0,number_layers*sizeof(XCFLayerInfo));