[FFmpeg-cvslog] avcodec/alsdec: Use av_mallocz_array() for chan_data to ensure the arrays never contain random data

Michael Niedermayer git at videolan.org
Sat May 16 00:16:06 CEST 2015


ffmpeg | branch: release/2.6 | Michael Niedermayer <michaelni at gmx.at> | Sat Apr 18 20:50:23 2015 +0200| [33862c1f6ddc778adf23837e0f4ff7ec363096c9] | committer: Michael Niedermayer

avcodec/alsdec: Use av_mallocz_array() for chan_data to ensure the arrays never contain random data

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 7e104647a3556fc61a139483cee1cb7dfa2dc5bd)

Conflicts:

	libavcodec/alsdec.c

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=33862c1f6ddc778adf23837e0f4ff7ec363096c9
---

 libavcodec/alsdec.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index d9fcb1a..6b4dab1 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -1766,9 +1766,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
 
     // allocate and assign channel data buffer for mcc mode
     if (sconf->mc_coding) {
-        ctx->chan_data_buffer  = av_malloc(sizeof(*ctx->chan_data_buffer) *
+        ctx->chan_data_buffer  = av_mallocz(sizeof(*ctx->chan_data_buffer) *
                                            num_buffers * num_buffers);
-        ctx->chan_data         = av_malloc(sizeof(*ctx->chan_data) *
+        ctx->chan_data         = av_mallocz(sizeof(*ctx->chan_data) *
                                            num_buffers);
         ctx->reverted_channels = av_malloc(sizeof(*ctx->reverted_channels) *
                                            num_buffers);



More information about the ffmpeg-cvslog mailing list