bug 478901 update to libpng 1.2.35, patch by Glenn Randers-Pehrson, r=Joe Drew, sr=dveditz, blocking=vlad

This commit is contained in:
Daniel Veditz 2009-03-01 01:15:25 -08:00
Родитель 5e672443a4
Коммит f1ccf9201e
15 изменённых файлов: 103 добавлений и 57 удалений

Просмотреть файл

@ -2186,7 +2186,7 @@ version 1.2.30beta03 [July 6, 2008]
version 1.2.30beta04 [July 10, 2008]
Merged more cosmetic whitespace changes from libpng-1.4.0beta19.
version 1.0.38rc01, 1.2.30rc01 [December 18, 2008]
version 1.0.38rc01, 1.2.30rc01 [July 18, 2008]
No changes.
version 1.0.38rc02, 1.2.30rc02 [July 21, 2008]
@ -2309,6 +2309,25 @@ version 1.0.42rc01, 1.2.34rc01 [December 11, 2008]
version 1.0.42, 1.2.34 [December 18, 2008]
No changes.
version 1.2.35beta01 [February 4, 2009]
Zero out some arrays of pointers after png_malloc(). (Tavis Ormandy)
version 1.2.35beta02 [Feburary 4, 2009]
Zero out more arrays of pointers after png_malloc().
version 1.2.35beta03 [February 5, 2009]
Use png_memset() instead of a loop to intialize pointers. We realize
this will not work on platforms where the NULL pointer is not all zeroes.
version 1.2.35rc01 [February 11, 2009]
No changes.
version 1.2.35rc02 [February 12, 2009]
Fix typo in new png_memset call in pngset.c (png_color should be png_charp)
version 1.0.43 and 1.2.35 [February 14, 2009]
No changes.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement

Просмотреть файл

@ -8,7 +8,7 @@ COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
If you modify libpng you may insert additional notices immediately following
this sentence.
libpng versions 1.2.6, August 15, 2004, through 1.2.34, December 18, 2008, are
libpng versions 1.2.6, August 15, 2004, through 1.2.35, February 14, 2009, are
Copyright (c) 2004, 2006-2008 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-1.2.5
with the following individual added to the list of Contributing Authors
@ -106,4 +106,4 @@ certification mark of the Open Source Initiative.
Glenn Randers-Pehrson
glennrp at users.sourceforge.net
December 18, 2008
February 14, 2009

Просмотреть файл

@ -1,6 +1,8 @@
Changes made to pristine png source by mozilla.org developers.
2009/02/19 -- Synced with libpng-1.2.35 (bug #478901).
2008/08/21 -- Synced with libpng-1.2.31 (bug #418900).
2008/03/29 -- Initialize prev_row for each APNG frame, only when

Просмотреть файл

@ -1,4 +1,4 @@
README for libpng version 1.2.34 - December 18, 2008 (shared library 12.0)
README for libpng version 1.2.35 - February 14, 2009 (shared library 12.0)
See the note about version numbers near the top of png.h
See INSTALL for instructions on how to install libpng.
@ -194,11 +194,11 @@ Files in this distribution:
descrip.mms => VMS makefile for MMS or MMK
makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
makefile.elf => Linux/ELF makefile symbol versioning,
gcc, creates libpng12.so.0.1.2.34)
gcc, creates libpng12.so.0.1.2.35)
makefile.linux => Linux/ELF makefile
(gcc, creates libpng12.so.0.1.2.34)
(gcc, creates libpng12.so.0.1.2.35)
makefile.gcmmx => Linux/ELF makefile
(gcc, creates libpng12.so.0.1.2.34,
(gcc, creates libpng12.so.0.1.2.35,
uses assembler code tuned for Intel MMX platform)
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
makefile.knr => Archaic UNIX Makefile that converts files with
@ -220,12 +220,12 @@ Files in this distribution:
makefile.openbsd => OpenBSD makefile
makefile.sgi => Silicon Graphics IRIX (cc, creates static lib)
makefile.sggcc => Silicon Graphics
(gcc, creates libpng12.so.0.1.2.34)
(gcc, creates libpng12.so.0.1.2.35)
makefile.sunos => Sun makefile
makefile.solaris => Solaris 2.X makefile
(gcc, creates libpng12.so.0.1.2.34)
(gcc, creates libpng12.so.0.1.2.35)
makefile.so9 => Solaris 9 makefile
(gcc, creates libpng12.so.0.1.2.34)
(gcc, creates libpng12.so.0.1.2.35)
makefile.32sunu => Sun Ultra 32-bit makefile
makefile.64sunu => Sun Ultra 64-bit makefile
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc

Просмотреть файл

@ -1,15 +1,15 @@
libpng.txt - A description on how to use and modify libpng
libpng version 1.2.34 - December 18, 2008
libpng version 1.2.35 - February 14, 2009
Updated and distributed by Glenn Randers-Pehrson
<glennrp at users.sourceforge.net>
Copyright (c) 1998-2008 Glenn Randers-Pehrson
Copyright (c) 1998-2009 Glenn Randers-Pehrson
For conditions of distribution and use, see copyright
notice in png.h.
Based on:
libpng versions 0.97, January 1998, through 1.2.34 - December 18, 2008
libpng versions 0.97, January 1998, through 1.2.35 - February 14, 2009
Updated and distributed by Glenn Randers-Pehrson
Copyright (c) 1998-2008 Glenn Randers-Pehrson
@ -471,6 +471,8 @@ row_pointers prior to calling png_read_png() with
"Image is too wide to process in memory");
row_pointers = png_malloc(png_ptr,
height*png_sizeof(png_bytep));
for (int i=0; i<height, i++)
row_pointers[i]=NULL; /* security precaution */
for (int i=0; i<height, i++)
row_pointers[i]=png_malloc(png_ptr,
width*pixel_size);
@ -2851,13 +2853,13 @@ application:
IX. Y2K Compliance in libpng
August 21, 2008
February 14, 2009
Since the PNG Development group is an ad-hoc body, we can't make
an official declaration.
This is your unofficial assurance that libpng from version 0.71 and
upward through 1.2.31 are Y2K compliant. It is my belief that earlier
upward through 1.2.35 are Y2K compliant. It is my belief that earlier
versions were also Y2K compliant.
Libpng only has three year fields. One is a 2-byte unsigned integer that

