summaryrefslogtreecommitdiff
path: root/libavfilter
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2015-06-02 18:48:32 +0000
committerPaul B Mahol <onemda@gmail.com>2015-06-02 18:48:32 +0000
commitac973926b8c77087f1d0c2bb57ba3d5c767a784e (patch)
tree6db0fb773ca85079e6d68e73e8f42c7ecbe5a49b /libavfilter
parentd5db4a7c231975af003de81cf884808da536bc07 (diff)
avfilter/vf_blend: clip result for divide blend mode
Pointed-out-by: Rudolf Polzer Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/vf_blend.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavfilter/vf_blend.c b/libavfilter/vf_blend.c
index 5fe704610d..49711acbcb 100644
--- a/libavfilter/vf_blend.c
+++ b/libavfilter/vf_blend.c
@@ -203,7 +203,7 @@ DEFINE_BLEND(overlay, (A < 128) ? MULTIPLY(2, A, B) : SCREEN(2, A, B))
DEFINE_BLEND(hardlight, (B < 128) ? MULTIPLY(2, B, A) : SCREEN(2, B, A))
DEFINE_BLEND(darken, FFMIN(A, B))
DEFINE_BLEND(lighten, FFMAX(A, B))
-DEFINE_BLEND(divide, ((float)A / ((float)B) * 255))
+DEFINE_BLEND(divide, av_clip_uint8(((float)A / ((float)B) * 255)))
DEFINE_BLEND(dodge, DODGE(A, B))
DEFINE_BLEND(burn, BURN(A, B))
DEFINE_BLEND(softlight, (A > 127) ? B + (255 - B) * (A - 127.5) / 127.5 * (0.5 - FFABS(B - 127.5) / 255): B - B * ((127.5 - A) / 127.5) * (0.5 - FFABS(B - 127.5)/255))