#31 Map screenshot crashes xqf.


Not sure if you've seen this bug report.


I'll post the most important parts from there.

"XQF will crash when you try to display screenshots. What xqf should do is pop up a 320x240 or so screen that displays the level screenshot for any map that doesn't have a red dash next to it. To display it, press and hold left mouse button on a map name. It should pop up.

What currently happens is that it crashes. Sometimes it will crash the first time you try it. Other times it will crash the second time you do it. The crash isn't always the same traceback. There are 3 different tracebacks that I have seen. I think the double free is the most useful because if you remove that call, you can load any map's level shot fine."

--- xqf-1.0.4/src/tga/memtopixmap.c 2005-09-12 09:44:52.000000000 -0400
+++ xqf-1.0.4.changed/src/tga/memtopixmap.c 2006-10-07 19:21:40.000000000 -0400
@@ -91,7 +91,6 @@ GdkPixbuf* renderMemToPixbuf(const gucha
unsigned h = 0, w = 0;
unsigned char* data;
- g_free(loader);
loader = NULL;

data = LoadTGA(mem, len, &w, &h);
@@ -113,7 +112,6 @@ GdkPixbuf* renderMemToPixbuf(const gucha
pixbuf = gdk_pixbuf_loader_get_pixbuf(loader);
- g_free(loader);

return pixbuf;


  • Ludwig Nussel

    Ludwig Nussel - 2007-01-06

    Logged In: YES
    Originator: NO

    a fix is in cvs, please test

  • Ludwig Nussel

    Ludwig Nussel - 2007-01-06
    • status: open --> closed-fixed
  • Nobody/Anonymous

    Logged In: NO

    I don't think the fix in CVS is the right fix.

    Instead of gtk_object_unref (which is deprecated), use g_object_unref(loader) without the cast to GTK_OBJECT.

    When I use the code in CVS, I get 2 errors about bad cast from pixbuf to object. When I use g_object_unref(loader) in both places, I don't see any errors.


Log in to post a comment.