mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-12-18 03:04:06 +00:00
Cast values to unsigned to make UBSan not trigger due to left-shifting negatives
This commit is contained in:
parent
27fe716654
commit
aa0ade3f65
|
@ -155,7 +155,8 @@ void kvz_transformskip(const encoder_control_t * const encoder, int16_t *block,i
|
|||
int32_t j,k;
|
||||
for (j = 0; j < block_size; j++) {
|
||||
for(k = 0; k < block_size; k ++) {
|
||||
coeff[j * block_size + k] = block[j * block_size + k] << shift;
|
||||
// Casting back and forth to make UBSan not trigger due to left-shifting negatives
|
||||
coeff[j * block_size + k] = (int16_t)((uint16_t)(block[j * block_size + k]) << shift);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue