|
uint32_t const size = (k * h * d * snl); |
The k value is already the padded size from snl, so shouldn't the size be calculated as size = k * h * d?
For example, if I have a texture with image size of 1024x1024 and four components and a type size of one, then uint32_t const k = ((snl + 3u) & ~3u); will become 4096 and the size: size = 4096 * 1024 * 1 * 4096, which will exceeds the max uint32_t.
tiny_ktx/include/tiny_ktx/tinyktx.h
Line 2054 in 579bae0
The
kvalue is already the padded size fromsnl, so shouldn't the size be calculated assize = k * h * d?For example, if I have a texture with image size of
1024x1024and four components and a type size of one, thenuint32_t const k = ((snl + 3u) & ~3u);will become4096and the size:size = 4096 * 1024 * 1 * 4096, which will exceeds the max uint32_t.