Skip to content

Commit

Permalink
fix: crash when trying to access shape2DBufInfo buffers when using st…
Browse files Browse the repository at this point in the history
…ereo 3D modes
  • Loading branch information
emawind84 committed Jun 14, 2024
1 parent c080e18 commit 4115024
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/rendering/hwrenderer/hw_draw2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ void Draw2D(F2DDrawer* drawer, FRenderState& state, int x, int y, int width, int
state.EnableTexture(false);
}

if (cmd.shape2DBufInfo != nullptr)
if (cmd.shape2DBufInfo != nullptr && cmd.shape2DBufInfo->bufIndex != -1)
{
state.SetVertexBuffer(&cmd.shape2DBufInfo->buffers[cmd.shape2DBufIndex]);
state.DrawIndexed(DT_Triangles, 0, cmd.shape2DIndexCount);
Expand Down

0 comments on commit 4115024

Please sign in to comment.