projects
/
platform
/
upstream
/
gst-plugins-bad.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1fee98f
)
gaudi: fix exclusion's factor range
author
Luis de Bethencourt
<luis.bg@samsung.com>
Wed, 22 Apr 2015 13:30:56 +0000
(14:30 +0100)
committer
Luis de Bethencourt
<luis.bg@samsung.com>
Wed, 22 Apr 2015 13:55:33 +0000
(14:55 +0100)
Avoid dividing by zero when the factor is zero. Instead, output a buffer with
all color values as zero.
gst/gaudieffects/gstexclusion.c
patch
|
blob
|
history
diff --git
a/gst/gaudieffects/gstexclusion.c
b/gst/gaudieffects/gstexclusion.c
index
8eaacf1
..
60e9632
100644
(file)
--- a/
gst/gaudieffects/gstexclusion.c
+++ b/
gst/gaudieffects/gstexclusion.c
@@
-270,6
+270,9
@@
transform (guint32 * src, guint32 * dest, gint video_area, gint factor)
guint32 in;
gint x, red, green, blue;
+ if (G_UNLIKELY (factor == 0))
+ return;
+
for (x = 0; x < video_area; x++) {
in = *src++;
@@
-277,6
+280,12
@@
transform (guint32 * src, guint32 * dest, gint video_area, gint factor)
green = (in >> 8) & 0xff;
blue = (in) & 0xff;
+ if (factor == 0) {
+ red = 0;
+ green = 0;
+ blue = 0;
+ }
+
red = factor -
(((factor - red) * (factor - red) / factor) + ((green * red) / factor));
green = factor -