mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng17] Imported from libpng-1.7.0beta36.tar
This commit is contained in:
@@ -16,6 +16,9 @@ directory it is very unlikely that it will be tested before a minor release!
|
||||
You can use these .dfa files as the basis of new configurations. Files in this
|
||||
directory should not have any use restrictions or restrictive licenses.
|
||||
|
||||
This directory is not included in the .zip and .7z distributions, which do
|
||||
not contain 'configure' scripts.
|
||||
|
||||
DOCUMENTATION
|
||||
=============
|
||||
|
||||
|
||||
@@ -448,6 +448,8 @@ static void readpng2_end_callback(png_structp png_ptr, png_infop info_ptr)
|
||||
|
||||
/* all done */
|
||||
|
||||
(void)info_ptr; /* Unused */
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -472,6 +474,7 @@ static void readpng2_warning_handler(png_structp png_ptr, png_const_charp msg)
|
||||
{
|
||||
fprintf(stderr, "readpng2 libpng warning: %s\n", msg);
|
||||
fflush(stderr);
|
||||
(void)png_ptr; /* Unused */
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -163,8 +163,12 @@ uch *readpng_get_image(double display_exponent, int *pChannels, ulg *pRowbytes)
|
||||
|
||||
/* now we can go ahead and just read the whole image */
|
||||
|
||||
fread(image_data, 1L, rowbytes*height, saved_infile);
|
||||
|
||||
if (fread(image_data, 1L, rowbytes*height, saved_infile) <
|
||||
rowbytes*height) {
|
||||
free (image_data);
|
||||
image_data = NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return image_data;
|
||||
}
|
||||
|
||||
@@ -30,10 +30,6 @@
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FEENABLEEXCEPT /* from config.h, if included */
|
||||
# include <fenv.h>
|
||||
#endif
|
||||
|
||||
/* Define the following to use this test against your installed libpng, rather
|
||||
* than the one being built here:
|
||||
*/
|
||||
@@ -43,6 +39,13 @@
|
||||
# include "../../png.h"
|
||||
#endif
|
||||
|
||||
#ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED
|
||||
# ifdef HAVE_FEENABLEEXCEPT /* from config.h, if included */
|
||||
# include <fenv.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef PNG_ZLIB_HEADER
|
||||
# include PNG_ZLIB_HEADER
|
||||
#else
|
||||
@@ -9962,9 +9965,11 @@ static void signal_handler(int signum)
|
||||
pos = safecat(msg, sizeof msg, pos, "abort");
|
||||
break;
|
||||
|
||||
#ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED
|
||||
case SIGFPE:
|
||||
pos = safecat(msg, sizeof msg, pos, "floating point exception");
|
||||
break;
|
||||
#endif
|
||||
|
||||
case SIGILL:
|
||||
pos = safecat(msg, sizeof msg, pos, "illegal instruction");
|
||||
@@ -10030,18 +10035,21 @@ int main(int argc, char **argv)
|
||||
|
||||
/* Add appropriate signal handlers, just the ANSI specified ones: */
|
||||
signal(SIGABRT, signal_handler);
|
||||
signal(SIGFPE, signal_handler);
|
||||
signal(SIGILL, signal_handler);
|
||||
signal(SIGINT, signal_handler);
|
||||
signal(SIGSEGV, signal_handler);
|
||||
signal(SIGTERM, signal_handler);
|
||||
|
||||
#ifdef HAVE_FEENABLEEXCEPT
|
||||
#ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED
|
||||
signal(SIGFPE, signal_handler);
|
||||
|
||||
# ifdef HAVE_FEENABLEEXCEPT
|
||||
/* Only required to enable FP exceptions on platforms where they start off
|
||||
* disabled; this is not necessary but if it is not done pngvalid will likely
|
||||
* end up ignoring FP conditions that other platforms fault.
|
||||
*/
|
||||
feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
modifier_init(&pm);
|
||||
|
||||
Reference in New Issue
Block a user