diff options
author | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-18 18:22:04 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-18 18:22:04 +0000 |
commit | 71b9d6403ceaaef6b2b258fbb32f1a77b7c875e6 (patch) | |
tree | 30c9d23615c9d559a845b282a18b994d417e8f40 /third_party/libpng/pngwtran.c | |
parent | fe5aac24dff85b8a035dbda9660d7b470fb08df0 (diff) | |
download | chromium_src-71b9d6403ceaaef6b2b258fbb32f1a77b7c875e6.zip chromium_src-71b9d6403ceaaef6b2b258fbb32f1a77b7c875e6.tar.gz chromium_src-71b9d6403ceaaef6b2b258fbb32f1a77b7c875e6.tar.bz2 |
libpng: update to 1.2.43
I unpacked libpng 1.2.43 and did:
cd third_party/libpng
for x in $(ls -1) ; do cp /tmp/libpng-1.2.43/$x .; done
The diffs appear to all be safe. The Chromium specific config is in pngusr.h
and isn't touched by this change.
1.2.43 fixes http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-0205
c7013d773eb45b8ed6a864e419e544106a0dd95d /tmp/libpng-1.2.43.tar.xz
BUG=38512
TEST=none
http://codereview.chromium.org/1118002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41972 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/libpng/pngwtran.c')
-rw-r--r-- | third_party/libpng/pngwtran.c | 58 |
1 files changed, 34 insertions, 24 deletions
diff --git a/third_party/libpng/pngwtran.c b/third_party/libpng/pngwtran.c index ac56339..0ce9b9b 100644 --- a/third_party/libpng/pngwtran.c +++ b/third_party/libpng/pngwtran.c @@ -1,14 +1,18 @@ /* pngwtran.c - transforms the data in a row for PNG writers * - * Last changed in libpng 1.2.37 [June 4, 2009] - * For conditions of distribution and use, see copyright notice in png.h - * 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.) + * + * This code is released under the libpng license. + * For conditions of distribution and use, see the disclaimer + * and license in png.h */ #define PNG_INTERNAL +#define PNG_NO_PEDANTIC_WARNINGS #include "png.h" #ifdef PNG_WRITE_SUPPORTED @@ -23,10 +27,11 @@ png_do_write_transformations(png_structp png_ptr) if (png_ptr == NULL) return; -#if defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) +#ifdef PNG_WRITE_USER_TRANSFORM_SUPPORTED if (png_ptr->transformations & PNG_USER_TRANSFORM) if (png_ptr->write_user_transform_fn != NULL) - (*(png_ptr->write_user_transform_fn)) /* User write transform function */ + (*(png_ptr->write_user_transform_fn)) /* User write transform + function */ (png_ptr, /* png_ptr */ &(png_ptr->row_info), /* row_info: */ /* png_uint_32 width; width of row */ @@ -37,48 +42,48 @@ png_do_write_transformations(png_structp png_ptr) /* png_byte pixel_depth; bits per pixel (depth*channels) */ png_ptr->row_buf + 1); /* start of pixel data for row */ #endif -#if defined(PNG_WRITE_FILLER_SUPPORTED) +#ifdef PNG_WRITE_FILLER_SUPPORTED if (png_ptr->transformations & PNG_FILLER) png_do_strip_filler(&(png_ptr->row_info), png_ptr->row_buf + 1, png_ptr->flags); #endif -#if defined(PNG_WRITE_PACKSWAP_SUPPORTED) +#ifdef PNG_WRITE_PACKSWAP_SUPPORTED if (png_ptr->transformations & PNG_PACKSWAP) png_do_packswap(&(png_ptr->row_info), png_ptr->row_buf + 1); #endif -#if defined(PNG_WRITE_PACK_SUPPORTED) +#ifdef PNG_WRITE_PACK_SUPPORTED if (png_ptr->transformations & PNG_PACK) png_do_pack(&(png_ptr->row_info), png_ptr->row_buf + 1, (png_uint_32)png_ptr->bit_depth); #endif -#if defined(PNG_WRITE_SWAP_SUPPORTED) +#ifdef PNG_WRITE_SWAP_SUPPORTED if (png_ptr->transformations & PNG_SWAP_BYTES) png_do_swap(&(png_ptr->row_info), png_ptr->row_buf + 1); #endif -#if defined(PNG_WRITE_SHIFT_SUPPORTED) +#ifdef PNG_WRITE_SHIFT_SUPPORTED if (png_ptr->transformations & PNG_SHIFT) png_do_shift(&(png_ptr->row_info), png_ptr->row_buf + 1, &(png_ptr->shift)); #endif -#if defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) +#ifdef PNG_WRITE_SWAP_ALPHA_SUPPORTED if (png_ptr->transformations & PNG_SWAP_ALPHA) png_do_write_swap_alpha(&(png_ptr->row_info), png_ptr->row_buf + 1); #endif -#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) +#ifdef PNG_WRITE_INVERT_ALPHA_SUPPORTED if (png_ptr->transformations & PNG_INVERT_ALPHA) png_do_write_invert_alpha(&(png_ptr->row_info), png_ptr->row_buf + 1); #endif -#if defined(PNG_WRITE_BGR_SUPPORTED) +#ifdef PNG_WRITE_BGR_SUPPORTED if (png_ptr->transformations & PNG_BGR) png_do_bgr(&(png_ptr->row_info), png_ptr->row_buf + 1); #endif -#if defined(PNG_WRITE_INVERT_SUPPORTED) +#ifdef PNG_WRITE_INVERT_SUPPORTED if (png_ptr->transformations & PNG_INVERT_MONO) png_do_invert(&(png_ptr->row_info), png_ptr->row_buf + 1); #endif } -#if defined(PNG_WRITE_PACK_SUPPORTED) +#ifdef PNG_WRITE_PACK_SUPPORTED /* Pack pixels into bytes. Pass the true bit depth in bit_depth. The * row_info bit depth should be 8 (one pixel per byte). The channels * should be 1 (this only happens on grayscale and paletted images). @@ -87,8 +92,9 @@ void /* PRIVATE */ png_do_pack(png_row_infop row_info, png_bytep row, png_uint_32 bit_depth) { png_debug(1, "in png_do_pack"); + if (row_info->bit_depth == 8 && -#if defined(PNG_USELESS_TESTS_SUPPORTED) +#ifdef PNG_USELESS_TESTS_SUPPORTED row != NULL && row_info != NULL && #endif row_info->channels == 1) @@ -201,7 +207,7 @@ png_do_pack(png_row_infop row_info, png_bytep row, png_uint_32 bit_depth) } #endif -#if defined(PNG_WRITE_SHIFT_SUPPORTED) +#ifdef PNG_WRITE_SHIFT_SUPPORTED /* Shift pixel values to take advantage of whole range. Pass the * true number of bits in bit_depth. The row should be packed * according to row_info->bit_depth. Thus, if you had a row of @@ -213,7 +219,8 @@ void /* PRIVATE */ png_do_shift(png_row_infop row_info, png_bytep row, png_color_8p bit_depth) { png_debug(1, "in png_do_shift"); -#if defined(PNG_USELESS_TESTS_SUPPORTED) + +#ifdef PNG_USELESS_TESTS_SUPPORTED if (row != NULL && row_info != NULL && #else if ( @@ -332,12 +339,13 @@ png_do_shift(png_row_infop row_info, png_bytep row, png_color_8p bit_depth) } #endif -#if defined(PNG_WRITE_SWAP_ALPHA_SUPPORTED) +#ifdef PNG_WRITE_SWAP_ALPHA_SUPPORTED void /* PRIVATE */ png_do_write_swap_alpha(png_row_infop row_info, png_bytep row) { png_debug(1, "in png_do_write_swap_alpha"); -#if defined(PNG_USELESS_TESTS_SUPPORTED) + +#ifdef PNG_USELESS_TESTS_SUPPORTED if (row != NULL && row_info != NULL) #endif { @@ -420,12 +428,13 @@ png_do_write_swap_alpha(png_row_infop row_info, png_bytep row) } #endif -#if defined(PNG_WRITE_INVERT_ALPHA_SUPPORTED) +#ifdef PNG_WRITE_INVERT_ALPHA_SUPPORTED void /* PRIVATE */ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row) { png_debug(1, "in png_do_write_invert_alpha"); -#if defined(PNG_USELESS_TESTS_SUPPORTED) + +#ifdef PNG_USELESS_TESTS_SUPPORTED if (row != NULL && row_info != NULL) #endif { @@ -509,14 +518,15 @@ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row) } #endif -#if defined(PNG_MNG_FEATURES_SUPPORTED) +#ifdef PNG_MNG_FEATURES_SUPPORTED /* Undoes intrapixel differencing */ void /* PRIVATE */ png_do_write_intrapixel(png_row_infop row_info, png_bytep row) { png_debug(1, "in png_do_write_intrapixel"); + if ( -#if defined(PNG_USELESS_TESTS_SUPPORTED) +#ifdef PNG_USELESS_TESTS_SUPPORTED row != NULL && row_info != NULL && #endif (row_info->color_type & PNG_COLOR_MASK_COLOR)) |