aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-devtools/codexl/codexl/0008-Examples-AMDTTeaPot-fix-a-null-pointer-exception.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-devtools/codexl/codexl/0008-Examples-AMDTTeaPot-fix-a-null-pointer-exception.patch')
-rw-r--r--meta-amd-bsp/recipes-devtools/codexl/codexl/0008-Examples-AMDTTeaPot-fix-a-null-pointer-exception.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-devtools/codexl/codexl/0008-Examples-AMDTTeaPot-fix-a-null-pointer-exception.patch b/meta-amd-bsp/recipes-devtools/codexl/codexl/0008-Examples-AMDTTeaPot-fix-a-null-pointer-exception.patch
new file mode 100644
index 00000000..0c95e4f6
--- /dev/null
+++ b/meta-amd-bsp/recipes-devtools/codexl/codexl/0008-Examples-AMDTTeaPot-fix-a-null-pointer-exception.patch
@@ -0,0 +1,33 @@
+From 50d21ce53601e97320ad1410f8e4f7275e9b4f5b Mon Sep 17 00:00:00 2001
+From: Adeel Arshad <adeel_arshad@mentor.com>
+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 <adeel_arshad@mentor.com>
+---
+ 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
+