mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-27 22:28:22 +01:00
lossless, VP8LTransformColor_C: make sure no overflow happens with colors.
Change-Id: Iec0d07cf1188ba96391cdb1b62131fc1469dfac6
This commit is contained in:
parent
af6deaffa0
commit
e4eb458741
@ -520,8 +520,8 @@ void VP8LTransformColor_C(const VP8LMultipliers* const m, uint32_t* data,
|
|||||||
const uint32_t argb = data[i];
|
const uint32_t argb = data[i];
|
||||||
const uint32_t green = argb >> 8;
|
const uint32_t green = argb >> 8;
|
||||||
const uint32_t red = argb >> 16;
|
const uint32_t red = argb >> 16;
|
||||||
int new_red = red;
|
int new_red = red & 0xff;
|
||||||
int new_blue = argb;
|
int new_blue = argb & 0xff;
|
||||||
new_red -= ColorTransformDelta(m->green_to_red_, green);
|
new_red -= ColorTransformDelta(m->green_to_red_, green);
|
||||||
new_red &= 0xff;
|
new_red &= 0xff;
|
||||||
new_blue -= ColorTransformDelta(m->green_to_blue_, green);
|
new_blue -= ColorTransformDelta(m->green_to_blue_, green);
|
||||||
|
Loading…
Reference in New Issue
Block a user