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>
pull/87/head
Manfred Georg 10 years ago committed by Michael Niedermayer
parent c8422f04a3
commit 79551d2c7a
  1. 2
      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;

Loading…
Cancel
Save