Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(214)

Unified Diff: src/gpu/GrContext.cpp

Issue 979343002: handle null vertex or index buffers in batch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: cleanup Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrAARectRenderer.cpp ('k') | src/gpu/GrDefaultPathRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrContext.cpp
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index ac44644de83c32f0d87f9b20a4cddbd6e1939cc3..78f29e73bc713d773ce27ce94164244316b83c25 100755
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -567,6 +567,11 @@ public:
&vertexBuffer,
&firstVertex);
+ if (!vertices) {
+ SkDebugf("Could not allocate vertices\n");
+ return;
+ }
+
SkPoint* vertex = reinterpret_cast<SkPoint*>(vertices);
GrPrimitiveType primType;
@@ -900,6 +905,11 @@ public:
&vertexBuffer,
&firstVertex);
+ if (!vertices) {
+ SkDebugf("Could not allocate vertices\n");
+ return;
+ }
+
const GrIndexBuffer* indexBuffer;
int firstIndex;
@@ -908,6 +918,11 @@ public:
indices = batchTarget->indexPool()->makeSpace(this->indexCount(),
&indexBuffer,
&firstIndex);
+
+ if (!indices) {
+ SkDebugf("Could not allocate indices\n");
+ return;
+ }
}
int indexOffset = 0;
« no previous file with comments | « src/gpu/GrAARectRenderer.cpp ('k') | src/gpu/GrDefaultPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698