From: Mateusz Palkowski Date: Wed, 26 Aug 2020 09:26:40 +0000 (+0200) Subject: tvgShape: fixed missing check in Shape::fill X-Git-Tag: submit/tizen/20200830.214225~2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=627195ffad7214a523d3bf9906714ccc333e8388;p=platform%2Fcore%2Fgraphics%2Ftizenvg.git tvgShape: fixed missing check in Shape::fill Without this check, setting same fill twice results in crash later. Change-Id: I38e7026c52a250f65923c4e3008868ed471bf885 --- diff --git a/src/lib/tvgShape.cpp b/src/lib/tvgShape.cpp index 8db945d..8d0beb8 100644 --- a/src/lib/tvgShape.cpp +++ b/src/lib/tvgShape.cpp @@ -290,7 +290,7 @@ Result Shape::fill(unique_ptr f) noexcept auto p = f.release(); if (!p) return Result::MemoryCorruption; - if (impl->fill) delete(impl->fill); + if (impl->fill && impl->fill != p) delete(impl->fill); impl->fill = p; impl->flag |= RenderUpdateFlag::Gradient;