This fixes an issue where es2::Context::drawElements would still try to read draw data even when there are 0 elements to draw, causing a buffer overflow on draw data. This was found by running Android ES3 dEQP under ASAN. The failing tests are EQP-GLES3.functional.primitive_restart.[begin_restart, begin_restart_duplicate_restarts, begin_restart_end_restart, begin_restart_end_restart_duplicate_restarts, end_restart_duplicate_restarts, duplicate_restarts].* The crashing dEQP tests cover glDrawElementsInstanced, glDrawRangeElements, and glDrawElements. These all converge onto es2::Context::drawElements. Bug: b/123716871 Change-Id: I4bca0616eb9f92bf18a3331459f3dcd06b8ac9a9 Signed-off-by:Cody Schuffelen <schuffelen@google.com> Test: cts-tradefed run commandAndExit cts -m CtsDeqpTestCases --module-arg 'CtsDeqpTestCases:include-filter:dEQP-GLES3.functional.primitive_restart.*' Reviewed-on: https://swiftshader-review.googlesource.com/c/24548 Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com>
| Name |
Last commit
|
Last update |
|---|---|---|
| .vscode | Loading commit data... | |
| build | Loading commit data... | |
| docs | Loading commit data... | |
| extensions | Loading commit data... | |
| include | Loading commit data... | |
| kokoro/gcp_ubuntu | Loading commit data... | |
| src | Loading commit data... | |
| tests | Loading commit data... | |
| third_party | Loading commit data... | |
| .dir-locals.el | Loading commit data... | |
| .gitignore | Loading commit data... | |
| .gitmodules | Loading commit data... | |
| .travis.yml | Loading commit data... | |
| AUTHORS.txt | Loading commit data... | |
| Android.bp | Loading commit data... | |
| Android.mk | Loading commit data... | |
| BUILD.gn | Loading commit data... | |
| CMakeLists.txt | Loading commit data... | |
| CONTRIBUTING.txt | Loading commit data... | |
| CONTRIBUTORS.txt | Loading commit data... | |
| LICENSE.txt | Loading commit data... | |
| OWNERS | Loading commit data... | |
| README.md | Loading commit data... | |
| SwiftShader.sln | Loading commit data... |