Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plMipmap::CompressImage Buffer Overrun #46

Open
Hoikas opened this issue Jul 13, 2014 · 0 comments
Open

plMipmap::CompressImage Buffer Overrun #46

Hoikas opened this issue Jul 13, 2014 · 0 comments

Comments

@Hoikas
Copy link
Member

Hoikas commented Jul 13, 2014

plMipmap::CompressImage (squish) appears to overrun the image data buffer when compressing a DXT5 mip level of 1x1. In most cases, this does not appear to crash on Windows x64. However, I have observed a few scenarios where the MSVCRT detects this overrun on deleting the image data, crashing the application. Specifically, using a 160x160 JPEG that was resized to 128x128 in Blender (the image buffer I provide is RGBA). This behavior can be debugged by using the Windows Debug Toolkit's gflags.exe /p /enable <appname.exe>.

AFAICT our level size calculation is only allocating enough buffer for the alpha block in, so when squish tries to write the color block, it corrupts the heap.

A potentially related issue: when exporting a DDS from PRPShop and attempting to import the same DDS yields a read-past-eof error. PRPShop consistently requests 12 more bytes than is available in the stream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant