From ada7029481ddf9e4d001b191e86d712e9d8839f7 Mon Sep 17 00:00:00 2001 From: David Hirvonen Date: Wed, 10 Apr 2019 16:57:01 -0400 Subject: [PATCH] avoid std::string creation from null (#58) * avoid string assignment from null pointer * bump to v0.3.10 --- CMakeLists.txt | 2 +- ogles_gpgpu/common/core.cpp | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 87bc305..0f668b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,7 @@ HunterGate( LOCAL ) -project(ogles_gpgpu VERSION 0.3.9) +project(ogles_gpgpu VERSION 0.3.10) # !!! Make sure option OGLES_GPGPU_OPENG_ES3 occurs prior to the first # hunter_add_package() call. This will allow us to modify settings diff --git a/ogles_gpgpu/common/core.cpp b/ogles_gpgpu/common/core.cpp index 11a14ca..1cacf33 100644 --- a/ogles_gpgpu/common/core.cpp +++ b/ogles_gpgpu/common/core.cpp @@ -361,7 +361,11 @@ void Core::getOutputData(unsigned char* buf) { void Core::checkGLExtensions() { // get string with extensions seperated by a SPACE - std::string glExtString = reinterpret_cast(glGetString(GL_EXTENSIONS)); + std::string glExtString; + const auto * extensions = reinterpret_cast(glGetString(GL_EXTENSIONS)); + if(extensions != nullptr) { + glExtString = extensions; + } // get extensions as vector vector glExt = Tools::split(glExtString);