From 79551d2c7a772ea971e94f0b8dc03d1e897e8d86 Mon Sep 17 00:00:00 2001 From: Manfred Georg Date: Tue, 30 Sep 2014 15:20:42 -0700 Subject: [PATCH] avcodec/utils: Force mutex to NULL after destruction. A badly behaving user provided mutex manager (such as that in OpenCV) may not reset the mutex to NULL on destruction. This can cause a problem for a later mutex manager (which may assert that the mutex is NULL before creating). Signed-off-by: Michael Niedermayer --- libavcodec/utils.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 9eb2b5b6ede..778bdc6c2d1 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -3461,6 +3461,8 @@ int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op)) return -1; if (lockmgr_cb(&avformat_mutex, AV_LOCK_DESTROY)) return -1; + codec_mutex = NULL; + avformat_mutex = NULL; } lockmgr_cb = cb; -- 2.39.5