From 73be1fc2b02757e3d98621d7cf735591aa6dffdb Mon Sep 17 00:00:00 2001 From: "commit-bot@chromium.org" Date: Mon, 30 Dec 2013 16:21:06 +0000 Subject: [PATCH] Possibly uninitialized SkRgnBuilder fStorage. fStorage needs to be initialized regardless of SkRgnBuilder::init()'s outcome - otherwise the destructor can end up freeing garbage. BUG=330293 R=reed@google.com, fmalita@google.com Author: fmalita@chromium.org Review URL: https://codereview.chromium.org/122313002 git-svn-id: http://skia.googlecode.com/svn/trunk@12846 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/core/SkRegion_path.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/SkRegion_path.cpp b/src/core/SkRegion_path.cpp index 95247f403e..03830e6ce5 100644 --- a/src/core/SkRegion_path.cpp +++ b/src/core/SkRegion_path.cpp @@ -15,6 +15,7 @@ class SkRgnBuilder : public SkBlitter { public: + SkRgnBuilder(); virtual ~SkRgnBuilder(); // returns true if it could allocate the working storage needed @@ -98,6 +99,10 @@ private: } }; +SkRgnBuilder::SkRgnBuilder() + : fStorage(NULL) { +} + SkRgnBuilder::~SkRgnBuilder() { sk_free(fStorage); }