From 3c726230614dd4d9c4a2a644104a4b00e14899c8 Mon Sep 17 00:00:00 2001 From: sum2012 Date: Thu, 23 Jan 2014 05:45:28 +0800 Subject: [PATCH] Fix "Integer divide by zero 0" in Spline.cpp --- GPU/GLES/Spline.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/GPU/GLES/Spline.cpp b/GPU/GLES/Spline.cpp index 0e054173ff..9cf30dfa30 100644 --- a/GPU/GLES/Spline.cpp +++ b/GPU/GLES/Spline.cpp @@ -816,6 +816,8 @@ void TransformDrawEngine::SubmitBezier(void* control_points, void* indices, int // Simple approximation of the real tesselation factor. // We shouldn't really split up into separate 4x4 patches, instead we should do something that works // like the splines, so we subdivide across the whole "mega-patch". + if (num_patches_u == 0) num_patches_u = 1; + if (num_patches_v == 0) num_patches_v = 1; int tess_u = gstate.getPatchDivisionU() / num_patches_u; int tess_v = gstate.getPatchDivisionV() / num_patches_v; if (tess_u < 4) tess_u = 4;