Skip to content
  • Erik de Castro Lopo's avatar
    flac/encode.c: Fix an integer overflow · 3a7884bf
    Erik de Castro Lopo authored
    When encoding a 24 bit multichannel W64 file on a 32 bit system, a
    calculation could overflow resulting in a "got partial sample"
    error and early termination of the encoding process.
    
    The fix was to replace the cast to `size_t` (which is only 32 bits
    on a 32 bit system) with a cast to `uin64_t`.
    
    Thanks to Janne Hyvärinen for helping to track down the problem.
    
    Closes: https://sourceforge.net/p/flac/bugs/453
    3a7884bf