ETCTextureDecompress() internally uses “unsigned long *” to read from the source and write to the dest image with the intent to process 32-bit chunks. Unfortunately, at least on 64-bit OSX, longs are 64-bit values. This leads to reading/writing past the end of the buffers. If you are lucky, it will crash 🙂 If you are not, it will create an image where every odd column of pixels is the 0x00000000 from the high 4 bytes of the 8-byte longs.
This affects PVRTexLib and PVRTDecompress.cpp at least on 64-bit OSX –probably on 64-bit Linux as well.
Anyone using PVRTDecompress.cpp can easily work around the bug by editing the function to use “unsigned int” instead of “unsigned long”.
Thanks for reporting this bug. I noticed this in other areas and have caught it in many other places, but sadly didn’t notice it here! This hasn’t made our next release but I have entered this into our internal bug tracker as high priority (id: BRN34707) and should have it fixed asap.
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.