summaryrefslogtreecommitdiff
path: root/servers
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-03-04 13:41:38 +0100
committerGitHub <noreply@github.com>2020-03-04 13:41:38 +0100
commita0e33e17fbecc321d45306255814f9581504776c (patch)
tree966803124d47a23266ae3f81e57c7cf8f0456521 /servers
parentf83f1d7c9b299f21f818e0ea28c27345f65bde4b (diff)
parent1f209bfc41ef5f2cd63c961262d5d6fe3e03b55a (diff)
Merge pull request #36733 from qarmin/static_analyzer_fixes
Fixes bugs found by Sonarcloud and Coverity
Diffstat (limited to 'servers')
-rw-r--r--servers/visual/rasterizer.h1
-rw-r--r--servers/visual/rasterizer_rd/rasterizer_effects_rd.cpp2
-rw-r--r--servers/visual/rasterizer_rd/rasterizer_storage_rd.cpp6
3 files changed, 6 insertions, 3 deletions
diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h
index 3a219ec7e3..0a55c78133 100644
--- a/servers/visual/rasterizer.h
+++ b/servers/visual/rasterizer.h
@@ -1171,6 +1171,7 @@ public:
Command *n = c->next;
if (c == commands) {
memdelete(commands);
+ commands = NULL;
} else {
c->~Command();
}
diff --git a/servers/visual/rasterizer_rd/rasterizer_effects_rd.cpp b/servers/visual/rasterizer_rd/rasterizer_effects_rd.cpp
index 85750df9d1..6b6c750fd3 100644
--- a/servers/visual/rasterizer_rd/rasterizer_effects_rd.cpp
+++ b/servers/visual/rasterizer_rd/rasterizer_effects_rd.cpp
@@ -1081,7 +1081,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);
}