From 5f634480d1c4ed7711a15d1be07e49177cf351c1 Mon Sep 17 00:00:00 2001 From: Stefano Sabatini Date: Tue, 6 Nov 2012 22:43:51 +0100 Subject: [PATCH] lavfi/showwaves: simplify check in filter_samples() Also fix Coverity issue CID 733743: Dereference after null check --- libavfilter/avf_showwaves.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/avf_showwaves.c b/libavfilter/avf_showwaves.c index 7f058e1747..e5263245f7 100644 --- a/libavfilter/avf_showwaves.c +++ b/libavfilter/avf_showwaves.c @@ -195,7 +195,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples) /* draw data in the buffer */ for (i = 0; i < nb_samples; i++) { - if (showwaves->buf_idx == 0 && showwaves->sample_count_mod == 0) { + if (!outpicref) { showwaves->outpicref = outpicref = ff_get_video_buffer(outlink, AV_PERM_WRITE|AV_PERM_ALIGN, outlink->w, outlink->h);