mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[devel] Correct pngvalid gamma test to check each color sample, not just red.
This commit is contained in:
parent
9f45c8e6e1
commit
e2062f9fa0
@ -249,10 +249,13 @@ sample(png_const_bytep row, png_byte colour_type, png_byte bit_depth,
|
|||||||
if ((colour_type & 1) == 0) /* !palette */
|
if ((colour_type & 1) == 0) /* !palette */
|
||||||
{
|
{
|
||||||
if (colour_type & 2)
|
if (colour_type & 2)
|
||||||
index *= 3, index += sample; /* Colour channels; select one */
|
index *= 3;
|
||||||
|
|
||||||
if (colour_type & 4)
|
if (colour_type & 4)
|
||||||
index += x; /* Alpha channel */
|
index += x; /* Alpha channel */
|
||||||
|
|
||||||
|
if (colour_type & (2+4))
|
||||||
|
index += sample * bit_depth; /* Multiple channels: select one */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return the sample from the row as an integer. */
|
/* Return the sample from the row as an integer. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user