From b3897df682ce7d22002d8feb124e585cfb3eeb08 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 17 Jan 2023 18:53:15 +0100 Subject: [PATCH] decoder/mad: add assert() --- src/decoder/plugins/MadDecoderPlugin.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/decoder/plugins/MadDecoderPlugin.cxx b/src/decoder/plugins/MadDecoderPlugin.cxx index 2fede13d4..7e34c25b1 100644 --- a/src/decoder/plugins/MadDecoderPlugin.cxx +++ b/src/decoder/plugins/MadDecoderPlugin.cxx @@ -798,6 +798,8 @@ MadDecoder::UpdateTimerNextFrame() noexcept DecoderCommand MadDecoder::SubmitPCM(size_t i, size_t pcm_length) noexcept { + assert(i <= pcm_length); + size_t num_samples = pcm_length - i; mad_fixed_to_24_buffer(output_buffer, synth.pcm,