aboutsummaryrefslogtreecommitdiff
path: root/tools/editor/plugins/editor_preview_plugins.cpp
diff options
context:
space:
mode:
authorRémi Verschelde2016-03-10 16:15:49 +0100
committerRémi Verschelde2016-03-10 16:15:49 +0100
commitaaad24e6fb1528fc6c773c0225ed9500c3fdd2bb (patch)
tree050800bfb1afbc562448967ee635834356c43af5 /tools/editor/plugins/editor_preview_plugins.cpp
parent042f8bf88c331197b05e9b250b48ef3f5632b4fe (diff)
parent7b07bcaf449ea6cf52c2ac501e48cddbe4bde035 (diff)
downloadgodot-aaad24e6fb1528fc6c773c0225ed9500c3fdd2bb.tar.gz
godot-aaad24e6fb1528fc6c773c0225ed9500c3fdd2bb.tar.zst
godot-aaad24e6fb1528fc6c773c0225ed9500c3fdd2bb.zip
Merge pull request #3865 from Marqin/coverity
[Coverity] fixed 11 of 537 potential bugs found by Coverity
Diffstat (limited to '')
-rw-r--r--tools/editor/plugins/editor_preview_plugins.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/editor/plugins/editor_preview_plugins.cpp b/tools/editor/plugins/editor_preview_plugins.cpp
index f3b527257..12d50cd4b 100644
--- a/tools/editor/plugins/editor_preview_plugins.cpp
+++ b/tools/editor/plugins/editor_preview_plugins.cpp
@@ -725,7 +725,11 @@ Ref<Texture> EditorSamplePreviewPlugin::generate(const RES& p_from) {
} else {
half=1;
ofs=h/2;
- v = ((j-(h/2))/(float)(h/2)) * 2.0 - 1.0;
+ if( (float)(h/2) != 0 ) {
+ v = ((j-(h/2))/(float)(h/2)) * 2.0 - 1.0;
+ } else {
+ v = ((j-(h/2))/(float)(1/2)) * 2.0 - 1.0;
+ }
}
uint8_t* imgofs = &imgw[(j*w+i)*3];