summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRafał Mikrut <mikrutrafal54@gmail.com>2019-11-20 16:22:16 +0100
committerRafał Mikrut <mikrutrafal54@gmail.com>2019-11-20 16:22:16 +0100
commit99d8626f4a313471410db421891e90fe768cd929 (patch)
treeb5e855e2c2a8b142af4fc01cfbc0a0257a01ccc5 /drivers
parent58ca9f17a2650bb381972210d1babbf34ac6819c (diff)
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 e34705f7b7..52dfb44a9d 100644
--- a/drivers/gles2/rasterizer_canvas_gles2.cpp
+++ b/drivers/gles2/rasterizer_canvas_gles2.cpp
@@ -749,6 +749,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;
}