From: David Gow Date: Fri, 15 Aug 2014 04:38:08 +0000 (+0800) Subject: Don't write past the end of a GPU mem buffer. X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=84fa5d1b2504a3fe14554d6f175dd387e5b672b4;p=ipdf%2Fcode.git Don't write past the end of a GPU mem buffer. (It causes crashiness) --- diff --git a/src/objectrenderer.cpp b/src/objectrenderer.cpp index 42ec8fd..8349bc1 100644 --- a/src/objectrenderer.cpp +++ b/src/objectrenderer.cpp @@ -281,10 +281,9 @@ void BezierRenderer::PrepareBezierGPUBuffer(const Objects& objects) BufferBuilder builder(m_bezier_coeffs.Map(false, true, true), m_bezier_coeffs.GetSize()); - for (unsigned i = 0; i < objects.types.size(); ++i) + for (unsigned i = 0; i < objects.beziers.size(); ++i) { - if (objects.types[i] != BEZIER) continue; - const Bezier & bez = objects.beziers[objects.data_indices[i]];//objects.beziers[objects.data_indices[i]].CopyInverse(objects.bounds[i]); + const Bezier & bez = objects.beziers[i]; GPUBezierCoeffs coeffs = { Float(bez.x0), Float(bez.y0),