Skip to content

Fix overflow when texture size is smaller than block size #2949

Fix overflow when texture size is smaller than block size

Fix overflow when texture size is smaller than block size #2949

Triggered via pull request December 11, 2024 13:21
Status Failure
Total duration 1m 14s
Artifacts

ci.yml

on: pull_request
Commit message check
6s
Commit message check
Code formatting check
1m 2s
Code formatting check
Baseline cmake check
0s
Baseline cmake check
Documentation Build
0s
Documentation Build
Android
0s
Android
Matrix: Linux
Matrix: Mac
Matrix: Windows
Fit to window
Zoom out
Zoom in

Annotations

2 errors
Code formatting check
clang-format issues were found. See CONTRIBUTING.md for more information. diff --git a/renderdoc/driver/gl/wrappers/gl_texture_funcs.cpp b/renderdoc/driver/gl/wrappers/gl_texture_funcs.cpp index 6d95bb0..b99594a 100644 --- a/renderdoc/driver/gl/wrappers/gl_texture_funcs.cpp +++ b/renderdoc/driver/gl/wrappers/gl_texture_funcs.cpp @@ -3813,7 +3813,9 @@ void WrappedOpenGL::StoreCompressedTexData(ResourceId texId, GLenum target, GLin // GetCompressedByteSize() will factor in the 'partial' blocks at image edges when the // image size is not an integer multiple of the block size, so we need to take into // account that in the loop - size_t roundedUpHeight = (uint32_t)height < blockSize[1] ? (uint32_t)height : AlignUp((uint32_t)height, blockSize[1]); + size_t roundedUpHeight = (uint32_t)height < blockSize[1] + ? (uint32_t)height + : AlignUp((uint32_t)height, blockSize[1]); for(size_t y = 0; y < roundedUpHeight; y += blockSize[1]) { memcpy(cdData.data() + dstOffset, srcPixels + srcOffset, srcRowSize);
Code formatting check
Process completed with exit code 1.