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

Unified Diff: src/pdf/SkSinglyLinkedList.h

Issue 1955033002: SkAdvancedTypefaceMetrics: improve robustness (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-05-06 (Friday) 09:17:03 EDT Created 4 years, 7 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
Index: src/pdf/SkSinglyLinkedList.h
diff --git a/src/pdf/SkSinglyLinkedList.h b/src/pdf/SkSinglyLinkedList.h
index c157c31d16c03e2543a82d6cb72f72e0d1fe5f33..c7101141d6421b1b0cbb2691e56002bc99a1f3fb 100644
--- a/src/pdf/SkSinglyLinkedList.h
+++ b/src/pdf/SkSinglyLinkedList.h
@@ -18,6 +18,7 @@ public:
~SkSinglyLinkedList() { this->reset(); }
void reset() {
SkASSERT(fHead != nullptr || nullptr == fTail);
+ // Use a while loop rather than recursion to avoid stack overflow.
Node* node = fHead;
while (node) {
Node* next = node->fNext;
« src/core/SkAdvancedTypefaceMetrics.h ('K') | « src/core/SkAdvancedTypefaceMetrics.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698