aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2014-03-03 17:45:15 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2014-03-04 11:12:54 +0900
commit9ca37bf4d467d60ca5594e6cfa4d35838684821e (patch)
treed247c813dfcb5ed13af4c2b945df8479809927c5
parentEvas filters: fix random cases of 'dancing text' (diff)
downloadefl-9ca37bf4d467d60ca5594e6cfa4d35838684821e.tar.gz
Evas filters: fix clip to target calculation
It was possible to keep negative values for dx,dy which would then draw pixels out of bounds (= crash). Make check crashed after the previous commit. @fix
-rw-r--r--src/lib/evas/filters/evas_filter.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/evas/filters/evas_filter.c b/src/lib/evas/filters/evas_filter.c
index dcfe36ad55..3de3af53f7 100644
--- a/src/lib/evas/filters/evas_filter.c
+++ b/src/lib/evas/filters/evas_filter.c
@@ -1553,6 +1553,7 @@ _clip_to_target(int *sx /* OUT */, int *sy /* OUT */, int sw, int sh,
{
if (ox > 0)
{
+ (*sx) = 0;
(*dx) = ox;
(*cols) = sw;
if (((*dx) + (*cols)) > (dw))
@@ -1560,18 +1561,21 @@ _clip_to_target(int *sx /* OUT */, int *sy /* OUT */, int sw, int sh,
}
else if (ox < 0)
{
+ (*dx) = 0;
(*sx) = (-ox);
(*cols) = sw - (*sx);
if ((*cols) > dw) (*cols) = dw;
}
else
{
+ (*dx) = 0;
(*cols) = sw;
if ((*cols) > dw) (*cols) = dw;
}
if (oy > 0)
{
+ (*sy) = 0;
(*dy) = oy;
(*rows) = sh;
if (((*dy) + (*rows)) > (dh))
@@ -1579,12 +1583,14 @@ _clip_to_target(int *sx /* OUT */, int *sy /* OUT */, int sw, int sh,
}
else if (oy < 0)
{
+ (*dy) = 0;
(*sy) = (-oy);
(*rows) = sh - (*sy);
if ((*rows) > dh) (*rows) = dh;
}
else
{
+ (*dy) = 0;
(*rows) = sh;
if ((*rows) > dh) (*rows) = dh;
}