mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-29 16:00:24 +01:00
mesa: Add missing error checks in _mesa_ProgramBinary
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87516
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Leight Bade <leith@mapbox.com>
(cherry picked from commit 201b9c1818)
Conflicts:
src/mesa/main/shaderapi.c
This commit is contained in:
parent
93edf3e7dc
commit
e1b5bc9330
1 changed files with 25 additions and 2 deletions
|
|
@ -1724,8 +1724,31 @@ _mesa_ProgramBinary(GLuint program, GLenum binaryFormat,
|
|||
|
||||
(void) binaryFormat;
|
||||
(void) binary;
|
||||
(void) length;
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, __FUNCTION__);
|
||||
|
||||
/* Section 2.3.1 (Errors) of the OpenGL 4.5 spec says:
|
||||
*
|
||||
* "If a negative number is provided where an argument of type sizei or
|
||||
* sizeiptr is specified, an INVALID_VALUE error is generated."
|
||||
*/
|
||||
if (length < 0) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE, "glProgramBinary(length < 0)");
|
||||
return;
|
||||
}
|
||||
|
||||
/* The ARB_get_program_binary spec says:
|
||||
*
|
||||
* "<binaryFormat> and <binary> must be those returned by a previous
|
||||
* call to GetProgramBinary, and <length> must be the length of the
|
||||
* program binary as returned by GetProgramBinary or GetProgramiv with
|
||||
* <pname> PROGRAM_BINARY_LENGTH. Loading the program binary will fail,
|
||||
* setting the LINK_STATUS of <program> to FALSE, if these conditions
|
||||
* are not met."
|
||||
*
|
||||
* Since any value of binaryFormat passed "is not one of those specified as
|
||||
* allowable for [this] command, an INVALID_ENUM error is generated."
|
||||
*/
|
||||
shProg->LinkStatus = GL_FALSE;
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glProgramBinary");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue