Avoid deleting singleton flattenables

Bug: oss-fuzz:45355
Change-Id: I1958f7c009ae186485cc59e9ce1c3e8179a0acee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/517737
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
This commit is contained in:
Brian Osman 2022-03-08 10:08:27 -05:00 committed by SkCQ
parent 6509844d91
commit c971058638

View File

@ -464,7 +464,7 @@ SkFlattenable* SkReadBuffer::readFlattenable(SkFlattenable::Type ft) {
SkFlattenable* obj = this->readRawFlattenable();
if (obj && obj->getFlattenableType() != ft) {
this->validate(false);
delete obj;
obj->unref();
return nullptr;
}
return obj;