summaryrefslogtreecommitdiff
path: root/libavfilter
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2016-03-05 20:22:35 +0100
committerPaul B Mahol <onemda@gmail.com>2016-03-05 20:22:35 +0100
commitf3c00be2a3ddc38c1851e0cd42de754a54d6af69 (patch)
tree16ddf81e29c7de86b540b81d1fabeef1af287753 /libavfilter
parente0f5f9267a8bc104ec3cefe03873dd2508c46650 (diff)
avfilter/vf_waveform: only use available components
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/vf_waveform.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavfilter/vf_waveform.c b/libavfilter/vf_waveform.c
index fa78264059..a84e3f254d 100644
--- a/libavfilter/vf_waveform.c
+++ b/libavfilter/vf_waveform.c
@@ -1158,7 +1158,7 @@ static int config_output(AVFilterLink *outlink)
if (!s->peak)
return AVERROR(ENOMEM);
- for (p = 0; p < 4; p++) {
+ for (p = 0; p < s->ncomp; p++) {
const int is_chroma = (p == 1 || p == 2);
const int shift_w = (is_chroma ? s->desc->log2_chroma_w : 0);
const int shift_h = (is_chroma ? s->desc->log2_chroma_h : 0);