ebkalderon / renderdoc-rs

RenderDoc application bindings for Rust
Apache License 2.0
45 stars 6 forks source link

Fix undefined behavior and crash in `get_capture` #143

Closed Timbals closed 1 year ago

Timbals commented 1 year ago

There are two issues in the get_capture function

This PR fixes both.

The second issue was causing crashes with STATUS_HEAP_CORRUPTION for me because it did some funky things when trying to de-allocate the CString (I think it double-frees and the second free also uses the wrong layout; didn't look into it more).

I know you're currently rewriting most of the library but I wanted to share this anyway in case anyone else runs into the same crash.