The bug was that bitIdx was not being taken into account when we realized that there was enough pixel depth to stay within the current byte when reading pixel values.
This commit is contained in:
Pavel Krajcevski 2013-08-30 18:45:14 -04:00
parent 1cc8f57538
commit ab0dbbfa6e

View file

@ -88,7 +88,7 @@ namespace PVRTCC {
if(0 == depth) {
channel = 0xFF;
} else if(depth + bitIdx < 8) {
channel = bits[byteIdx] & ((1 << depth) - 1);
channel = (bits[byteIdx] >> bitIdx) & ((1 << depth) - 1);
bitIdx += depth;
} else {
const uint32 numLowBits = 8 - bitIdx;