[vlc-commits] decoder: assert if aout format is not prepared

Thomas Guillem git at videolan.org
Mon Sep 26 17:13:32 CEST 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Sep 21 16:45:33 2016 +0200| [a70366e67fdbfa9d254bb675fc662184bf793f7c] | committer: Thomas Guillem

decoder: assert if aout format is not prepared

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a70366e67fdbfa9d254bb675fc662184bf793f7c
---

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

diff --git a/src/input/decoder.c b/src/input/decoder.c
index 98f5211..62f7bde 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -594,6 +594,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 );



More information about the vlc-commits mailing list