bmap_getcolor(bmap_lightmap, color, trace_uv2.x * 1024, trace_uv2.y * 1024);

is your light map 1024x1024 too? hm... not sure why it would crash though since it's supposed to show an error message if a pixel is outside of the image.

can you send me your example?

(of course you can also try to use pixel_for_bmap instead of bmap_getcolor but it will be slower because the bitmap has to be locked/unlocked all the time.)