On 12/16/2013 04:26 PM, Anton Khirnov wrote:
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.
---
  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) {

LGTM

-Justin

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to