1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

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@gmx.at>
This commit is contained in:
Manfred Georg 2014-09-30 15:20:42 -07:00 committed by Michael Niedermayer
parent c8422f04a3
commit 79551d2c7a

View File

@ -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;