Commit c6456599 authored by Paul B Mahol's avatar Paul B Mahol

lavfi/showwaves: fix crash in case of negative linesize

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 32d46412
......@@ -188,7 +188,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
(AVRational){ 1, inlink->sample_rate },
outlink->time_base);
linesize = outpicref->linesize[0];
memset(outpicref->data[0], 0, showwaves->h*linesize);
for (j = 0; j < outlink->h; j++)
memset(outpicref->data[0] + j * linesize, 0, outlink->w);
}
for (j = 0; j < nb_channels; j++) {
h = showwaves->h/2 - av_rescale(*p++, showwaves->h/2, MAX_INT16);
......
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