Diff of /png.c [84521e] .. [839d2e] Maximize Restore

  Switch to unified view

a/png.c b/png.c
...
...
118
    char filename[256];
118
    char filename[256];
119
    png_structp png_ptr;
119
    png_structp png_ptr;
120
    png_infop info_ptr;
120
    png_infop info_ptr;
121
    png_bytep *row_pointers;
121
    png_bytep *row_pointers;
122
    int row;
122
    int row;
123
  unsigned long  dataSize;
124
    int color_type;
123
    int color_type;
125
124
126
#ifdef __Mac__
125
#ifdef __Mac__
127
    unsigned char the_pcUnixFilePath[256];//added by Kekus Digital
126
    unsigned char the_pcUnixFilePath[256];//added by Kekus Digital
128
    Str255 the_cString;
127
    Str255 the_cString;
...
...
207
    im->height      = png_get_image_height(png_ptr, info_ptr);
206
    im->height      = png_get_image_height(png_ptr, info_ptr);
208
    im->bytesPerLine    = png_get_rowbytes(png_ptr, info_ptr);
207
    im->bytesPerLine    = png_get_rowbytes(png_ptr, info_ptr);
209
    im->dataSize        = im->height * im->bytesPerLine;
208
    im->dataSize        = im->height * im->bytesPerLine;
210
    im->bitsPerPixel    = 8 * im->bytesPerLine / im->width;
209
    im->bitsPerPixel    = 8 * im->bytesPerLine / im->width;
211
210
212
  im->data = (unsigned char**)mymalloc( (dataSize > im->dataSize ? dataSize : im->dataSize) );
211
  im->data = (unsigned char**)mymalloc( im->dataSize );
213
    if( im->data == NULL ){
212
    if( im->data == NULL ){
214
        PrintError("Not enough memory");
213
        PrintError("Not enough memory");
215
            png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
214
            png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
216
        fclose( infile );
215
        fclose( infile );
217
        return -1;
216
        return -1;