SkPathOpsTSect: Avoid null dereference in asserts

We just move the asserts to after our null checks.

Change-Id: I96c02ff9cb60ca3a052198b30f205dc78899acc6
Reviewed-on: https://skia-review.googlesource.com/c/190564
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This commit is contained in:
Greg Kaiser 2019-02-08 17:04:00 -08:00 committed by Skia Commit-Bot
parent fb7a713dc5
commit fe046de36b

View File

@ -885,16 +885,16 @@ bool SkTSect::extractCoincident(
SkOPASSERT(oppStartT < oppEndT);
SkASSERT(coinStart == first->fStartT);
SkASSERT(coinEnd == last->fEndT);
SkOPASSERT(oppStartT == oppFirst->fStartT);
SkOPASSERT(oppEndT == oppLast->fEndT);
if (!oppFirst) {
*result = nullptr;
return true;
}
SkOPASSERT(oppStartT == oppFirst->fStartT);
if (!oppLast) {
*result = nullptr;
return true;
}
SkOPASSERT(oppEndT == oppLast->fEndT);
// reduce coincident runs to single entries
this->validate();
sect2->validate();