[FFmpeg-cvslog] avfilter/af_aecho: silence "maybe uninitialized warning"

Michael Niedermayer git at videolan.org
Sat Sep 7 04:05:31 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Sep  7 03:07:34 2013 +0200| [797762fcf3c5fd8afb84bf89095c79521597913a] | committer: Michael Niedermayer

avfilter/af_aecho: silence "maybe uninitialized warning"

if channels is 0 it actually would be uninitialized, thus an assert with comment is added

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavfilter/af_aecho.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavfilter/af_aecho.c b/libavfilter/af_aecho.c
index e73252b..6795baa 100644
--- a/libavfilter/af_aecho.c
+++ b/libavfilter/af_aecho.c
@@ -190,7 +190,9 @@ static void echo_samples_## name ##p(AudioEchoContext *ctx,                 \
     const double in_gain = ctx->in_gain;                                    \
     const int nb_echoes = ctx->nb_echoes;                                   \
     const int max_samples = ctx->max_samples;                               \
-    int i, j, chan, index;                                                  \
+    int i, j, chan, av_uninit(index);                                       \
+                                                                            \
+    av_assert1(channels > 0); /* would corrupt delay_index */               \
                                                                             \
     for (chan = 0; chan < channels; chan++) {                               \
         const type *s = (type *)src[chan];                                  \



More information about the ffmpeg-cvslog mailing list