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

Unified Diff: gm/beziereffects.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 | « no previous file | gm/convexpolyeffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/beziereffects.cpp
diff --git a/gm/beziereffects.cpp b/gm/beziereffects.cpp
index 45c6341848ee09e73f8103a3e31c9203e8da9dc8..d86a8b8163ace9eff83a5fd1df320ba361d719da 100644
--- a/gm/beziereffects.cpp
+++ b/gm/beziereffects.cpp
@@ -76,6 +76,11 @@ private:
&vertexBuffer,
&firstVertex);
+ if (!vertices || !batchTarget->quadIndexBuffer()) {
+ SkDebugf("Could not allocate buffers\n");
+ return;
+ }
+
SkASSERT(vertexStride == sizeof(Vertex));
Vertex* verts = reinterpret_cast<Vertex*>(vertices);
@@ -478,6 +483,11 @@ private:
&vertexBuffer,
&firstVertex);
+ if (!vertices || !batchTarget->quadIndexBuffer()) {
+ SkDebugf("Could not allocate buffers\n");
+ return;
+ }
+
SkASSERT(vertexStride == sizeof(Vertex));
Vertex* verts = reinterpret_cast<Vertex*>(vertices);
« no previous file with comments | « no previous file | gm/convexpolyeffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698