ofz: Undefined-shift

Change-Id: Ibb42de616566aabdf6596b7c45d0afab90118bc9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175877
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
This commit is contained in:
Caolán McNamara 2024-10-31 15:26:22 +00:00
parent 52a91c1e32
commit 15eb26d0f2

View file

@ -119,8 +119,11 @@ fix16_t fix16_div(fix16_t a, fix16_t b)
int shift = std::countl_zero(remainder);
if (shift > bit_pos)
shift = bit_pos;
if (shift)
{
remainder = (remainder & mask(32 - shift)) << shift;
bit_pos -= shift;
}
uint32_t div = remainder / divider;
remainder = remainder % divider;