-
Notifications
You must be signed in to change notification settings - Fork 75
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
SOIL_save_screenshot heap corruption #19
Comments
Original comment by Terry Russell (Bitbucket: xsensordev, ). Certainly, no problem. |
Original comment by Terry Russell (Bitbucket: xsensordev, ). Glad to help. Though I notice you've selected the GL_UNPACK_ALIGNMENT instead of the GL_PACK_ALIGNMENT. Changing the GL_PACK_ALIGNMENT to 1 (from 4) was definitely the change I needed to prevent a heap corruption. I tested setting only the GL_UNPACK_ALIGNMENT and was still corrupting the heap when my window width was an odd value due to user re-sizing (ie: 807x423). This was with the latest nvidia drivers on Windows 10. Perhaps both should be set to 1? -Terry |
Original comment by Terry Russell (Bitbucket: xsensordev, ). Looks good. Thanks for maintaining this useful library! |
Original report by Anonymous.
Hi,
I've found the glReadPixels call in the SOIL_save_screenshot function occasionally corrupts the heap (depending on odd screen dimensions).
I believe its due to the GL_PACK_ALIGNMENT not being set. My fix is to surround the glReadPixels call with the following:
The text was updated successfully, but these errors were encountered: