From b64db38b854bd8f6d564b7741ebf4795d130d168 Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Thu, 26 Jul 2018 07:40:16 -0400 Subject: avoid uninitialized under fuzzer https://skia-review.googlesource.com/143112 introduced new logic to handle failures; fuzzer found a way to exploit this. FWIW, skia's fuzzer did not call pathops when fed the test case. TBR=kjlubick@google.com Bug:867314 Change-Id: Id894962d3f32e206362faff332a1330db75da175 Reviewed-on: https://skia-review.googlesource.com/143318 Reviewed-by: Cary Clark Commit-Queue: Cary Clark Auto-Submit: Cary Clark --- src/pathops/SkOpSegment.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/pathops/SkOpSegment.cpp b/src/pathops/SkOpSegment.cpp index 14863e0b52..cbf1c36f73 100644 --- a/src/pathops/SkOpSegment.cpp +++ b/src/pathops/SkOpSegment.cpp @@ -353,7 +353,7 @@ bool SkOpSegment::ComputeOneSum(const SkOpAngle* baseAngle, SkOpAngle* nextAngle } SkOpSegment* nextSegment = nextAngle->segment(); int maxWinding, sumWinding; - SkOpSpanBase* last; + SkOpSpanBase* last = nullptr; if (binary) { int oppMaxWinding, oppSumWinding; nextSegment->setUpWindings(nextAngle->start(), nextAngle->end(), &sumMiWinding, @@ -388,7 +388,7 @@ bool SkOpSegment::ComputeOneSumReverse(SkOpAngle* baseAngle, SkOpAngle* nextAngl } SkOpSegment* nextSegment = nextAngle->segment(); int maxWinding, sumWinding; - SkOpSpanBase* last; + SkOpSpanBase* last = nullptr; if (binary) { int oppMaxWinding, oppSumWinding; nextSegment->setUpWindings(nextAngle->end(), nextAngle->start(), &sumMiWinding, -- cgit v1.2.3