Fix sign error when decoding bc5s images

Using an unsigned loop counter caused an implicit conversion breaking the decoder logic.
This commit is contained in:
Billy Laws 2023-02-13 11:51:18 +00:00
parent 2d97b9fc2c
commit d93c96de83

View File

@ -131,11 +131,11 @@ namespace {
}
if (c[0] > c[1]) {
for (size_t i = 2; i < 8; ++i) {
for (int i = 2; i < 8; ++i) {
c[i] = ((8 - i) * c[0] + (i - 1) * c[1]) / 7;
}
} else {
for (size_t i = 2; i < 6; ++i) {
for (int i = 2; i < 6; ++i) {
c[i] = ((6 - i) * c[0] + (i - 1) * c[1]) / 5;
}
c[6] = isSigned ? -128 : 0;