From: acidx Date: Thu, 30 Sep 2010 21:31:00 +0000 (+0000) Subject: edje_cc: Bail out on descriptions without a state. X-Git-Tag: submit/trunk/20120815.180907~872 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=347e8f6ddc823518fd61db7fc8345f6547d52572;p=profile%2Fivi%2Fedje.git edje_cc: Bail out on descriptions without a state. Also, don't dereference a NULL pointer on badly-formed .edj files. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@52931 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/bin/edje_cc_out.c b/src/bin/edje_cc_out.c index b1e2468..ecaaa40 100644 --- a/src/bin/edje_cc_out.c +++ b/src/bin/edje_cc_out.c @@ -187,17 +187,27 @@ check_packed_items(Edje_Part_Collection *pc, Edje_Part *ep, Eet_File *ef) } static void +check_nameless_state(Edje_Part_Collection *pc, Edje_Part *ep, Edje_Part_Description_Common *ed, Eet_File *ef) +{ + if (!ed->state.name) + error_and_abort(ef, "Collection %i: description with state missing on part \"%s\"\n", + pc->id, ep->name); +} + +static void check_part (Edje_Part_Collection *pc, Edje_Part *ep, Eet_File *ef) { + unsigned int i; /* FIXME: check image set and sort them. */ if (!ep->default_desc) error_and_abort(ef, "Collection %i: default description missing " "for part \"%s\"\n", pc->id, ep->name); + for (i = 0; i < ep->other.desc_count; ++i) + check_nameless_state(pc, ep, ep->other.desc[i], ef); + if (ep->type == EDJE_PART_TYPE_IMAGE) { - unsigned int i; - check_image_part_desc(pc, ep, (Edje_Part_Description_Image*) ep->default_desc, ef); for (i = 0; i < ep->other.desc_count; ++i)