xiph / flac

Free Lossless Audio Codec
https://xiph.org/flac/
GNU Free Documentation License v1.3
1.58k stars 278 forks source link

Improve failure handling when multithreading #681

Closed ktmf01 closed 3 months ago

ktmf01 commented 3 months ago

In case of encoder failure within a thread, asserts were false and a locked mutex would be destroyed. This fix leaves in a race condition: encoder->protected_->state is written without a lock.

Credit: Oss-Fuzz Issue: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=62650