For DXT1, only check if 8 bytes are left

This commit is contained in:
Andrew Murray 2025-06-28 00:34:30 +10:00
parent d07aa6fd17
commit e689acfee0

View File

@ -257,9 +257,9 @@ ImagingBcnEncode(Imaging im, ImagingCodecState state, UINT8 *buf, int bytes) {
UINT8 *dst = buf; UINT8 *dst = buf;
int will_write = (n == 2 || n == 3 || n == 5) ? 16 : 8;
for (;;) { for (;;) {
// Loop writes a max of 16 bytes per iteration if (dst + will_write >= bytes + buf) {
if (dst + 16 >= bytes + buf) {
break; break;
} }
if (n == 5) { if (n == 5) {