hermet pushed a commit to branch master.
commit b660465410952a1a7c5fe9f9aad23ef6d63460a2
Author: ChunEon Park <[email protected]>
Date: Sat Apr 13 18:58:08 2013 +0900
evas - Don't be crashed even if the map image size is 0.
---
ChangeLog | 4 ++++
NEWS | 1 +
src/lib/evas/canvas/evas_map.c | 4 ++--
3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 674f65d..a7c165d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-04-13 ChunEon Park
+
+ * Evas: Don't be crashed even if the map image size is 0.
+
2013-04-13 Jihoon Kim
* Ecore_IMF: Add ecore_imf_input_panel_hide () API
diff --git a/NEWS b/NEWS
index f49c5a2..f5f3ce4 100644
--- a/NEWS
+++ b/NEWS
@@ -237,3 +237,4 @@ Fixes:
* Evas font: Fix a bug with cluster size calculation with texts ending
with ligatures.
* Edje entry: When cursor is located to each edge, entry now doesn't grab
events for cursor movement.
+ * Evas map: don't be crashed even if image size is 0.
diff --git a/src/lib/evas/canvas/evas_map.c b/src/lib/evas/canvas/evas_map.c
index 5985a73..66c691a 100644
--- a/src/lib/evas/canvas/evas_map.c
+++ b/src/lib/evas/canvas/evas_map.c
@@ -1332,9 +1332,9 @@ evas_object_map_update(Evas_Object *eo_obj,
pt->fx = p->px;
pt->fy = p->py;
pt->fz = p->z;
- if (uvw == 0) pt->u = 0;
+ if ((uvw == 0) || (imagew == 0)) pt->u = 0;
else pt->u = ((lround(p->u) * imagew) / uvw) * FP1;
- if (uvh == 0) pt->v = 0;
+ if ((uvh == 0) || (imageh == 0)) pt->v = 0;
else pt->v = ((lround(p->v) * imageh) / uvh) * FP1;
if (pt->u < 0) pt->u = 0;
else if (pt->u > (imagew * FP1)) pt->u = (imagew * FP1);
--
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter