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 |
|---|---|---|
| .. | ||
| Android.mk | Loading commit data... | |
| BUILD.gn | Loading commit data... | |
| Buffer.cpp | Loading commit data... | |
| Buffer.h | Loading commit data... | |
| Context.cpp | Loading commit data... | |
| Context.h | Loading commit data... | |
| Device.cpp | Loading commit data... | |
| Device.hpp | Loading commit data... | |
| Fence.cpp | Loading commit data... | |
| Fence.h | Loading commit data... | |
| Framebuffer.cpp | Loading commit data... | |
| Framebuffer.h | Loading commit data... | |
| IndexDataManager.cpp | Loading commit data... | |
| IndexDataManager.h | Loading commit data... | |
| Program.cpp | Loading commit data... | |
| Program.h | Loading commit data... | |
| Query.cpp | Loading commit data... | |
| Query.h | Loading commit data... | |
| Renderbuffer.cpp | Loading commit data... | |
| Renderbuffer.h | Loading commit data... | |
| ResourceManager.cpp | Loading commit data... | |
| ResourceManager.h | Loading commit data... | |
| Sampler.h | Loading commit data... | |
| Shader.cpp | Loading commit data... | |
| Shader.h | Loading commit data... | |
| Texture.cpp | Loading commit data... | |
| Texture.h | Loading commit data... | |
| TransformFeedback.cpp | Loading commit data... | |
| TransformFeedback.h | Loading commit data... | |
| VertexArray.cpp | Loading commit data... | |
| VertexArray.h | Loading commit data... | |
| VertexDataManager.cpp | Loading commit data... | |
| VertexDataManager.h | Loading commit data... | |
| entry_points.cpp | Loading commit data... | |
| entry_points.h | Loading commit data... | |
| libGLESv2.cpp | Loading commit data... | |
| libGLESv2.def | Loading commit data... | |
| libGLESv2.hpp | Loading commit data... | |
| libGLESv2.lds | Loading commit data... | |
| libGLESv2.rc | Loading commit data... | |
| libGLESv2.vcxproj | Loading commit data... | |
| libGLESv2.vcxproj.filters | Loading commit data... | |
| libGLESv3.cpp | Loading commit data... | |
| main.cpp | Loading commit data... | |
| main.h | Loading commit data... | |
| mathutil.h | Loading commit data... | |
| resource.h | Loading commit data... | |
| utilities.cpp | Loading commit data... | |
| utilities.h | Loading commit data... |