[vlc-commits] LPCM: buffer overflow (encoder)

Rémi Denis-Courmont git at videolan.org
Wed Dec 19 19:34:24 CET 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Dec 19 20:32:37 2012 +0200| [f9e094b802622f5fc9143da7331ea9a2f2c99ded] | committer: Rémi Denis-Courmont

LPCM: buffer overflow (encoder)

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

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

diff --git a/modules/codec/lpcm.c b/modules/codec/lpcm.c
index aa36f0c..2ff63a0 100644
--- a/modules/codec/lpcm.c
+++ b/modules/codec/lpcm.c
@@ -464,10 +464,8 @@ static int OpenEncoder( vlc_object_t *p_this )
 
     /* In DVD LCPM, a frame is always 150 PTS ticks. */
     p_sys->i_frame_samples = p_enc->fmt_in.audio.i_rate * 150 / 90000;
-    p_sys->p_buffer = (uint8_t *)malloc(
-        p_sys->i_frame_samples *
-        p_enc->fmt_in.audio.i_channels *
-        p_enc->fmt_in.audio.i_bitspersample);
+    p_sys->p_buffer = xmalloc(p_sys->i_frame_samples
+                            * p_enc->fmt_in.audio.i_channels * 16);
     p_sys->i_buffer_used = 0;
     p_sys->i_frame_num = 0;
 



More information about the vlc-commits mailing list