• Rémi Denis-Courmont's avatar
    vlc_bits: fix integer overflow in signed ExpGolomb code · 61eb0882
    Rémi Denis-Courmont authored
    When bs_read_ue() returned 2^32-1, computing (val + 1) as 'int'
    overflowed. With this patch, the conversion from unsigned to signed is
    performed after the division by two, so that the absolute value range
    is always within limits of the signed 32-bits integer type.
    Also use fast types since the function are meant to be inlined.
vlc_bits.h 6.03 KB