Просмотреть файл

@ -13,7 +13,7 @@
#include "png.h"
/* Generate a compiler error if there is an old png.h in the search path. */
typedef version_1_2_34 Your_png_h_is_not_version_1_2_34;
typedef version_1_2_35 Your_png_h_is_not_version_1_2_35;
/* Version information for C files. This had better match the version
* string defined in png.h. */
@ -697,7 +697,7 @@ png_charp PNGAPI
png_get_copyright(png_structp png_ptr)
{
png_ptr = png_ptr; /* silence compiler warning about unused png_ptr */
return ((png_charp) "\n libpng version 1.2.34 - December 18, 2008\n\
return ((png_charp) "\n libpng version 1.2.35 - February 14, 2009\n\
Copyright (c) 1998-2008 Glenn Randers-Pehrson\n\
Copyright (c) 1996-1997 Andreas Dilger\n\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.\n");

Просмотреть файл

@ -1,14 +1,14 @@
/* png.h - header file for PNG reference library
*
* libpng version 1.2.34 - December 18, 2008
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
* libpng version 1.2.35 - February 14, 2009
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
* Authors and maintainers:
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
* libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
* libpng versions 0.97, January 1998, through 1.2.34 - December 18, 2008: Glenn
* libpng versions 0.97, January 1998, through 1.2.35 - February 14, 2009: Glenn
* See also "Contributing Authors", below.
*
* Note about libpng version numbers:
@ -217,6 +217,11 @@
* 1.2.34rc01 13 10234 12.so.0.34[.0]
* 1.0.42 10 10042 10.so.0.42[.0]
* 1.2.34 13 10234 12.so.0.34[.0]
* 1.2.35beta01-03 13 10235 12.so.0.35[.0]
* 1.0.43rc01-02 10 10043 10.so.0.43[.0]
* 1.2.35rc01-02 13 10235 12.so.0.35[.0]
* 1.0.43 10 10043 10.so.0.43[.0]
* 1.2.35 13 10235 12.so.0.35[.0]
*
* Henceforth the source version will match the shared-library major
* and minor numbers; the shared-library major version number will be
@ -246,7 +251,7 @@
* If you modify libpng you may insert additional notices immediately following
* this sentence.
*
* libpng versions 1.2.6, August 15, 2004, through 1.2.34, December 18, 2008, are
* libpng versions 1.2.6, August 15, 2004, through 1.2.35, February 14, 2009, are
* Copyright (c) 2004, 2006-2008 Glenn Randers-Pehrson, and are
* distributed according to the same disclaimer and license as libpng-1.2.5
* with the following individual added to the list of Contributing Authors:
@ -358,13 +363,13 @@
* Y2K compliance in libpng:
* =========================
*
* December 18, 2008
* February 14, 2009
*
* Since the PNG Development group is an ad-hoc body, we can't make
* an official declaration.
*
* This is your unofficial assurance that libpng from version 0.71 and
* upward through 1.2.34 are Y2K compliant. It is my belief that earlier
* upward through 1.2.35 are Y2K compliant. It is my belief that earlier
* versions were also Y2K compliant.
*
* Libpng only has three year fields. One is a 2-byte unsigned integer
@ -420,9 +425,9 @@
*/
/* Version information for png.h - this should match the version in png.c */
#define PNG_LIBPNG_VER_STRING "1.2.34"
#define PNG_LIBPNG_VER_STRING "1.2.35"
#define PNG_HEADER_VERSION_STRING \
" libpng version 1.2.34 - December 18, 2008\n"
" libpng version 1.2.35 - February 14, 2009\n"
#define PNG_LIBPNG_VER_SONUM 0
#define PNG_LIBPNG_VER_DLLNUM 13
@ -430,7 +435,7 @@
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
#define PNG_LIBPNG_VER_MAJOR 1
#define PNG_LIBPNG_VER_MINOR 2
#define PNG_LIBPNG_VER_RELEASE 34
#define PNG_LIBPNG_VER_RELEASE 35
/* This should match the numeric part of the final component of
* PNG_LIBPNG_VER_STRING, omitting any leading zero: */
@ -458,7 +463,7 @@
* Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only
* version 1.0.0 was mis-numbered 100 instead of 10000). From
* version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release */
#define PNG_LIBPNG_VER 10234 /* 1.2.34 */
#define PNG_LIBPNG_VER 10235 /* 1.2.35 */
#ifndef PNG_VERSION_INFO_ONLY
/* include the compression library's header */
@ -1534,7 +1539,7 @@ struct png_struct_def
/* This triggers a compiler error in png.c, if png.c and png.h
* do not agree upon the version number.
*/
typedef png_structp version_1_2_34;
typedef png_structp version_1_2_35;
typedef png_struct FAR * FAR * png_structpp;

Просмотреть файл

@ -1,9 +1,9 @@
/* pngconf.h - machine configurable file for libpng
*
* libpng version 1.2.34 - December 18, 2008
* libpng version 1.2.35 - February 14, 2009
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*/
@ -235,6 +235,8 @@
# include <windows.h>
/* Console I/O functions are not supported on WindowsCE */
# define PNG_NO_CONSOLE_IO
/* abort() may not be supported on some/all Windows CE platforms */
# define PNG_ABORT() exit(-1)
# ifdef PNG_DEBUG
# undef PNG_DEBUG
# endif

Просмотреть файл

@ -1044,7 +1044,7 @@ png_get_mmx_rowbytes_threshold (png_structp png_ptr)
#endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
/* these functions were added to libpng 1.2.6 */
/* These functions were added to libpng 1.2.6 */
png_uint_32 PNGAPI
png_get_user_width_max (png_structp png_ptr)
{

Просмотреть файл

@ -1,9 +1,9 @@
/* pngread.c - read a PNG file
*
* Last changed in libpng 1.2.30 [August 13, 2008]
* Last changed in libpng 1.2.35 [February 14, 2009]
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@ -1577,11 +1577,11 @@ png_read_png(png_structp png_ptr, png_infop info_ptr,
#ifdef PNG_FREE_ME_SUPPORTED
info_ptr->free_me |= PNG_FREE_ROWS;
#endif
png_memset(info_ptr->row_pointers, 0, info_ptr->height
* png_sizeof(png_bytep));
for (row = 0; row < (int)info_ptr->height; row++)
{
info_ptr->row_pointers[row] = (png_bytep)png_malloc(png_ptr,
png_get_rowbytes(png_ptr, info_ptr));
}
}
png_read_image(png_ptr, info_ptr->row_pointers);

Просмотреть файл

@ -1,9 +1,9 @@
/* pngrtran.c - transforms the data in a row for PNG readers
*
* Last changed in libpng 1.2.30 [August 13, 2008]
* Last changed in libpng 1.2.35 [February 14, 2009]
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@ -309,9 +309,7 @@ png_set_dither(png_structp png_ptr, png_colorp palette,
hash = (png_dsortpp)png_malloc(png_ptr, (png_uint_32)(769 *
png_sizeof(png_dsortp)));
for (i = 0; i < 769; i++)
hash[i] = NULL;
/* png_memset(hash, 0, 769 * png_sizeof(png_dsortp)); */
png_memset(hash, 0, 769 * png_sizeof(png_dsortp));
num_new_palette = num_palette;
@ -684,7 +682,7 @@ png_set_rgb_to_gray_fixed(png_structp png_ptr, int error_action,
}
png_ptr->rgb_to_gray_red_coeff = red_int;
png_ptr->rgb_to_gray_green_coeff = green_int;
png_ptr->rgb_to_gray_blue_coeff =
png_ptr->rgb_to_gray_blue_coeff =
(png_uint_16)(32768 - red_int - green_int);
}
}
@ -1329,7 +1327,7 @@ png_do_read_transformations(png_structp png_ptr)
if (rgb_error)
{
png_ptr->rgb_to_gray_status=1;
if ((png_ptr->transformations & PNG_RGB_TO_GRAY) ==
if ((png_ptr->transformations & PNG_RGB_TO_GRAY) ==
PNG_RGB_TO_GRAY_WARN)
png_warning(png_ptr, "png_do_rgb_to_gray found nongray pixel");
if ((png_ptr->transformations & PNG_RGB_TO_GRAY) ==
@ -3836,7 +3834,7 @@ png_do_expand(png_row_infop row_info, png_bytep row,
dp = row + (row_info->rowbytes << 1) - 1;
for (i = 0; i < row_width; i++)
{
if (*(sp - 1) == gray_high && *(sp) == gray_low)
if (*(sp - 1) == gray_high && *(sp) == gray_low)
{
*dp-- = 0;
*dp-- = 0;
@ -4133,6 +4131,8 @@ png_build_gamma_table(png_structp png_ptr)
double fin, fout;
png_uint_32 last, max;
png_memset(png_ptr->gamma_16_table, 0, num * png_sizeof(png_uint_16p));
for (i = 0; i < num; i++)
{
png_ptr->gamma_16_table[i] = (png_uint_16p)png_malloc(png_ptr,
@ -4188,6 +4188,8 @@ png_build_gamma_table(png_structp png_ptr)
png_ptr->gamma_16_to_1 = (png_uint_16pp)png_malloc(png_ptr,
(png_uint_32)(num * png_sizeof(png_uint_16p )));
png_memset(png_ptr->gamma_16_to_1, 0, num * png_sizeof(png_uint_16p));
for (i = 0; i < num; i++)
{
png_ptr->gamma_16_to_1[i] = (png_uint_16p)png_malloc(png_ptr,
@ -4211,6 +4213,9 @@ png_build_gamma_table(png_structp png_ptr)
png_ptr->gamma_16_from_1 = (png_uint_16pp)png_malloc(png_ptr,
(png_uint_32)(num * png_sizeof(png_uint_16p)));
png_memset(png_ptr->gamma_16_from_1, 0,
num * png_sizeof(png_uint_16p));
for (i = 0; i < num; i++)
{
png_ptr->gamma_16_from_1[i] = (png_uint_16p)png_malloc(png_ptr,

Просмотреть файл

@ -1123,6 +1123,7 @@ png_handle_sPLT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
png_debug(1, "in png_handle_sPLT");
if (!(png_ptr->mode & PNG_HAVE_IHDR))
png_error(png_ptr, "Missing IHDR before sPLT");
else if (png_ptr->mode & PNG_HAVE_IDAT)
@ -1909,6 +1910,7 @@ png_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
png_debug(1, "in png_handle_tEXt");
if (!(png_ptr->mode & PNG_HAVE_IHDR))
png_error(png_ptr, "Missing IHDR before tEXt");
@ -1925,6 +1927,7 @@ png_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
#endif
png_free(png_ptr, png_ptr->chunkdata);
png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1);
if (png_ptr->chunkdata == NULL)
{
@ -1942,6 +1945,7 @@ png_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
}
key = png_ptr->chunkdata;
key[slength] = 0x00;
for (text = key; *text; text++)
@ -1991,6 +1995,8 @@ png_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
png_size_t slength, prefix_len, data_len;
png_debug(1, "in png_handle_zTXt");
if (!(png_ptr->mode & PNG_HAVE_IHDR))
png_error(png_ptr, "Missing IHDR before zTXt");
@ -2095,6 +2101,7 @@ png_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
png_debug(1, "in png_handle_iTXt");
if (!(png_ptr->mode & PNG_HAVE_IHDR))
png_error(png_ptr, "Missing IHDR before iTXt");
@ -2383,6 +2390,7 @@ png_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
png_debug(1, "in png_handle_unknown");
if (png_ptr->mode & PNG_HAVE_IDAT)
{
#ifdef PNG_USE_LOCAL_ARRAYS
@ -3371,9 +3379,9 @@ defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
png_debug1(3, "width = %lu,", png_ptr->width);
png_debug1(3, "height = %lu,", png_ptr->height);
png_debug1(3, "iwidth = %lu,", png_ptr->iwidth);
png_debug1(3, "num_rows = %lu", png_ptr->num_rows);
png_debug1(3, "num_rows = %lu,", png_ptr->num_rows);
png_debug1(3, "rowbytes = %lu,", png_ptr->rowbytes);
png_debug1(3, "irowbytes = %lu,", png_ptr->irowbytes);
png_debug1(3, "irowbytes = %lu", png_ptr->irowbytes);
png_ptr->flags |= PNG_FLAG_ROW_INIT;
}

Просмотреть файл

@ -1,9 +1,9 @@
/* pngset.c - storage of image information into info struct
*
* Last changed in libpng 1.2.34 [December 18, 2008]
* Last changed in libpng 1.2.35 [February 14, 2009]
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@ -61,7 +61,8 @@ png_set_cHRM(png_structp png_ptr, png_infop info_ptr,
#endif
info_ptr->valid |= PNG_INFO_cHRM;
}
#endif
#endif /* PNG_FLOATING_POINT_SUPPORTED */
#ifdef PNG_FIXED_POINT_SUPPORTED
void PNGAPI
png_set_cHRM_fixed(png_structp png_ptr, png_infop info_ptr,
@ -387,7 +388,11 @@ png_set_pCAL(png_structp png_ptr, png_infop info_ptr,
return;
}
info_ptr->pcal_params[nparams] = NULL;
#ifdef PNG_FREE_ME_SUPPORTED
info_ptr->free_me |= PNG_FREE_PCAL;
#endif
png_memset(info_ptr->pcal_params, 0, (nparams + 1) * png_sizeof(png_charp));
for (i = 0; i < nparams; i++)
{
@ -404,9 +409,6 @@ png_set_pCAL(png_structp png_ptr, png_infop info_ptr,
}
info_ptr->valid |= PNG_INFO_pCAL;
#ifdef PNG_FREE_ME_SUPPORTED
info_ptr->free_me |= PNG_FREE_PCAL;
#endif
}
#endif
@ -640,7 +642,7 @@ png_set_sRGB_gAMA_and_cHRM(png_structp png_ptr, png_infop info_ptr,
}
#endif /* cHRM */
}
#endif
#endif /* sRGB */
#if defined(PNG_iCCP_SUPPORTED)
@ -964,6 +966,7 @@ png_set_sPLT(png_structp png_ptr,
png_memcpy(np, info_ptr->splt_palettes,
info_ptr->splt_palettes_num * png_sizeof(png_sPLT_t));
png_free(png_ptr, info_ptr->splt_palettes);
info_ptr->splt_palettes=NULL;

Просмотреть файл

@ -1,9 +1,9 @@
/* pngwio.c - functions for data output
*
* Last changed in libpng 1.2.30 [August 13, 2008]
* Last changed in libpng 1.2.35 [February 14, 2009]
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
* Copyright (c) 1998-2009 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
@ -137,7 +137,7 @@ png_default_flush(png_structp png_ptr)
if (png_ptr == NULL) return;
#if !defined(_WIN32_WCE)
io_ptr = (png_FILE_p)CVT_PTR((png_ptr->io_ptr));
if (io_ptr != NULL)
if (io_ptr != NULL && fileno(io_ptr) != -1)
fflush(io_ptr);
#endif
}

Просмотреть файл

@ -1,7 +1,7 @@
/* pngwrite.c - general routines to write a PNG file
*
* Last changed in libpng 1.2.31 [August 19, 2008]
* Last changed in libpng 1.2.34 [December 18, 2008]
* For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2008 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)