mirror of
https://github.com/webmproject/libwebp.git
synced 2025-03-03 16:22:51 +01:00
Fix for thread race heap-use-after-free
BUG=webp:385,webp:512 Change-Id: I3a300b45ccae33470888cf2e35a7e937579c9409 (cherry picked from commit 569001f19fc81fcb5ab358f587a54c62e7c4665c) (cherry picked from commit a0b85e4a366408be8d077ec30754213bcce8aceb)
This commit is contained in:
parent
16fc937d2e
commit
528c8909ef
@ -283,10 +283,8 @@ static void RestoreContext(const MBContext* context, VP8Decoder* const dec,
|
|||||||
|
|
||||||
static VP8StatusCode IDecError(WebPIDecoder* const idec, VP8StatusCode error) {
|
static VP8StatusCode IDecError(WebPIDecoder* const idec, VP8StatusCode error) {
|
||||||
if (idec->state_ == STATE_VP8_DATA) {
|
if (idec->state_ == STATE_VP8_DATA) {
|
||||||
VP8Io* const io = &idec->io_;
|
// Synchronize the thread, clean-up and check for errors.
|
||||||
if (io->teardown != NULL) {
|
VP8ExitCritical((VP8Decoder*)idec->dec_, &idec->io_);
|
||||||
io->teardown(io);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
idec->state_ = STATE_ERROR;
|
idec->state_ = STATE_ERROR;
|
||||||
return error;
|
return error;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user