You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
fix six possible "divide by zero"
This commit is contained in:
committed by
Hubert Jarosz
parent
bf7f9244a9
commit
7b07bcaf44
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user