Re: [AD] Zero sized bitmaps

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


On 2005-08-22, Matthew Leverton <meffer@xxxxxxxxxx> wrote:
> 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.

Committed.





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