[FFmpeg-cvslog] avcodec/utils: Force mutex to NULL after destruction.

Manfred Georg git at videolan.org
Wed Oct 1 01:10:08 CEST 2014


ffmpeg | branch: master | Manfred Georg <mgeorg at google.com> | Tue Sep 30 15:20:42 2014 -0700| [79551d2c7a772ea971e94f0b8dc03d1e897e8d86] | committer: Michael Niedermayer

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 <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=79551d2c7a772ea971e94f0b8dc03d1e897e8d86
---

 libavcodec/utils.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 9eb2b5b..778bdc6 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;



More information about the ffmpeg-cvslog mailing list