From 50d21ce53601e97320ad1410f8e4f7275e9b4f5b Mon Sep 17 00:00:00 2001 From: Adeel Arshad Date: Mon, 17 Oct 2016 17:39:12 +0500 Subject: [PATCH] Examples/AMDTTeaPot: fix a null pointer exception Check that whether _pAMDTTeapotOGLCanvas is initialized or not before calling it method onSize, otherwise it will generate NULL pointer exception or segmentation fault. Signed-off-by: Adeel Arshad --- CodeXL/Examples/AMDTTeaPot/AMDTTeaPot/src/GLWindow.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CodeXL/Examples/AMDTTeaPot/AMDTTeaPot/src/GLWindow.cpp b/CodeXL/Examples/AMDTTeaPot/AMDTTeaPot/src/GLWindow.cpp index d2755a2..4c7f6fa 100755 --- a/CodeXL/Examples/AMDTTeaPot/AMDTTeaPot/src/GLWindow.cpp +++ b/CodeXL/Examples/AMDTTeaPot/AMDTTeaPot/src/GLWindow.cpp @@ -127,7 +127,10 @@ void GLWindow::draw() // void GLWindow::resize(int X, int Y, int W, int H) { - _pAMDTTeapotOGLCanvas->onSize(W, H); + if (NULL != _pAMDTTeapotOGLCanvas) + { + _pAMDTTeapotOGLCanvas->onSize(W, H); + } swap_buffers(); Fl_Gl_Window::resize(X, Y, W, H); } -- 1.9.1