summaryrefslogtreecommitdiff
path: root/png/pngget.c
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2007-02-06 22:02:28 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2007-02-06 22:02:28 +0000
commitdc24949ad5227ab79641fb61aebc7cbabca807a7 (patch)
tree3df93f17c0aad1892539618f1edd383609168de6 /png/pngget.c
parent58cfbc6c824b16d1ff4bd00546719346bd6e825a (diff)
Update bundled zlib to v1.2.3.
Update bundled libpng to v1.2.16. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5666 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'png/pngget.c')
-rw-r--r--png/pngget.c37
1 files changed, 29 insertions, 8 deletions
diff --git a/png/pngget.c b/png/pngget.c
index eefd3319b..036e9af6e 100644
--- a/png/pngget.c
+++ b/png/pngget.c
@@ -1,9 +1,9 @@
/* pngget.c - retrieval of values from info struct
*
- * libpng 1.2.7 - September 12, 2004
+ * Last changed in libpng 1.2.15 January 5, 2007
* For conditions of distribution and use, see copyright notice in png.h
- * Copyright (c) 1998-2005 Glenn Randers-Pehrson
+ * Copyright (c) 1998-2007 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.)
*/
@@ -11,6 +11,8 @@
#define PNG_INTERNAL
#include "png.h"
+#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
+
png_uint_32 PNGAPI
png_get_valid(png_structp png_ptr, png_infop info_ptr, png_uint_32 flag)
{
@@ -557,9 +559,9 @@ png_get_IHDR(png_structp png_ptr, png_infop info_ptr,
*interlace_type = info_ptr->interlace_type;
/* check for potential overflow of rowbytes */
- if (width == 0 || *width > PNG_UINT_31_MAX)
+ if (*width == 0 || *width > PNG_UINT_31_MAX)
png_error(png_ptr, "Invalid image width");
- if (height == 0 || *height > PNG_UINT_31_MAX)
+ if (*height == 0 || *height > PNG_UINT_31_MAX)
png_error(png_ptr, "Invalid image height");
if (info_ptr->width > (PNG_UINT_32_MAX
>> 3) /* 8-byte RGBA pixels */
@@ -827,19 +829,24 @@ png_get_compression_buffer_size(png_structp png_ptr)
}
#endif
-#ifndef PNG_1_0_X
#ifdef PNG_ASSEMBLER_CODE_SUPPORTED
+#ifndef PNG_1_0_X
/* this function was added to libpng 1.2.0 and should exist by default */
png_uint_32 PNGAPI
png_get_asm_flags (png_structp png_ptr)
{
+#ifdef PNG_MMX_CODE_SUPPORTED
return (png_uint_32)(png_ptr? png_ptr->asm_flags : 0L);
+#else
+ return (png_ptr? 0L: 0L);
+#endif
}
/* this function was added to libpng 1.2.0 and should exist by default */
png_uint_32 PNGAPI
png_get_asm_flagmask (int flag_select)
{
+#ifdef PNG_MMX_CODE_SUPPORTED
png_uint_32 settable_asm_flags = 0;
if (flag_select & PNG_SELECT_READ)
@@ -860,16 +867,18 @@ png_get_asm_flagmask (int flag_select)
#endif /* 0 */
return settable_asm_flags; /* _theoretically_ settable capabilities only */
+#else
+ return (0L);
+#endif /* PNG_MMX_CODE_SUPPORTED */
}
-#endif /* PNG_ASSEMBLER_CODE_SUPPORTED */
-#if defined(PNG_ASSEMBLER_CODE_SUPPORTED)
/* GRR: could add this: && defined(PNG_MMX_CODE_SUPPORTED) */
/* this function was added to libpng 1.2.0 */
png_uint_32 PNGAPI
png_get_mmx_flagmask (int flag_select, int *compilerID)
{
+#if defined(PNG_MMX_CODE_SUPPORTED)
png_uint_32 settable_mmx_flags = 0;
if (flag_select & PNG_SELECT_READ)
@@ -900,21 +909,33 @@ png_get_mmx_flagmask (int flag_select, int *compilerID)
}
return settable_mmx_flags; /* _theoretically_ settable capabilities only */
+#else
+ return (0L);
+#endif /* ?PNG_MMX_CODE_SUPPORTED */
}
/* this function was added to libpng 1.2.0 */
png_byte PNGAPI
png_get_mmx_bitdepth_threshold (png_structp png_ptr)
{
+#if defined(PNG_MMX_CODE_SUPPORTED)
return (png_byte)(png_ptr? png_ptr->mmx_bitdepth_threshold : 0);
+#else
+ return (png_ptr? 0: 0);
+#endif /* ?PNG_MMX_CODE_SUPPORTED */
}
/* this function was added to libpng 1.2.0 */
png_uint_32 PNGAPI
png_get_mmx_rowbytes_threshold (png_structp png_ptr)
{
+#if defined(PNG_MMX_CODE_SUPPORTED)
return (png_uint_32)(png_ptr? png_ptr->mmx_rowbytes_threshold : 0L);
+#else
+ return (png_ptr? 0L: 0L);
+#endif /* ?PNG_MMX_CODE_SUPPORTED */
}
+#endif /* ?PNG_1_0_X */
#endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
@@ -931,4 +952,4 @@ png_get_user_height_max (png_structp png_ptr)
}
#endif /* ?PNG_SET_USER_LIMITS_SUPPORTED */
-#endif /* ?PNG_1_0_X */
+#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */