diff options
| author | bohu <bohu@google.com> | 2014-10-28 17:53:04 -0700 |
|---|---|---|
| committer | bohu <bohu@google.com> | 2014-10-28 17:54:30 -0700 |
| commit | c4966e0ad3faa046c293f855e48e8125d6fcd8d0 (patch) | |
| tree | 232ec5f14391b38a7b7331f7c6c882101f42ba54 /emulator | |
| parent | cf7e8c7948b3b811a6693ac871d2578a2bdf0a46 (diff) | |
| download | sdk-c4966e0ad3faa046c293f855e48e8125d6fcd8d0.tar.gz sdk-c4966e0ad3faa046c293f855e48e8125d6fcd8d0.tar.bz2 sdk-c4966e0ad3faa046c293f855e48e8125d6fcd8d0.zip | |
Validate glClear mask
The mask should only be a combination of GL_DEPTH_BUFFER_BIT,
GL_COLOR_BUFFER_BIT, and GL_STENCIL_BUFFER_BIT
Change-Id: Ic448bd33a9bf0dc50db4298a53e96dd128fd110c
Diffstat (limited to 'emulator')
| -rw-r--r-- | emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp b/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp index fe64f6f43..16534c179 100644 --- a/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp +++ b/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp @@ -323,6 +323,9 @@ GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus(GLenum target){ GL_APICALL void GL_APIENTRY glClear(GLbitfield mask){ GET_CTX(); + GLbitfield allowed_bits = GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT; + GLbitfield has_disallowed_bits = (mask & ~allowed_bits); + SET_ERROR_IF(has_disallowed_bits, GL_INVALID_VALUE); ctx->drawValidate(); ctx->dispatcher().glClear(mask); |
