[vlc-devel] [PATCH 1/2] aout: add more asserts
Thomas Guillem
thomas at gllm.fr
Tue Feb 12 10:02:30 CET 2019
---
src/audio_output/dec.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/audio_output/dec.c b/src/audio_output/dec.c
index 104d5cca82..b913ac18a0 100644
--- a/src/audio_output/dec.c
+++ b/src/audio_output/dec.c
@@ -202,6 +202,7 @@ static void aout_StopResampling (audio_output_t *aout)
static void aout_DecSilence (audio_output_t *aout, vlc_tick_t length, vlc_tick_t pts)
{
+ assert(length > 0);
aout_owner_t *owner = aout_owner (aout);
const audio_sample_format_t *fmt = &owner->mixer_format;
size_t frames = samples_from_vlc_tick(length, fmt->i_rate);
@@ -349,6 +350,7 @@ int aout_DecPlay(audio_output_t *aout, block_t *block)
block->i_length = vlc_tick_from_samples( block->i_nb_samples,
owner->input_format.i_rate );
+ assert(block->i_nb_samples > 0 && block->i_length > 0);
int ret = aout_CheckReady (aout);
if (unlikely(ret == AOUT_DEC_FAILED))
--
2.20.1
More information about the vlc-devel
mailing list