diff options
author | Glenn Randers-Pehrson <glennrp at users.sourceforge.net> | 2001-05-07 14:52:45 -0500 |
---|---|---|
committer | Glenn Randers-Pehrson <glennrp at users.sourceforge.net> | 2009-04-06 16:06:18 -0500 |
commit | 3097f618f28306e893ceb159a994a96eaee0d27c (patch) | |
tree | 0640cfbee9a2992ded5111c089b4402932173f55 /example.c | |
parent | 1fd5fb33c22ed68f75861ddffc2db1110105f33b (diff) |
Imported from libpng-1.2.0beta2.tar
Diffstat (limited to 'example.c')
-rw-r--r-- | example.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -338,7 +338,8 @@ void read_png(FILE *fp, unsigned int sig_read) /* file is already open */ for (row = 0; row < height; row++) { - row_pointers[row] = malloc(png_get_rowbytes(png_ptr, info_ptr)); + row_pointers[row] = png_malloc(png_ptr, png_get_rowbytes(png_ptr, + info_ptr)); } /* Now it's time to read the image. One of these methods is REQUIRED */ @@ -494,7 +495,7 @@ row_callback(png_structp png_ptr, png_bytep new_row, * png_progressive_combine_row() passing in the row and the * old row. You can call this function for NULL rows (it will * just return) and for non-interlaced images (it just does the - * memcpy for you) if it will make the code easier. Thus, you + * png_memcpy for you) if it will make the code easier. Thus, you * can just do this for all cases: */ @@ -603,7 +604,8 @@ void write_png(char *file_name /* , ... other image information ... */) PNG_INTERLACE_????, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); /* set the palette if there is one. REQUIRED for indexed-color images */ - palette = (png_colorp)png_malloc(png_ptr, PNG_MAX_PALETTE_LENGTH * sizeof (png_color)); + palette = (png_colorp)png_malloc(png_ptr, PNG_MAX_PALETTE_LENGTH + * sizeof (png_color)); /* ... set palette colors ... */ png_set_PLTE(png_ptr, info_ptr, palette, PNG_MAX_PALETTE_LENGTH); /* You must not free palette here, because png_set_PLTE only makes a link to |