[vlc-commits] araw: add assertion to check for buffer overrun

Tristan Matthews git at videolan.org
Tue Nov 12 21:44:52 CET 2013


vlc | branch: master | Tristan Matthews <le.businessman at gmail.com> | Tue Nov 12 10:01:40 2013 -0500| [e9611bff079295beb4f65cc112c6529720233f10] | committer: Rémi Denis-Courmont

araw: add assertion to check for buffer overrun

Refs #9343

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

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

 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;
 }
 



More information about the vlc-commits mailing list