summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-11-20 21:31:12 +0100
committerGitHub <noreply@github.com>2019-11-20 21:31:12 +0100
commit083d088de3fe7cd5d825cebebc46ce32fc87b4b0 (patch)
tree9b2524105bf989f6ac0ad1c488ac493f558a391f /drivers
parent719254ae0d4e1b7c9be36a4399809caf270d7e86 (diff)
parent99d8626f4a313471410db421891e90fe768cd929 (diff)
Merge pull request #33583 from qarmin/fix_overflows_unitialized
Fix some overflows and unitialized variables
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gles2/rasterizer_canvas_gles2.cpp4
-rw-r--r--drivers/gles2/shader_gles2.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gles2/rasterizer_canvas_gles2.cpp b/drivers/gles2/rasterizer_canvas_gles2.cpp
index 325f2d6707..ac54af722c 100644
--- a/drivers/gles2/rasterizer_canvas_gles2.cpp
+++ b/drivers/gles2/rasterizer_canvas_gles2.cpp
@@ -766,6 +766,10 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur
WARN_PRINT("NinePatch without texture not supported yet in GLES2 backend, skipping.");
continue;
}
+ if (tex->width == 0 || tex->height == 0) {
+ WARN_PRINT("Cannot set empty texture to NinePatch.");
+ continue;
+ }
Size2 texpixel_size(1.0 / tex->width, 1.0 / tex->height);
diff --git a/drivers/gles2/shader_gles2.h b/drivers/gles2/shader_gles2.h
index 2456a83d35..c7a6465194 100644
--- a/drivers/gles2/shader_gles2.h
+++ b/drivers/gles2/shader_gles2.h
@@ -119,6 +119,7 @@ private:
bool ok;
Version() {
code_version = 0;
+ frag_id = 0;
ok = false;
uniform_location = NULL;
}