GLsizei is historically defined as a 32-bit signed integer, which is not allowed to be negative. But doing arithmetic with them can lead to overflows producing undefined values, including negative ones. Use size_t instead for these image data size calculations. It's defined as an unsigned integer large enough to fit valid memory buffer sizes. In practice that's 32-bit on 32-bit platforms, and 64-bit on 64-bit ones, which is large enough to avoid overflow in the OutOfMemory test. Bug: b/140421004 Change-Id: Id05dd64d470f579455fdc9925b0ab303ecaf37fb Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/36968Tested-by:Nicolas Capens <nicolascapens@google.com> Reviewed-by:
Alexis Hétu <sugoi@google.com>
| Name |
Last commit
|
Last update |
|---|---|---|
| .vscode | Loading commit data... | |
| build | Loading commit data... | |
| build_overrides | Loading commit data... | |
| docs | Loading commit data... | |
| extensions | Loading commit data... | |
| include | 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... | |
| BUILD.gn | Loading commit data... | |
| CMakeLists.txt | Loading commit data... | |
| CMakeSettings.json | 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... |