summaryrefslogtreecommitdiff
path: root/servers/visual/rasterizer_rd
diff options
context:
space:
mode:
authorqarmin <mikrutrafal54@gmail.com>2020-03-02 19:17:20 +0100
committerqarmin <mikrutrafal54@gmail.com>2020-03-02 19:17:20 +0100
commit1f209bfc41ef5f2cd63c961262d5d6fe3e03b55a (patch)
treed754f5b7fad41653651ee820969ca484914c5fa3 /servers/visual/rasterizer_rd
parent0c22f5a4476d80b43017b2032f60039ce75e49a9 (diff)
Fixes bugs found by Sonarcloud and Coverity
Diffstat (limited to 'servers/visual/rasterizer_rd')
-rw-r--r--servers/visual/rasterizer_rd/rasterizer_effects_rd.cpp2
-rw-r--r--servers/visual/rasterizer_rd/rasterizer_storage_rd.cpp6
2 files changed, 5 insertions, 3 deletions
diff --git a/servers/visual/rasterizer_rd/rasterizer_effects_rd.cpp b/servers/visual/rasterizer_rd/rasterizer_effects_rd.cpp
index f4d59e9e54..01cab76128 100644
--- a/servers/visual/rasterizer_rd/rasterizer_effects_rd.cpp
+++ b/servers/visual/rasterizer_rd/rasterizer_effects_rd.cpp
@@ -1077,7 +1077,7 @@ RasterizerEffectsRD::~RasterizerEffectsRD() {
RD::get_singleton()->free(filter.image_uniform_set);
}
- if (RD::get_singleton()->uniform_set_is_valid(filter.image_uniform_set)) {
+ if (RD::get_singleton()->uniform_set_is_valid(filter.uniform_set)) {
RD::get_singleton()->free(filter.uniform_set);
}
diff --git a/servers/visual/rasterizer_rd/rasterizer_storage_rd.cpp b/servers/visual/rasterizer_rd/rasterizer_storage_rd.cpp
index 15cbc61b76..52cefa7511 100644
--- a/servers/visual/rasterizer_rd/rasterizer_storage_rd.cpp
+++ b/servers/visual/rasterizer_rd/rasterizer_storage_rd.cpp
@@ -1906,8 +1906,10 @@ void RasterizerStorageRD::mesh_add_surface(RID p_mesh, const VS::SurfaceData &p_
for (int i = 0; i < p_surface.blend_shapes.size(); i++) {
- ERR_FAIL_COND(p_surface.blend_shapes[i].size() != p_surface.vertex_data.size());
-
+ if (p_surface.blend_shapes[i].size() != p_surface.vertex_data.size()) {
+ memdelete(s);
+ ERR_FAIL_COND(p_surface.blend_shapes[i].size() != p_surface.vertex_data.size());
+ }
RID vertex_buffer = RD::get_singleton()->vertex_buffer_create(p_surface.blend_shapes[i].size(), p_surface.blend_shapes[i]);
s->blend_shapes.push_back(vertex_buffer);
}