You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
C3D_BindProgram stores the passed-in pointer to a shader::Program in the C3D context. Currently, bind_program takes a reference to a Program, meaning that it's possible to pass in a Program that is dropped before the context attempts to use it (at the end of the frame, when it's rendered). This leads to a use-after-free and generally a crash.
This can be avoided by the Instance taking ownership of the passed-in Program, and storing it in some kind of data type that can be Pinned.
The text was updated successfully, but these errors were encountered:
C3D_BindProgram
stores the passed-in pointer to ashader::Program
in the C3D context. Currently,bind_program
takes a reference to aProgram
, meaning that it's possible to pass in aProgram
that is dropped before the context attempts to use it (at the end of the frame, when it's rendered). This leads to a use-after-free and generally a crash.This can be avoided by the
Instance
taking ownership of the passed-inProgram
, and storing it in some kind of data type that can bePin
ned.The text was updated successfully, but these errors were encountered: