summaryrefslogtreecommitdiffstats
path: root/libavfilter/avf_showwaves.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2013-04-29 13:36:59 +0000
committerPaul B Mahol <onemda@gmail.com>2013-04-29 19:28:12 +0000
commitc645659988af1208e83ba4a8a708bb7ea31d0f41 (patch)
tree1324dcd3105f37fab9402335e594030a6942ccfb /libavfilter/avf_showwaves.c
parent32d464121959389bd266abe232896da09bbf2bd5 (diff)
downloadffmpeg-streaming-c645659988af1208e83ba4a8a708bb7ea31d0f41.zip
ffmpeg-streaming-c645659988af1208e83ba4a8a708bb7ea31d0f41.tar.gz
lavfi/showwaves: fix crash in case of negative linesize
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavfilter/avf_showwaves.c')
-rw-r--r--libavfilter/avf_showwaves.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavfilter/avf_showwaves.c b/libavfilter/avf_showwaves.c
index 5e89146..e9d3062 100644
--- a/libavfilter/avf_showwaves.c
+++ b/libavfilter/avf_showwaves.c
@@ -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);
OpenPOWER on IntegriCloud