Re: [AD] Zero sized bitmaps

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Evert Glebbeek wrote:
On Tuesday 23 August 2005 00:47, AJ wrote:

what if after you create a 0x1 or 1x0 (which ever it was that was allowed) and you attempt to access the ->line[] will that cause a crash ?

i'd prefer to return NULL for bitmaps 0x1 or 1x0 sized bitmaps.


If it's allowed to create a 0x1 bitmap, then it's allowed. No sense in returning NULL.

But it shouldn't be a problem anyway. You're checking if i<bmp->h before accessing bmp->line[i], right?

yes.
so if bmp->h=1 and i<bmp->h i=0 would be valid, so i would then do line[0][0] and that would crash as there is zero width ?





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/