X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/706b88074de0c288b81edac13094dd052b6cc078..f915b92e09ce8df3b8967900af2180ab36db2ed0:/src/png/pngget.c?ds=sidebyside diff --git a/src/png/pngget.c b/src/png/pngget.c index 1d1cc218bd..a0e90bb6a4 100644 --- a/src/png/pngget.c +++ b/src/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-2004 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) { @@ -510,8 +512,11 @@ png_get_sPLT(png_structp png_ptr, png_infop info_ptr, png_sPLT_tpp spalettes) { if (png_ptr != NULL && info_ptr != NULL && spalettes != NULL) + { *spalettes = info_ptr->splt_palettes; - return ((png_uint_32)info_ptr->splt_palettes_num); + return ((png_uint_32)info_ptr->splt_palettes_num); + } + return (0); } #endif @@ -557,9 +562,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 */ @@ -798,8 +803,11 @@ png_get_unknown_chunks(png_structp png_ptr, png_infop info_ptr, png_unknown_chunkpp unknowns) { if (png_ptr != NULL && info_ptr != NULL && unknowns != NULL) + { *unknowns = info_ptr->unknown_chunks; - return ((png_uint_32)info_ptr->unknown_chunks_num); + return ((png_uint_32)info_ptr->unknown_chunks_num); + } + return (0); } #endif @@ -827,94 +835,52 @@ 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) { - return (png_uint_32)(png_ptr? png_ptr->asm_flags : 0L); + /* obsolete, to be removed from libpng-1.4.0 */ + return (png_ptr? 0L: 0L); } /* 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) { - png_uint_32 settable_asm_flags = 0; - - if (flag_select & PNG_SELECT_READ) - settable_asm_flags |= - PNG_ASM_FLAG_MMX_READ_COMBINE_ROW | - PNG_ASM_FLAG_MMX_READ_INTERLACE | - PNG_ASM_FLAG_MMX_READ_FILTER_SUB | - PNG_ASM_FLAG_MMX_READ_FILTER_UP | - PNG_ASM_FLAG_MMX_READ_FILTER_AVG | - PNG_ASM_FLAG_MMX_READ_FILTER_PAETH ; - /* no non-MMX flags yet */ - -#if 0 - /* GRR: no write-flags yet, either, but someday... */ - if (flag_select & PNG_SELECT_WRITE) - settable_asm_flags |= - PNG_ASM_FLAG_MMX_WRITE_ [whatever] ; -#endif /* 0 */ - - return settable_asm_flags; /* _theoretically_ settable capabilities only */ + /* obsolete, to be removed from libpng-1.4.0 */ + flag_select=flag_select; + return 0L; } -#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) { - png_uint_32 settable_mmx_flags = 0; - - if (flag_select & PNG_SELECT_READ) - settable_mmx_flags |= - PNG_ASM_FLAG_MMX_READ_COMBINE_ROW | - PNG_ASM_FLAG_MMX_READ_INTERLACE | - PNG_ASM_FLAG_MMX_READ_FILTER_SUB | - PNG_ASM_FLAG_MMX_READ_FILTER_UP | - PNG_ASM_FLAG_MMX_READ_FILTER_AVG | - PNG_ASM_FLAG_MMX_READ_FILTER_PAETH ; -#if 0 - /* GRR: no MMX write support yet, but someday... */ - if (flag_select & PNG_SELECT_WRITE) - settable_mmx_flags |= - PNG_ASM_FLAG_MMX_WRITE_ [whatever] ; -#endif /* 0 */ - - if (compilerID != NULL) { -#ifdef PNG_USE_PNGVCRD - *compilerID = 1; /* MSVC */ -#else -#ifdef PNG_USE_PNGGCCRD - *compilerID = 2; /* gcc/gas */ -#else - *compilerID = -1; /* unknown (i.e., no asm/MMX code compiled) */ -#endif -#endif - } - - return settable_mmx_flags; /* _theoretically_ settable capabilities only */ + /* obsolete, to be removed from libpng-1.4.0 */ + flag_select=flag_select; + *compilerID = -1; /* unknown (i.e., no asm/MMX code compiled) */ + return 0L; } /* this function was added to libpng 1.2.0 */ png_byte PNGAPI png_get_mmx_bitdepth_threshold (png_structp png_ptr) { - return (png_byte)(png_ptr? png_ptr->mmx_bitdepth_threshold : 0); + /* obsolete, to be removed from libpng-1.4.0 */ + return (png_ptr? 0: 0); } /* this function was added to libpng 1.2.0 */ png_uint_32 PNGAPI png_get_mmx_rowbytes_threshold (png_structp png_ptr) { - return (png_uint_32)(png_ptr? png_ptr->mmx_rowbytes_threshold : 0L); + /* obsolete, to be removed from libpng-1.4.0 */ + return (png_ptr? 0L: 0L); } +#endif /* ?PNG_1_0_X */ #endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */ #ifdef PNG_SET_USER_LIMITS_SUPPORTED @@ -930,5 +896,6 @@ png_get_user_height_max (png_structp png_ptr) return (png_ptr? png_ptr->user_height_max : 0); } #endif /* ?PNG_SET_USER_LIMITS_SUPPORTED */ + -#endif /* ?PNG_1_0_X */ +#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */