diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-09-07 03:07:34 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-09-07 03:49:01 +0200 |
commit | 64c54f8333dd829ed57a032b93a3cb1323cd0fc4 (patch) | |
tree | a6c167c2b4739f0cddb7ddb238f3999301d55a52 | |
parent | 797762fcf3c5fd8afb84bf89095c79521597913a (diff) | |
download | ffmpeg-64c54f8333dd829ed57a032b93a3cb1323cd0fc4.tar.gz |
avfilter/af_compand: silence "maybe uninitialized" warnings
if channels is 0 it actually would be uninitialized, thus an assert with comment is added
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavfilter/af_compand.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavfilter/af_compand.c b/libavfilter/af_compand.c index 6cbfbf43a1..fda09bb37e 100644 --- a/libavfilter/af_compand.c +++ b/libavfilter/af_compand.c @@ -22,6 +22,7 @@ * */ +#include "libavutil/avassert.h" #include "libavutil/avstring.h" #include "libavutil/opt.h" #include "libavutil/samplefmt.h" @@ -214,9 +215,11 @@ static int compand_delay(AVFilterContext *ctx, AVFrame *frame) AVFilterLink *inlink = ctx->inputs[0]; const int channels = inlink->channels; const int nb_samples = frame->nb_samples; - int chan, i, dindex, oindex, count; + int chan, i, av_uninit(dindex), oindex, av_uninit(count); AVFrame *out_frame = NULL; + av_assert1(channels > 0); /* would corrupt delay_count and delay_index */ + for (chan = 0; chan < channels; chan++) { const double *src = (double *)frame->data[chan]; double *dbuf = (double *)s->delayptrs[chan]; |