mitsuba-renderer / mitsuba3

Mitsuba 3: A Retargetable Forward and Inverse Renderer
https://www.mitsuba-renderer.org/
Other
2.1k stars 246 forks source link

Fix unique_ptr type for stream read #1273

Closed dvicini closed 3 months ago

dvicini commented 3 months ago

Minor change to switch to std::unique_ptr<char[]> in the stream bindings. The current code produces undefined behavior by using std::unique_ptr<char> tmp(new char[size]);. This causes a mismatch between new[] and delete (without []) operators