[FFmpeg-cvslog] audio_mix: initialize the data pointers to NULL

Anton Khirnov git at videolan.org
Sat Jan 4 02:17:54 CET 2014


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Mon Dec 16 18:20:41 2013 +0100| [3d95d27376e59de14f984e7a22a52e066d85df35] | committer: Anton Khirnov

audio_mix: initialize the data pointers to NULL

This should make it easier to catch problems where some of those
pointers are used uninitialized, since reading from NULL should always
crash, while random numbers from stack can turn out to be valid
pointers, so random memory may be silently overwritten.

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

 libavresample/audio_mix.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavresample/audio_mix.c b/libavresample/audio_mix.c
index 073609e..765bc73 100644
--- a/libavresample/audio_mix.c
+++ b/libavresample/audio_mix.c
@@ -447,7 +447,7 @@ int ff_audio_mix(AudioMix *am, AudioData *src)
 
     if (am->in_matrix_channels && am->out_matrix_channels) {
         uint8_t **data;
-        uint8_t *data0[AVRESAMPLE_MAX_CHANNELS];
+        uint8_t *data0[AVRESAMPLE_MAX_CHANNELS] = { NULL };
 
         if (am->out_matrix_channels < am->out_channels ||
              am->in_matrix_channels <  am->in_channels) {



More information about the ffmpeg-cvslog mailing list