summaryrefslogtreecommitdiff
path: root/libavfilter/vf_histeq.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2013-04-17 00:21:17 +0000
committerPaul B Mahol <onemda@gmail.com>2013-04-17 00:24:16 +0000
commitb8edf91657ad9fa2f0c5175c9ca8fbe3c8b0c624 (patch)
tree5facc4726afc888ffcf21c4e2c738e3f2294056e /libavfilter/vf_histeq.c
parent161dee43213dafee0f7d969320fc4bc5318ba68d (diff)
lavfi/histeq: fix out of array write
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavfilter/vf_histeq.c')
-rw-r--r--libavfilter/vf_histeq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavfilter/vf_histeq.c b/libavfilter/vf_histeq.c
index 7d68be7c36..33cddaadbe 100644
--- a/libavfilter/vf_histeq.c
+++ b/libavfilter/vf_histeq.c
@@ -235,7 +235,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpic)
dst[x + histeq->rgba_map[R]] = r;
dst[x + histeq->rgba_map[G]] = g;
dst[x + histeq->rgba_map[B]] = b;
- oluma = (55 * r + 182 * g + 19 * b) >> 8;
+ oluma = av_clip_uint8((55 * r + 182 * g + 19 * b) >> 8);
histeq->out_histogram[oluma]++;
}
}