DescentDevelopers / Descent3

Descent 3 by Outrage Entertainment
GNU General Public License v3.0
2.73k stars 231 forks source link

Fix crash in DumpTextToClipboard() #458

Closed pzychotic closed 1 week ago

pzychotic commented 1 week ago

Pull Request Type

Description

SetClipboardData() expects its second parameter to be allocated with the GMEM_MOVEABLE flag (see here) and will call GlobalSize() on it internally, so we can't replace it with a plain malloc. Also the assignment of h_text to ptr was missing, and GlobalUnlock() was still called on h_text even after the change to malloc.

Related Issues

Regression introduced in c41c3a7 by #436.

Screenshots (if applicable)

Checklist

Additional Comments