Fixes assertion failure
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
... | ... |
@@ -754,7 +754,11 @@ static void frame_thread_free(AVCodecContext *avctx, int thread_count) |
754 | 754 |
park_frame_worker_threads(fctx, thread_count); |
755 | 755 |
|
756 | 756 |
if (fctx->prev_thread && fctx->prev_thread != fctx->threads) |
757 |
- update_context_from_thread(fctx->threads->avctx, fctx->prev_thread->avctx, 0); |
|
757 |
+ if (update_context_from_thread(fctx->threads->avctx, fctx->prev_thread->avctx, 0) < 0) { |
|
758 |
+ av_log(avctx, AV_LOG_ERROR, "Final thread update failed\n"); |
|
759 |
+ fctx->prev_thread->avctx->internal->is_copy = fctx->threads->avctx->internal->is_copy; |
|
760 |
+ fctx->threads->avctx->internal->is_copy = 1; |
|
761 |
+ } |
|
758 | 762 |
|
759 | 763 |
fctx->die = 1; |
760 | 764 |
|