[vlc-commits] Fix allocation size mismatch (cid #1047373)

Rémi Duraffort git at videolan.org
Sat Jul 13 15:31:25 CEST 2013


vlc/vlc-2.1 | branch: master | Rémi Duraffort <ivoire at videolan.org> | Sat Jul 13 08:52:03 2013 +0200| [d4497ad67f4b11f9a803f4ad6bfc88adda280261] | committer: Jean-Baptiste Kempf

Fix allocation size mismatch (cid #1047373)

(cherry picked from commit 9e4927fcb23f05fac7af9703d1ffb855b7258695)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/codec/flac.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/codec/flac.c b/modules/codec/flac.c
index b964a27..b57c3a4 100644
--- a/modules/codec/flac.c
+++ b/modules/codec/flac.c
@@ -716,10 +716,10 @@ static block_t *Encode( encoder_t *p_enc, block_t *p_aout_buf )
     p_sys->i_samples_delay += p_aout_buf->i_nb_samples;
 
     /* Convert samples to FLAC__int32 */
-    if( p_sys->i_buffer < p_aout_buf->i_buffer * 2 )
+    if( p_sys->i_buffer < p_aout_buf->i_buffer * sizeof(FLAC__int32) )
     {
         p_sys->p_buffer =
-            xrealloc( p_sys->p_buffer, p_aout_buf->i_buffer * 2 );
+            xrealloc( p_sys->p_buffer, p_aout_buf->i_buffer * sizeof(FLAC__int32) );
         p_sys->i_buffer = p_aout_buf->i_buffer * 2;
     }
 



More information about the vlc-commits mailing list