diff options
Diffstat (limited to 'chromium/third_party/skia/src/gpu/ops/GrSmallPathRenderer.cpp')
-rw-r--r-- | chromium/third_party/skia/src/gpu/ops/GrSmallPathRenderer.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/chromium/third_party/skia/src/gpu/ops/GrSmallPathRenderer.cpp b/chromium/third_party/skia/src/gpu/ops/GrSmallPathRenderer.cpp index 873ad35defb..10ae8c38b5d 100644 --- a/chromium/third_party/skia/src/gpu/ops/GrSmallPathRenderer.cpp +++ b/chromium/third_party/skia/src/gpu/ops/GrSmallPathRenderer.cpp @@ -269,6 +269,12 @@ private: SkASSERT(vertexStride == sizeof(SkPoint) + sizeof(GrColor) + 2*sizeof(uint16_t)); const GrBuffer* vertexBuffer; + + // We need to make sure we don't overflow a 32 bit int when we request space in the + // makeVertexSpace call below. + if (instanceCount > SK_MaxS32 / kVerticesPerQuad) { + return; + } void* vertices = target->makeVertexSpace(vertexStride, kVerticesPerQuad * instanceCount, &vertexBuffer, |