mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 02:00:12 +01:00
mesa: Check for a negative "size" parameter in glCopyBufferSubData().
From the GL_ARB_copy_buffer spec: "An INVALID_VALUE error is generated if any of readoffset, writeoffset, or size are negative [...]" Fixes oglconform's copybuffer/negative.CNNegativeValues test. NOTE: This is a candidate for stable release branches. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
parent
4a5d020ee3
commit
a75e704326
1 changed files with 6 additions and 0 deletions
|
|
@ -1360,6 +1360,12 @@ _mesa_CopyBufferSubData(GLenum readTarget, GLenum writeTarget,
|
|||
return;
|
||||
}
|
||||
|
||||
if (size < 0) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE,
|
||||
"glCopyBufferSubData(writeOffset = %d)", (int) size);
|
||||
return;
|
||||
}
|
||||
|
||||
if (readOffset + size > src->Size) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE,
|
||||
"glCopyBufferSubData(readOffset + size = %d)",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue