ATI, ARB_shadow + EXT_texture_rectangle

There seems to be an issue with ATI+ARB_depth_texture+EXT_texture rectangle.
I always get an error when doing the following:

glBindTexture(GL_TEXTURE_RECTANGLE_EXT, this->depthtextureid);
glEnable(GL_TEXTURE_RECTANGLE_EXT);
glTexParameteri(GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_RECTANGLE_EXT, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glCopyTexImage2D(GL_TEXTURE_RECTANGLE_EXT, 0, GL_DEPTH_COMPONENT24, 0, 0, canvassize[0], canvassize[1], 0);

The last line triggers a 1282 error (INVALID_OPERATION) which indicates that the copying was done inside a glBegin/glEnd pair. This is done during initialization, so this is not the issue. OGL context has a 24 bit zbuffer.

Are there some issues with ATI which I have overlooked?

I must add that I am using a Radeon 9600 on windows XP.

[This message has been edited by Oystein (edited 12-17-2003).]

I have the same experience on an ATI 9700 card.
The platform I use is linux. The driver is not the latest. (2.9.6)

You have to use power-of-two texture in order to get it to work.