I fixed it
.
The reason was that the size fo the pixmap needed for colorpicking ( for the glReadPixels) was set to +1 in width and heighth.
I found out that this was done becuase otherwise the game crashed on low resolution.
But why did it crash ? It crashed because of rounding problems resulting in 0x0 or 0x1 or 1x0 size pixmaps which resulted in a crash with opengl....
I now set the selection size to a minimum of 2x2 pixels. So even with rounding errors we get at least 1x1 pixels !
On a side efefct I think exactly this is the reason for random false selects when attacking units with right mouse click, because inside a 0x0 you will never find a unit ! ( but we will see if this is is/was the reason )
So its fixed now and i am happy