Index: src/gpu/GrAAHairLinePathRenderer.cpp |
diff --git a/src/gpu/GrAAHairLinePathRenderer.cpp b/src/gpu/GrAAHairLinePathRenderer.cpp |
index 57c3b5a2c37c54eb04790a26325a18af65b116fc..26cf6070215e8b4990046ca2af18c3e71ec8a143 100644 |
--- a/src/gpu/GrAAHairLinePathRenderer.cpp |
+++ b/src/gpu/GrAAHairLinePathRenderer.cpp |
@@ -895,6 +895,11 @@ void AAHairlineBatch::generateGeometry(GrBatchTarget* batchTarget, const GrPipel |
&vertexBuffer, |
&firstVertex); |
+ if (!vertices) { |
+ SkDebugf("Could not allocate vertices\n"); |
+ return; |
+ } |
+ |
SkASSERT(lineGP->getVertexStride() == sizeof(LineVertex)); |
LineVertex* verts = reinterpret_cast<LineVertex*>(vertices); |
@@ -934,6 +939,11 @@ void AAHairlineBatch::generateGeometry(GrBatchTarget* batchTarget, const GrPipel |
&vertexBuffer, |
&firstVertex); |
+ if (!vertices) { |
+ SkDebugf("Could not allocate vertices\n"); |
+ return; |
+ } |
+ |
// Setup vertices |
BezierVertex* verts = reinterpret_cast<BezierVertex*>(vertices); |
@@ -1021,6 +1031,11 @@ bool GrAAHairLinePathRenderer::onDrawPath(GrDrawTarget* target, |
const SkPath& path, |
const SkStrokeRec& stroke, |
bool) { |
+ if (!fLinesIndexBuffer || !fQuadsIndexBuffer) { |
+ SkDebugf("unable to allocate indices\n"); |
+ return false; |
+ } |
+ |
SkScalar hairlineCoverage; |
uint8_t newCoverage = 0xff; |
if (IsStrokeHairlineOrEquivalent(stroke, viewMatrix, &hairlineCoverage)) { |