Commit 64c54f83 authored by Michael Niedermayer's avatar Michael Niedermayer

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: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 797762fc
......@@ -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];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment