Skip to content

Commit 45a921e

Browse files
committed
[visualization] Access to a potential null pointer in interactor_style (#5503)
Within the OnKeyDown method of PCLVisualizerInteractorStyle, the pointer to the currentRenderer is tested for null then it is used to render outside the scope of the test. The rendering is now done only if the pointer is not null.
1 parent 2f14bf5 commit 45a921e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

visualization/src/interactor_style.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1050,11 +1050,14 @@ pcl::visualization::PCLVisualizerInteractorStyle::OnKeyDown ()
10501050
{
10511051
FindPokedRenderer(Interactor->GetEventPosition ()[0], Interactor->GetEventPosition ()[1]);
10521052
if(CurrentRenderer)
1053+
{
10531054
CurrentRenderer->ResetCamera ();
1055+
CurrentRenderer->Render ();
1056+
}
10541057
else
1058+
{
10551059
PCL_WARN ("no current renderer on the interactor style.\n");
1056-
1057-
CurrentRenderer->Render ();
1060+
}
10581061
break;
10591062
}
10601063

0 commit comments

Comments
 (0)