summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
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;
}