From: ChunEon Park Date: Tue, 15 Jan 2013 05:11:11 +0000 (+0000) Subject: evas/map - avoid zero divide. X-Git-Tag: submit/devel/efl/20131022.203902~2257 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e078614a33634252b9cf3291519097232a1fc4bc;p=platform%2Fupstream%2Fefl.git evas/map - avoid zero divide. SVN revision: 82792 --- diff --git a/src/lib/evas/canvas/evas_map.c b/src/lib/evas/canvas/evas_map.c index 3358b97..348582f 100644 --- a/src/lib/evas/canvas/evas_map.c +++ b/src/lib/evas/canvas/evas_map.c @@ -1227,7 +1227,7 @@ evas_object_map_update(Evas_Object *eo_obj, p = obj->cur.map->points; p_end = p + obj->cur.map->count; pt = pts; - + pts[0].px = obj->cur.map->persp.px << FP; pts[0].py = obj->cur.map->persp.py << FP; pts[0].foc = obj->cur.map->persp.foc << FP; @@ -1241,8 +1241,10 @@ evas_object_map_update(Evas_Object *eo_obj, pt->fx = p->px; pt->fy = p->py; pt->fz = p->z; - pt->u = ((lround(p->u) * imagew) / uvw) * FP1; - pt->v = ((lround(p->v) * imageh) / uvh) * FP1; + if (uvw == 0) pt->u = 0; + else pt->u = ((lround(p->u) * imagew) / uvw) * FP1; + if (uvh == 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); if (pt->v < 0) pt->v = 0;