Skip to content
  • Erik de Castro Lopo's avatar
    src/encode.c : Fix potential infinite loop in flac-toflac encoding. · 8267168d
    Erik de Castro Lopo authored
    A malformed file (generated by AFL) had a 'samples_left_to_process' value
    of greater than the actual numbe of samples. When re-encoding the decoder
    would get to the end of the file and then continuously return a decode
    status of FLAC__STREAM_DECODER_END_OF_STREAM, causing an infinite loop.
    
    Solution is to break out of the loop on two consecutive end-of-stream
    events.
    8267168d