mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[libpng16] Prevent PNG_EXPAND+PNG_SHIFT doing the shift twice.
This commit is contained in:
parent
48015617d3
commit
23a30f8583
1
ANNOUNCE
1
ANNOUNCE
@ -344,6 +344,7 @@ Version 1.6.0beta20 [March 28, 2012]
|
||||
Recognize known sRGB ICC profiles while reading and issue a warning about
|
||||
it, if PNG_WARN_IF_iCCP_IS_sRGB_SUPPORTED is defined.
|
||||
Added checksum-icc.c to contrib/tools
|
||||
Prevent PNG_EXPAND+PNG_SHIFT doing the shift twice.
|
||||
|
||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||
(subscription required; visit
|
||||
|
1
CHANGES
1
CHANGES
@ -4095,6 +4095,7 @@ Version 1.6.0beta20 [March 28, 2012]
|
||||
Recognize known sRGB ICC profiles while reading and issue a warning about
|
||||
it, if PNG_WARN_IF_iCCP_IS_sRGB_SUPPORTED is defined.
|
||||
Added checksum-icc.c to contrib/tools
|
||||
Prevent PNG_EXPAND+PNG_SHIFT doing the shift twice.
|
||||
|
||||
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
|
||||
(subscription required; visit
|
||||
|
@ -1866,12 +1866,15 @@ png_init_read_transformations(png_structrp png_ptr)
|
||||
|
||||
#ifdef PNG_READ_SHIFT_SUPPORTED
|
||||
if ((png_ptr->transformations & PNG_SHIFT) &&
|
||||
!(png_ptr->transformations & PNG_EXPAND) &&
|
||||
(png_ptr->color_type == PNG_COLOR_TYPE_PALETTE))
|
||||
{
|
||||
int i;
|
||||
int istop = png_ptr->num_palette;
|
||||
int shift = 8 - png_ptr->sig_bit.red;
|
||||
|
||||
png_ptr->transformations &= ~PNG_SHIFT;
|
||||
|
||||
/* significant bits can be in the range 1 to 7 for a meaninful result, if
|
||||
* the number of significant bits is 0 then no shift is done (this is an
|
||||
* error condition which is silently ignored.)
|
||||
|
Loading…
x
Reference in New Issue
Block a user