Problem using gdk-pixbuf



I wrote this simple test program.

-----------------------------------------------------------------
#include <gdk-pixbuf/gdk-pixbuf.h>

static char * pacman_xpm[] = {
"12 12 3 1",
"       c None",
".      c #000000",
"+      c #FFFFFF",
"++++....++++",
"++........++",
"+........+++",
"+...+...++++",
".......+++++",
"......++++++",
"......++++++",
".......+++++",
"+.......++++",
"+........+++",
"++........++",
"++++....++++"};

int main() {
        GdkPixbuf *pacman = gdk_pixbuf_new_from_xpm_data(pacman_xpm);
}
------------------------------------------------------------------

The pacman_xpm was generated by The Gimp. When I run this, it segfaults.
Here is the backtrace.

------------------------------------------------------------------
Program received signal SIGSEGV, Segmentation fault.
0x40183676 in gdk_color_parse (spec=0x8049968 "#000000", color=0x804a6e8)
    at gdkcolor.c:549
549	gdkcolor.c: No such file or directory.
(gdb) bt
#0  0x40183676 in gdk_color_parse (spec=0x8049968 "#000000", color=0x804a6e8)
    at gdkcolor.c:549
#1  0x400163ad in pixbuf_create_from_xpm (get_buf=0x40016190 <mem_buffer>, 
    handle=0xbffff760) at io-xpm.c:373
#2  0x40016670 in gdk_pixbuf__xpm_image_load_xpm_data (data=0x80497b4)
    at io-xpm.c:462
#3  0x4001ea10 in gdk_pixbuf_new_from_xpm_data (data=0x80497b4)
    at gdk-pixbuf-io.c:482
#4  0x80486af in main () at test.c:22
------------------------------------------------------------------

What's wrong?

	= L

/-------------------------------------------------------------------\
|   LOBAN AMAAN RAHMAN  <-- anagram of -->  AHA! AN ABNORMAL MAN!   |
|  MSC #763, Caltech, Pasadena, CA 91126, USA. Tel: 1-626-395-1407  |
|     loban@earthling.net, loban@caltech.edu, http://i.am/loban     |
\-------------------------------------------------------------------/




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]