Imported from pngcrush-1.5.7.tar

This commit is contained in:
Glenn Randers-Pehrson
2001-10-08 20:32:33 -05:00
parent 36e234ac16
commit f671d863fe
24 changed files with 885 additions and 459 deletions

View File

@@ -1,7 +1,7 @@
/* pngread.c - read a PNG file
*
* libpng 1.0.12 - June 8, 2001
* libpng 1.2.0 - September 1, 2001
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2001 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@@ -54,6 +54,10 @@ png_create_read_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
return (png_structp)NULL;
}
#ifdef PNG_ASSEMBLER_CODE_SUPPORTED
png_init_mmx_flags(png_ptr); /* 1.2.0 addition */
#endif
#ifdef PNG_SETJMP_SUPPORTED
#ifdef USE_FAR_KEYWORD
if (setjmp(jmpbuf))
@@ -113,35 +117,6 @@ png_create_read_struct_2(png_const_charp user_png_ver, png_voidp error_ptr,
png_error(png_ptr,
"Incompatible libpng version in application and library");
}
/* Libpng 1.0.6 was not binary compatible, due to insertion of the
info_ptr->free_me member. Libpng-1.0.1 and earlier were not
compatible due to insertion of the user transform function. Note
to maintainer: this test can be removed from version 1.2.0 and
beyond because the previous test would have already rejected it. */
if (user_png_ver[0] == '1' && user_png_ver[2] == '0' &&
(user_png_ver[4] < '2' || user_png_ver[4] == '6') &&
user_png_ver[5] == '\0')
{
#if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE)
char msg[80];
if (user_png_ver)
{
sprintf(msg, "Application was compiled with png.h from libpng-%.20s",
user_png_ver);
png_warning(png_ptr, msg);
}
sprintf(msg, "Application is running with png.c from libpng-%.20s",
png_libpng_ver);
png_warning(png_ptr, msg);
#endif
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
png_ptr->flags=0;
#endif
png_error(png_ptr,
"Application must be recompiled; versions <= 1.0.6 were incompatible");
}
}
/* initialize zbuf - compression buffer */
@@ -794,7 +769,7 @@ png_read_row(png_structp png_ptr, png_bytep row, png_bytep dsp_row)
* not called png_set_interlace_handling(), the display_row buffer will
* be ignored, so pass NULL to it.
*
* [*] png_handle_alpha() does not exist yet, as of libpng version 1.0.12
* [*] png_handle_alpha() does not exist yet, as of libpng version 1.2.0
*/
void PNGAPI
@@ -843,7 +818,7 @@ png_read_rows(png_structp png_ptr, png_bytepp row,
* only call this function once. If you desire to have an image for
* each pass of a interlaced image, use png_read_rows() instead.
*
* [*] png_handle_alpha() does not exist yet, as of libpng version 1.0.12
* [*] png_handle_alpha() does not exist yet, as of libpng version 1.2.0
*/
void PNGAPI
png_read_image(png_structp png_ptr, png_bytepp image)
@@ -1158,7 +1133,7 @@ png_read_destroy(png_structp png_ptr, png_infop info_ptr, png_infop end_info_ptr
png_info_destroy(png_ptr, end_info_ptr);
png_free(png_ptr, png_ptr->zbuf);
png_free(png_ptr, png_ptr->row_buf);
png_free(png_ptr, png_ptr->big_row_buf);
png_free(png_ptr, png_ptr->prev_row);
#if defined(PNG_READ_DITHER_SUPPORTED)
png_free(png_ptr, png_ptr->palette_lookup);