Commit 513d465
committed
Fix plMipmap JPEG decompression using the wrong channel for JPEG alpha
JPEG alpha images store the alpha data in the red channel, but our
decompression code incorrectly extracted the blue channel instead,
leading to corrupted alpha channels for mipmaps with JPEG alpha.
The uncompressed buffers in question are stored in BGRA order in memory,
but the channel extraction/swapping code accesses them as an array of
32-bit ints. From this perspective, on little-endian systems, the buffer
"looks like" ARGB. So to use the red channel as alpha, we need to shift
each 32-bit int 8 bits to the left and mask out the low 24 bits.1 parent 83e9d9f commit 513d465
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
701 | 701 | | |
702 | 702 | | |
703 | 703 | | |
704 | | - | |
| 704 | + | |
705 | 705 | | |
706 | 706 | | |
707 | 707 | | |
| |||
0 commit comments