Closed SpartanJ closed 6 years ago
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: