On Wed, 13 Jun 2007 16:54:33 -0400 Giel van Schijndel
<[EMAIL PROTECTED]> wrote:
>Dennis Schridde schreef:
>>> Index: tex.c
>>>
>===================================================================
>
>>> --- tex.c (revision 1494)
>>> +++ tex.c (working copy)
>>> @@ -264,7 +264,7 @@
>>>
>>> void iV_unloadImage(iV_Image *image)
>>> {
>>> - if (image)
>>> + if (image->bmp)
>>> {
>>> free(image->bmp);
>>> image->bmp = NULL;
>>>
>> The idea of this if was probably to check whether we got passed
>a NULL
>> pointer, not to check whether bmp was allready freed.
>> I don't know what ISO-C says, but I would guess that it is legal
>to call free
>> on a NULL pointer... Am I wrong about this?
>>
>free(NULL) is very much legal yes. It should be similar to a no-
>op. If
>image is NULL however, then you're dereferencing a NULL pointer to
>receive the bmp pointer, which is _not_ legal.
>
The game crash on that line, free(image->bmp).
Since it set to NULL after 1st free call, we can then assume that
image pointer is wrong/corrupted.
So then fix is to find where image is free, and make sure is set to
NULL?
--
Click for dental plans with huge savings, top service and coverage
http://tagline.hushmail.com/fc/CAaCXv1KbKmhmSwUVNYZYFq7GZpiNmcq/
_______________________________________________
Warzone-dev mailing list
[email protected]
https://mail.gna.org/listinfo/warzone-dev