From: <el...@us...> - 2009-07-02 11:41:48
|
Revision: 12265 http://alleg.svn.sourceforge.net/alleg/?rev=12265&view=rev Author: elias Date: 2009-07-02 11:41:42 +0000 (Thu, 02 Jul 2009) Log Message: ----------- [primitives addon] Fixed a bug where drawing circles with a small radius would crash. Modified Paths: -------------- allegro/branches/4.9/addons/primitives/high_primitives.c Modified: allegro/branches/4.9/addons/primitives/high_primitives.c =================================================================== --- allegro/branches/4.9/addons/primitives/high_primitives.c 2009-07-01 16:09:08 UTC (rev 12264) +++ allegro/branches/4.9/addons/primitives/high_primitives.c 2009-07-02 11:41:42 UTC (rev 12265) @@ -427,8 +427,10 @@ num_segments = ALLEGRO_PRIM_QUALITY * sqrtf((rx + ry) / 2.0f); - /* In case rx and ry are both 0. */ - if (!num_segments) return; + /* In case rx and ry are both close to 0. If al_calculate_arc is passed + * 0 or 1 it will assert. + */ + if (num_segments < 2) return; if (num_segments >= ALLEGRO_VERTEX_CACHE_SIZE) { num_segments = ALLEGRO_VERTEX_CACHE_SIZE - 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |