| Re: [AD] Zero sized bitmaps |
[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]
Chris wrote:
> extra memory for the line[] array). A proper fix (if you don't want to return
> NULL), would simply be:
>
> if (height>0) {
> bitmap->line[0] = bitmap->dat;
> for (i=1; i<height; i++)
> bitmap->line[i] = bitmap->line[i-1] + width *
> BYTES_PER_PIXEL(color_depth);
> }
>
I created a patch from the above code and tested under MSVC 8. It no
longer crashes when destroying 0x0 bitmaps. I don't care which route
is taken, as long as any non NULL bitmap passed back to the user can
be destroyed without a crash. :)
--
Matthew Leverton
Attachment:
graphics.c.diff
Description: Binary data
| Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |