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

Thomas Guillem thomas at gllm.fr
Thu Sep 22 10:20:45 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 16f439a..201cc19 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -592,6 +592,9 @@ static int DecoderGetDisplayRate( decoder_t *p_dec )
  *****************************************************************************/
 block_t *decoder_NewAudioBuffer( decoder_t *dec, int samples )
 {
+    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