mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-30 11:30:22 +01:00
st/mesa: no-op glCopyPixels if source region is out of bounds
If the source region for a glCopyPixels is completely outside the
source buffer bounds, no-op the copy. Fixes a failed assertion.
NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit 99ed0b2f9b)
This commit is contained in:
parent
7e824b728b
commit
2aaaa18853
1 changed files with 9 additions and 1 deletions
|
|
@ -1543,7 +1543,15 @@ st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy,
|
|||
readY = srcy;
|
||||
readW = width;
|
||||
readH = height;
|
||||
_mesa_clip_readpixels(ctx, &readX, &readY, &readW, &readH, &pack);
|
||||
if (!_mesa_clip_readpixels(ctx, &readX, &readY, &readW, &readH, &pack)) {
|
||||
/* The source region is completely out of bounds. Do nothing.
|
||||
* The GL spec says "Results of copies from outside the window,
|
||||
* or from regions of the window that are not exposed, are
|
||||
* hardware dependent and undefined."
|
||||
*/
|
||||
return;
|
||||
}
|
||||
|
||||
readW = MAX2(0, readW);
|
||||
readH = MAX2(0, readH);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue