Am Mittwoch, 13. Juni 2007 schrieb [EMAIL PROTECTED]:
> 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?
So the problem is not that image->bmp is already freed, but that image was
freed somewhere before we want to free image->bmp?
That's ugly and should be fixed, instead of checking for bmp being null...Can you please provide a backtrace or tell us who tried to unload an image twice? Besides that: frameresource.c:667 might be the cause and should be investigated. --Dennis
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Warzone-dev mailing list [email protected] https://mail.gna.org/listinfo/warzone-dev
