st/mesa: fix glCopyPixels bugs/crashes when src region need clipping
authorBrian Paul <brianp@vmware.com>
Wed, 17 Mar 2010 16:06:27 +0000 (10:06 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 17 Mar 2010 16:06:27 +0000 (10:06 -0600)
commit1bfc314596256b039df59f751d59dac82e3ceba1
tree20846471c35be6d876ff647d624a9c49e10b91f8
parentc4922276831528ad2b25acf816ef3f3dfe3211b7
st/mesa: fix glCopyPixels bugs/crashes when src region need clipping

Use the _mesa_clip_readpixels() function to clip the src region against
the buffer's bounds.  Neatly, the resulting pixel unpack object's
SkipPixels/SkipRows fields can be used to determine the position of the
region in the destination texture.

Fixes crash in progs/samples/copy.c and probably other cases.
src/mesa/state_tracker/st_cb_drawpixels.c