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

Change-Id: Id4faef1b92f7edd8c17d642c58860e70dd570506
(cherry picked from commit 40ae3520b1)
This commit is contained in:
Pascal Massimino 2013-09-17 22:19:12 +00:00 committed by James Zern
parent 2a04b034f7
commit c28544a420

View File

@ -606,6 +606,10 @@ void WebPIDelete(WebPIDecoder* idec) {
if (idec == NULL) return; if (idec == NULL) return;
if (idec->dec_ != NULL) { if (idec->dec_ != NULL) {
if (!idec->is_lossless_) { 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_); VP8Delete(idec->dec_);
} else { } else {
VP8LDelete(idec->dec_); VP8LDelete(idec->dec_);