[vlc-devel] [PATCH 2/2] araw: add assertion to check for buffer overrun

Tristan Matthews le.businessman at gmail.com
Tue Nov 12 16:01:40 CET 2013


Refs #9343
---
 modules/codec/araw.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules/codec/araw.c b/modules/codec/araw.c
index 0d5c300..0ec77d8 100644
--- a/modules/codec/araw.c
+++ b/modules/codec/araw.c
@@ -738,8 +738,10 @@ static block_t *Encode( encoder_t *enc, block_t *in )
     if( encode != NULL )
         encode( out->p_buffer, in->p_buffer, in->i_nb_samples
                                              * enc->fmt_out.audio.i_channels );
-    else
+    else {
+        assert( out->i_buffer >= in->i_buffer );
         memcpy( out->p_buffer, in->p_buffer, in->i_buffer );
+    }
     return out;
 }
 
-- 
1.8.1.2




More information about the vlc-devel mailing list