diff --git a/NEWS b/NEWS index f940f5988..ec219f9f5 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ ver 0.23.12 (not yet released) * input - curl: require CURL 7.55.0 or later +* decoder + - mad: fix integer underflow with very small files * tags - fix crash bug due to race condition * output diff --git a/src/decoder/plugins/MadDecoderPlugin.cxx b/src/decoder/plugins/MadDecoderPlugin.cxx index b76a93a29..2fede13d4 100644 --- a/src/decoder/plugins/MadDecoderPlugin.cxx +++ b/src/decoder/plugins/MadDecoderPlugin.cxx @@ -843,7 +843,7 @@ MadDecoder::SynthAndSubmit() noexcept size_t pcm_length = synth.pcm.length; if (drop_end_samples && current_frame == max_frames - drop_end_frames - 1) { - if (drop_end_samples >= pcm_length) + if (i + drop_end_samples >= pcm_length) return DecoderCommand::STOP; pcm_length -= drop_end_samples;