Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Unified Diff: third_party/libpng/pngrtran.c

Issue 1372313004: Update to libpng 1.2.52 (rollup change only) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/libpng/pngread.c ('k') | third_party/libpng/pngrutil.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/libpng/pngrtran.c
diff --git a/third_party/libpng/pngrtran.c b/third_party/libpng/pngrtran.c
index 33703d46ea175168284afffbe2f776937ab71f4d..0a760cef0273484ec1345af3a2ae1a4e3086a6aa 100644
--- a/third_party/libpng/pngrtran.c
+++ b/third_party/libpng/pngrtran.c
@@ -1,8 +1,8 @@
/* pngrtran.c - transforms the data in a row for PNG readers
*
- * Last changed in libpng 1.2.45 [July 7, 2011]
- * Copyright (c) 1998-2011 Glenn Randers-Pehrson
+ * Last changed in libpng 1.2.51 [February 6, 2014]
+ * Copyright (c) 1998-2014 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.)
*
@@ -917,7 +917,10 @@ png_init_read_transformations(png_structp png_ptr)
for (i=0; i<png_ptr->num_trans; i++)
{
if (png_ptr->trans[i] != 0 && png_ptr->trans[i] != 0xff)
+ {
k=1; /* Partial transparency is present */
+ break;
+ }
}
if (k == 0)
png_ptr->transformations &= ~PNG_GAMMA;
@@ -1163,6 +1166,7 @@ png_init_read_transformations(png_structp png_ptr)
#ifdef PNG_READ_SHIFT_SUPPORTED
if ((png_ptr->transformations & PNG_SHIFT) &&
+ !(png_ptr->transformations & PNG_EXPAND) &&
(color_type == PNG_COLOR_TYPE_PALETTE))
{
png_uint_16 i;
@@ -1183,6 +1187,8 @@ png_init_read_transformations(png_structp png_ptr)
png_ptr->palette[i].green >>= sg;
png_ptr->palette[i].blue >>= sb;
}
+
+ png_ptr->transformations &= ~PNG_SHIFT;
}
#endif /* PNG_READ_SHIFT_SUPPORTED */
}
@@ -1373,6 +1379,9 @@ png_do_read_transformations(png_structp png_ptr)
{
if (png_ptr->row_info.color_type == PNG_COLOR_TYPE_PALETTE)
{
+ if (png_ptr->palette == NULL)
+ png_error (png_ptr, "Palette is NULL in indexed image");
+
png_do_expand_palette(&(png_ptr->row_info), png_ptr->row_buf + 1,
png_ptr->palette, png_ptr->trans, png_ptr->num_trans);
}
« no previous file with comments | « third_party/libpng/pngread.c ('k') | third_party/libpng/pngrutil.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698