Skip to content
  • Erik de Castro Lopo's avatar
    libFLAC/fixed.c: Fix undefined behaviour · 1b8af6bb
    Erik de Castro Lopo authored
    Left shift if a negative integer such that the sign bit is affected is
    (according to the C spec) undefined behaviour and the residual
    calculations using the shift operator were hitting this.
    
    Fortunately these same calculations using plain multiplication do not
    invoke UB and according to benchmarking (on x86_64 linux) have the same
    performance as the bit shift version.
    1b8af6bb