diff options
author | halcanary <halcanary@google.com> | 2016-05-06 07:30:13 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-06 07:30:13 -0700 |
commit | ebbdfe63a9643faa403f33282da9921427ca91eb (patch) | |
tree | 79fb18b9e50390ab9c2764cb20200a6eb1a57884 /src/pdf | |
parent | 055e192adc0072ae2548ef5431ceee652945f9c2 (diff) |
SkAdvancedTypefaceMetrics: improve robustness
Manually unwind linked list.
BUG=567031
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1955033002
Review-Url: https://codereview.chromium.org/1955033002
Diffstat (limited to 'src/pdf')
-rw-r--r-- | src/pdf/SkSinglyLinkedList.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/pdf/SkSinglyLinkedList.h b/src/pdf/SkSinglyLinkedList.h index c157c31d16..c7101141d6 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; |