Skip to content

Commit 07e972b

Browse files
committed
Fix null pointer error in a cube template
The first parameter of four parameter method generateRotationMatrix33 expects a pointer to a Matrix33. When a 0 is passed, it is interpreted as a null pointer that is later dereferenced to set the matrix and that causes an error.
1 parent 285eec3 commit 07e972b

File tree

1 file changed

+1
-1
lines changed
  • tools/vscode-extension/templates/psyqo/cube

1 file changed

+1
-1
lines changed

tools/vscode-extension/templates/psyqo/cube/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ void CubeScene::frame() {
125125
psyqo::SoftMath::multiplyMatrix33(transform, rot, &transform);
126126

127127
// Generate a Z-axis rotation matrix (Empty, but it's here for your use)
128-
psyqo::SoftMath::generateRotationMatrix33(0, 0, psyqo::SoftMath::Axis::Z, cube.m_trig);
128+
psyqo::SoftMath::generateRotationMatrix33(&rot, 0, psyqo::SoftMath::Axis::Z, cube.m_trig);
129129

130130
// Apply the combined rotation and write it to the pseudo register for the cube's rotation
131131
psyqo::SoftMath::multiplyMatrix33(transform, rot, &transform);

0 commit comments

Comments
 (0)