using the following piece of code :
.
.
/* 8 bit LUT (8 bit color and alpha lookup from palette) */
desc.pixelformat = DSPF_LUT8;
desc.caps = DSCAPS_NONE;
desc.flags = DSDESC_WIDTH |
DSDESC_HEIGHT |
DSDESC_PIXELFORMAT |
DSDESC_PREALLOCATED |
DSDESC_PALETTE;
desc.width = w;
desc.height = h;
desc.preallocated[0].data = &pixelArray[index];
desc.preallocated[0].pitch = scansize;
desc.preallocated[1].data = NULL;
desc.preallocated[1].pitch = 0;
/* swap the palette entries */
for (i = 0; i < length; i++)
{
register unsigned int tmp = rgbArray[i];
rgbArray[i] = (tmp >> 24) |
(tmp << 24) |
((tmp >> 8) & 0x0000ff00) |
((tmp << 8) & 0x00ff0000);
}
desc.palette.entries = (const DFBColor *)rgbArray;
desc.palette.size = length;
err = dfbMain->CreateSurface(dfbMain, &desc, &tempSurf);
.
.
.
a crash appears with a null mutex to lock, and here is the call stack:
0x84c1e8be in mutex_lock (mp=0x0)
0x8489e2a4 in pthread_mutex_lock (mutex=0x8533869c) at
src/contrib/rplposix.c:33
0x84878d06 in dfb_state_lock (state=0x85338690) at src/src/core/state.h:147
0x84878b82 in dfb_state_set_destination (state=0x85338690,
destination=0x85338d1c) at src/src/core/state.c:132
0x848b40c6 in IDirectFBSurface_Construct (thiz=0x85338748, wanted=0x0,
granted=0x0, insets=0x0, surface=0x85338d1c, caps=DSCAPS_NONE) at
src/src/display/idirectfbsurface.c:2241
0x84830c86 in IDirectFB_CreateSurface (thiz=0x855d52e4, desc=0x86417b20,
interface=0x86417b1c) at src/src/idirectfb.c:764
This crash appears only if I restart my program about 10 times (initializing
and deintializing the DFB). and I can't locate who is corrupting the mutex.
does any body have idea about this?
regards.
haithem
_______________________________________________
directfb-users mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users