Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-06-22 08:31:45 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-06-22 08:31:45 +0300
commitbc1262f4d61feeba235bb75046e65e0e8411241f (patch)
tree82cab7f7b8c26123a0cb71e5b83dd7fd3271662b /io_scene_x3d
parent866c2c12089e4d1b8f0aaca47c4ab9669a24ece7 (diff)
Fix T76303: Divide by zero importing X3D/WRL
Diffstat (limited to 'io_scene_x3d')
-rw-r--r--io_scene_x3d/import_x3d.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/io_scene_x3d/import_x3d.py b/io_scene_x3d/import_x3d.py
index 5a1a4b32..653b8d9f 100644
--- a/io_scene_x3d/import_x3d.py
+++ b/io_scene_x3d/import_x3d.py
@@ -2043,6 +2043,12 @@ def importMesh_IndexedFaceSet(geom, ancestry):
t_min = mins[t_axis]
dt = deltas[t_axis]
+ # Avoid divide by zero T76303.
+ if not (ds > 0.0):
+ ds = 1.0
+ if not (dt > 0.0):
+ dt = 1.0
+
def generatePointCoords(pt):
return (pt[s_axis] - s_min) / ds, (pt[t_axis] - t_min) / dt
loops = [co for f in faces