diff options
author | urvang@google.com <urvang@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-18 19:40:09 +0000 |
---|---|---|
committer | urvang@google.com <urvang@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-18 19:40:09 +0000 |
commit | c9a70625a0dc7e9e2bf713e39eca6a40ea62b170 (patch) | |
tree | 8f306f43c3bed004eda982765b2915d1e3f1c96a /third_party | |
parent | fa7483fc300f88e2bcc3b51549f8ae92ca4133dc (diff) | |
download | chromium_src-c9a70625a0dc7e9e2bf713e39eca6a40ea62b170.zip chromium_src-c9a70625a0dc7e9e2bf713e39eca6a40ea62b170.tar.gz chromium_src-c9a70625a0dc7e9e2bf713e39eca6a40ea62b170.tar.bz2 |
libwebp: cherry-pick upstream memleak fix in WebPIDelete()
fix memleak in WebPIDelete()
happens when decoding is partial (past Partition0), without error and
interrupted by calling WebPIDelete()
WebPIDelete() needs to call VP8ExitCritical() to free in-flight resources
BUG=293043
Review URL: https://chromiumcodereview.appspot.com/23619072
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223914 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party')
-rw-r--r-- | third_party/libwebp/README.chromium | 1 | ||||
-rw-r--r-- | third_party/libwebp/dec/idec.c | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/third_party/libwebp/README.chromium b/third_party/libwebp/README.chromium index 4bb032b..9a81604 100644 --- a/third_party/libwebp/README.chromium +++ b/third_party/libwebp/README.chromium @@ -25,3 +25,4 @@ Cherry-picks: f5fbdee demux: stricter image bounds check a03c351 Demux: WebPIterator now also denotes if the frame has alpha. 6284854b Support for "Do not blend" in mux and demux libraries + 40ae352 Fix memleak in WebPIDelete() diff --git a/third_party/libwebp/dec/idec.c b/third_party/libwebp/dec/idec.c index 5fbf49a..61635ec 100644 --- a/third_party/libwebp/dec/idec.c +++ b/third_party/libwebp/dec/idec.c @@ -606,6 +606,10 @@ void WebPIDelete(WebPIDecoder* idec) { if (idec == NULL) return; if (idec->dec_ != NULL) { if (!idec->is_lossless_) { + if (idec->state_ == STATE_VP8_DATA) { + // Synchronize the thread, clean-up and check for errors. + VP8ExitCritical(idec->dec_, &idec->io_); + } VP8Delete(idec->dec_); } else { VP8LDelete(idec->dec_); |