aboutsummaryrefslogtreecommitdiffstats
path: root/pngrio.c
diff options
context:
space:
mode:
authorPatrick Scott <phanna@android.com>2010-06-28 16:55:16 -0400
committerPatrick Scott <phanna@android.com>2010-06-28 16:55:16 -0400
commit5f6bd84e375226bf228fc8ac90318957ec9e1e7f (patch)
treeda1284f5023ad422da3263b48f1cefa6d6443912 /pngrio.c
parent342380c79a16cc2e5ba7859c3fc4e40f2661ea45 (diff)
downloadexternal_libpng-5f6bd84e375226bf228fc8ac90318957ec9e1e7f.zip
external_libpng-5f6bd84e375226bf228fc8ac90318957ec9e1e7f.tar.gz
external_libpng-5f6bd84e375226bf228fc8ac90318957ec9e1e7f.tar.bz2
Upgrade libpng to 1.2.44 for security fixes.
Change-Id: Iae257ca6ea7031a99f38e9de196d71ef8b94f9aa
Diffstat (limited to 'pngrio.c')
-rw-r--r--pngrio.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/pngrio.c b/pngrio.c
index 2267bca..6978682 100644
--- a/pngrio.c
+++ b/pngrio.c
@@ -1,8 +1,8 @@
/* pngrio.c - functions for data input
*
- * Last changed in libpng 1.2.37 [June 4, 2009]
- * Copyright (c) 1998-2009 Glenn Randers-Pehrson
+ * Last changed in libpng 1.2.43 [February 25, 2010]
+ * Copyright (c) 1998-2010 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.)
*
@@ -19,8 +19,9 @@
*/
#define PNG_INTERNAL
+#define PNG_NO_PEDANTIC_WARNINGS
#include "png.h"
-#if defined(PNG_READ_SUPPORTED)
+#ifdef PNG_READ_SUPPORTED
/* Read the data from whatever input you are using. The default routine
* reads from a file pointer. Note that this routine sometimes gets called
@@ -32,13 +33,14 @@ void /* PRIVATE */
png_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
{
png_debug1(4, "reading %d bytes", (int)length);
+
if (png_ptr->read_data_fn != NULL)
(*(png_ptr->read_data_fn))(png_ptr, data, length);
else
png_error(png_ptr, "Call to NULL read function");
}
-#if !defined(PNG_NO_STDIO)
+#ifdef PNG_STDIO_SUPPORTED
/* This is the function that does the actual reading of data. If you are
* not reading from a standard C stream, you should create a replacement
* read_data function and use it at run time with png_set_read_fn(), rather
@@ -55,7 +57,7 @@ png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
/* fread() returns 0 on error, so it is OK to store this in a png_size_t
* instead of an int, which is what fread() actually returns.
*/
-#if defined(_WIN32_WCE)
+#ifdef _WIN32_WCE
if ( !ReadFile((HANDLE)(png_ptr->io_ptr), data, length, &check, NULL) )
check = 0;
#else
@@ -89,8 +91,9 @@ png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
io_ptr = (png_FILE_p)CVT_PTR(png_ptr->io_ptr);
if ((png_bytep)n_data == data)
{
-#if defined(_WIN32_WCE)
- if ( !ReadFile((HANDLE)(png_ptr->io_ptr), data, length, &check, NULL) )
+#ifdef _WIN32_WCE
+ if ( !ReadFile((HANDLE)(png_ptr->io_ptr), data, length, &check,
+ NULL) )
check = 0;
#else
check = fread(n_data, 1, length, io_ptr);
@@ -105,7 +108,7 @@ png_default_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
do
{
read = MIN(NEAR_BUF_SIZE, remaining);
-#if defined(_WIN32_WCE)
+#ifdef _WIN32_WCE
if ( !ReadFile((HANDLE)(io_ptr), buf, read, &err, NULL) )
err = 0;
#else
@@ -151,7 +154,7 @@ png_set_read_fn(png_structp png_ptr, png_voidp io_ptr,
return;
png_ptr->io_ptr = io_ptr;
-#if !defined(PNG_NO_STDIO)
+#ifdef PNG_STDIO_SUPPORTED
if (read_data_fn != NULL)
png_ptr->read_data_fn = read_data_fn;
else
@@ -170,7 +173,7 @@ png_set_read_fn(png_structp png_ptr, png_voidp io_ptr,
"same structure. Resetting write_data_fn to NULL.");
}
-#if defined(PNG_WRITE_FLUSH_SUPPORTED)
+#ifdef PNG_WRITE_FLUSH_SUPPORTED
png_ptr->output_flush_fn = NULL;
#endif
}