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

Unified Diff: src/utils/SkParsePath.cpp

Issue 1515193002: Fix a crash in SkParsePath::FromSVGString (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add comment Created 5 years 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 | tests/ParsePathTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkParsePath.cpp
diff --git a/src/utils/SkParsePath.cpp b/src/utils/SkParsePath.cpp
index 3fecb46fe60de2af5b551c3885ae2e827342bb0e..3eb9e1ef798e26abfcbe6c87345e75592919a712 100644
--- a/src/utils/SkParsePath.cpp
+++ b/src/utils/SkParsePath.cpp
@@ -77,6 +77,10 @@ bool SkParsePath::FromSVGString(const char data[], SkPath* result) {
char previousOp = '\0';
bool relative = false;
for (;;) {
+ if (!data) {
+ // Truncated data
+ return false;
+ }
data = skip_ws(data);
if (data[0] == '\0') {
break;
« no previous file with comments | « no previous file | tests/ParsePathTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698