lavfi/showwaves: simplify check in filter_samples()
authorStefano Sabatini <stefasab@gmail.com>
Tue, 6 Nov 2012 21:43:51 +0000 (22:43 +0100)
committerStefano Sabatini <stefasab@gmail.com>
Tue, 6 Nov 2012 21:48:17 +0000 (22:48 +0100)
Also fix Coverity issue CID 733743: Dereference after null check

libavfilter/avf_showwaves.c

index 7f058e1..e526324 100644 (file)
@@ -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);