[Gtkradiant] Bug with libs/ddslib/ddslib.c lines 693 to 723 on 64 bit systems.

Forest Hale lordhavoc at ghdigital.com
Thu Jan 17 00:06:23 CST 2008


Ciaran Gillespie wrote:
> On a 64 bit Linux system this function will segfault. It makes Quake 4 level
> editing impossible. GTKRadiant will sometimes segfault when I try to
> selected any of the texture sets. If it does not segfault the textures
> will not look correct, lots of colored artifacts. I debugged it, and
> found the problem spot, but am not skilled enough to fix it.
> 
> It look like the code assumes that both the pointer of unsigned char
> *in, and unsigned char *out will be the same bit size, but in 64 bit I
> believe this is creating the problem.

All pointers are always the same size on a given architecture, the bug is somewhere else (possibly in the dds width/height reading for example?).

Note that sizeof(size_t) is always equal to sizeof(void *), size_t is the correct type to use when pointer-size integer arithmetic is needed.

-- 
LordHavoc
Author of DarkPlaces Quake1 engine and mod
http://icculus.org/twilight/darkplaces/
"War does not prove who is right, it proves who is left." - Unknown
"Any sufficiently advanced technology is indistinguishable from a rigged demo." - James Klass




More information about the Gtkradiant mailing list