lossless, VP8LTransformColor_C: make sure no overflow happens with colors.

Change-Id: Iec0d07cf1188ba96391cdb1b62131fc1469dfac6
This commit is contained in:
Vincent Rabaud 2017-05-24 11:34:40 +02:00
parent af6deaffa0
commit e4eb458741

View File

@ -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);