[vlc-devel] [RFC PATH 1/3] decoder: assert if aout format is not prepared

Thomas Guillem thomas at gllm.fr
Wed Sep 21 16:58:54 CEST 2016


---
 src/input/decoder.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index eafc065..25a2f98 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -597,6 +597,9 @@ block_t *decoder_NewAudioBuffer( decoder_t *dec, int samples )
     if( decoder_UpdateAudioFormat( dec ) )
         return NULL;
 
+    assert( dec->fmt_out.audio.i_frame_length > 0
+         && dec->fmt_out.audio.i_bytes_per_frame  > 0 );
+
     size_t length = samples * dec->fmt_out.audio.i_bytes_per_frame
                             / dec->fmt_out.audio.i_frame_length;
     block_t *block = block_Alloc( length );
-- 
2.9.3



More information about the vlc-devel mailing list