diff options
author | Glenn Randers-Pehrson <glennrp at users.sourceforge.net> | 2001-05-06 05:34:26 -0500 |
---|---|---|
committer | Glenn Randers-Pehrson <glennrp at users.sourceforge.net> | 2009-04-06 16:06:16 -0500 |
commit | 1fd5fb33c22ed68f75861ddffc2db1110105f33b (patch) | |
tree | 9643ef4375e583c5f897f8073a756bb679fde0ef /example.c | |
parent | e68f5a361bf09f8b92ce1c77f6b083018512565a (diff) |
Imported from libpng-1.2.0beta1.tar
Diffstat (limited to 'example.c')
-rw-r--r-- | example.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -338,8 +338,7 @@ void read_png(FILE *fp, unsigned int sig_read) /* file is already open */ for (row = 0; row < height; row++) { - row_pointers[row] = png_malloc(png_ptr, png_get_rowbytes(png_ptr, - info_ptr)); + row_pointers[row] = malloc(png_get_rowbytes(png_ptr, info_ptr)); } /* Now it's time to read the image. One of these methods is REQUIRED */ @@ -495,7 +494,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 - * png_memcpy for you) if it will make the code easier. Thus, you + * memcpy for you) if it will make the code easier. Thus, you * can just do this for all cases: */ @@ -604,8 +603,7 @@ 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 |