veeenu / hudhook

A videogame overlay framework written in Rust, supporting DirectX and OpenGL
MIT License
185 stars 27 forks source link

Bugfix panic in D3D11RenderEngine->restore #184

Closed FrankvdStam closed 5 months ago

FrankvdStam commented 5 months ago

When self.ps_instances is none, self.ps_instances_count is 0, then slice::from_raw_parts causes a panic here. Same for the vs version. Initially I tried this fix with is_some() but it still caused a crash for me.

I don't know if this has any side effects, for me it renders fine after this fix.

FrankvdStam commented 5 months ago

Committed your suggestion and did the same bellow, plus fixed the linting error, tested and it works on remastered.

veeenu commented 5 months ago

Oh, right, CI fails because of the new transmute lint. I'll fix that first and then merge this one, shouldn't need a rebase hopefully.

FrankvdStam commented 5 months ago

This change is so small, I don't think there will be any issues merging