summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukasz Kostyra <l.kostyra@samsung.com>2021-08-17 13:26:08 +0200
committerLukasz Kostyra <l.kostyra@samsung.com>2021-08-17 13:29:10 +0200
commit935ec8bb20022f37e387abb24cb12b3a02841c4a (patch)
tree3421f906c347320c6dd059f823bc4ede9f006839
parentc5b5c85e84c42b2f1c238f06d1f7dd8f22733bfc (diff)
downloademulator-yagl-935ec8bb20022f37e387abb24cb12b3a02841c4a.tar.gz
emulator-yagl-935ec8bb20022f37e387abb24cb12b3a02841c4a.tar.bz2
emulator-yagl-935ec8bb20022f37e387abb24cb12b3a02841c4a.zip
yagl_glsl_state: Early exit on cleanup when Shader was not initializedsubmit/tizen/20210818.223105accepted/tizen/unified/20210820.101815
There might be situations like: glCreateShader(shader, ...); glDestroyShader(shader); This would crash since yagl_glsl_state is initialized only when glShaderSource() is called. Situation is now fixed. This fixes gl-getshadersource WebGL browser test. Change-Id: Icd8fa28bc1866f4f6cd3f199fb5a8ad724d71573 Signed-off-by: Lukasz Kostyra <l.kostyra@samsung.com>
-rw-r--r--GLESv2/yagl_glsl_lexer.l5
1 files changed, 5 insertions, 0 deletions
diff --git a/GLESv2/yagl_glsl_lexer.l b/GLESv2/yagl_glsl_lexer.l
index c051572..f71fb03 100644
--- a/GLESv2/yagl_glsl_lexer.l
+++ b/GLESv2/yagl_glsl_lexer.l
@@ -672,6 +672,11 @@ void yagl_glsl_state_cleanup(struct yagl_glsl_state *state)
struct yagl_glsl_sampler *sampler_tmp;
struct yagl_glsl_define *defines_tmp;
+ if (state->shader_type == 0) {
+ // yagl_glsl_state_init was not called, quietly exit
+ return;
+ }
+
tmp = yagl_vector_data(&state->strings);
for (i = 0; i < yagl_vector_size(&state->strings); ++i) {