vp8l_enc,AddSingleSubGreen: clear int sanitizer warnings

this localizes the conversion to int in the function; the parameter was
previously changed in:
6ab496ed fix some 'unsigned integer overflow' warnings in ubsan

implicit conversion from type 'uint32_t' (aka 'unsigned int') of value
2350919223 (32-bit, unsigned) to type 'int' changed the value to
-1944048073 (32-bit, signed)

Bug: b/229626362
Change-Id: I589eec11c0dabaeba99e153e705f956181c570d2
This commit is contained in:
James Zern 2022-08-08 13:54:40 -07:00
parent e2fecc22e1
commit 00ff988a59

View File

@ -361,10 +361,11 @@ typedef enum {
kHistoTotal // Must be last. kHistoTotal // Must be last.
} HistoIx; } HistoIx;
static void AddSingleSubGreen(int p, uint32_t* const r, uint32_t* const b) { static void AddSingleSubGreen(uint32_t p,
const int green = p >> 8; // The upper bits are masked away later. uint32_t* const r, uint32_t* const b) {
++r[((p >> 16) - green) & 0xff]; const int green = (int)p >> 8; // The upper bits are masked away later.
++b[((p >> 0) - green) & 0xff]; ++r[(((int)p >> 16) - green) & 0xff];
++b[(((int)p >> 0) - green) & 0xff];
} }
static void AddSingle(uint32_t p, static void AddSingle(uint32_t p,