From 67cbe20c6441a01ca9ba9bcdfd1ed83b38cf5c34 Mon Sep 17 00:00:00 2001 From: Adeel Kazmi Date: Tue, 6 Feb 2024 10:25:32 +0000 Subject: [PATCH] SVACE fix in gles-graphics-program.cpp Change-Id: Ib7def5a0dd0a5a59c33f49edaaa072ad20e80f92 --- dali/internal/graphics/gles-impl/gles-graphics-program.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/dali/internal/graphics/gles-impl/gles-graphics-program.cpp b/dali/internal/graphics/gles-impl/gles-graphics-program.cpp index 3b28c23..2141e32 100644 --- a/dali/internal/graphics/gles-impl/gles-graphics-program.cpp +++ b/dali/internal/graphics/gles-impl/gles-graphics-program.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2024 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -257,7 +257,11 @@ void ProgramImpl::UpdateStandaloneUniformBlock(const char* ptr) const auto& extraInfos = reflection.GetStandaloneUniformExtraInfo(); - auto& gl = *GetController().GetGL(); + auto* gl = GetController().GetGL(); + if(!gl) + { + return; // Early out if no GL found + } // Set uniforms int index = 0; @@ -272,17 +276,17 @@ void ProgramImpl::UpdateStandaloneUniformBlock(const char* ptr) { case UniformSetter::Type::FLOAT: { - (gl.*(setter.uniformfProc))(info.location, info.arraySize, reinterpret_cast(&ptr[offset])); + (gl->*(setter.uniformfProc))(info.location, info.arraySize, reinterpret_cast(&ptr[offset])); break; } case UniformSetter::Type::INT: { - (gl.*(setter.uniformiProc))(info.location, info.arraySize, reinterpret_cast(&ptr[offset])); + (gl->*(setter.uniformiProc))(info.location, info.arraySize, reinterpret_cast(&ptr[offset])); break; } case UniformSetter::Type::MATRIX: { - (gl.*(setter.uniformMatrixProc))(info.location, info.arraySize, GL_FALSE, reinterpret_cast(&ptr[offset])); + (gl->*(setter.uniformMatrixProc))(info.location, info.arraySize, GL_FALSE, reinterpret_cast(&ptr[offset])); break; } case UniformSetter::Type::UNDEFINED: -- 2.7.4