Re: [AD] Zero sized bitmaps |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: alleg-developers@xxxxxxxxxx
- Subject: Re: [AD] Zero sized bitmaps
- From: Matthew Leverton <meffer@xxxxxxxxxx>
- Date: Mon, 22 Aug 2005 15:40:17 -0500
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=RG7hf843fGIjTMXp3kfKV+C2wZVXtzJQNnIBymBuOYcNNk6xRMYe7vhPL4xyp3PnWeIxKF71iDSLvMeFHALP4LMtaJcVDyHGjdrRqrwIIZpY73YgKX/HOjdHOWcHbTWR2xN1Z/1ZRr5HZh3xNi14DW407cnj3O6hyMZ5dO9CkcA=
> on it. Looking at the code, I can't for the life of me figure out why and
> after testing the following programme
>
For me, on MSVC 8, if height is 0 it crashes at
destroy_bitmap()
{
....
free(bitmap);
}
with the message: HEEP CORRUPTION DETECTED: after Normal black (#804)
at 0x01B9ED00. CRT detected that the application wrote to the memory
after end of heap buffer.
If it's simply a MSVC bug, then there's no need to patch.
However, the documentation says:
* The minimum height of the BITMAP must be 1 and width can't be negative
* Return value: Returns a pointer to the created bitmap, or NULL if
the bitmap could not be created.
To me, that implies that a height of 0 cannot be created and will return NULL.
So, I would lean toward your first patch of returning NULL. If nothing
is done, then the documentation should be updated to clarify what is
meant by "cannot be created."
--
Matthew Levertion