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
This commit is contained in:
Pascal Massimino 2013-09-17 22:19:12 +00:00 committed by James Zern
parent d9662658d9
commit 40ae3520b1

View File

@ -625,6 +625,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_);