Commit 3ed65d98 authored by Michael Niedermayer's avatar Michael Niedermayer

avutil/log: fix race between setting and using the log callback

Found-by: wm4
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 9a63a45e
...@@ -268,8 +268,9 @@ void av_log(void* avcl, int level, const char *fmt, ...) ...@@ -268,8 +268,9 @@ void av_log(void* avcl, int level, const char *fmt, ...)
void av_vlog(void* avcl, int level, const char *fmt, va_list vl) void av_vlog(void* avcl, int level, const char *fmt, va_list vl)
{ {
if(av_log_callback) void (*log_callback)(void*, int, const char*, va_list) = av_log_callback;
av_log_callback(avcl, level, fmt, vl); if (log_callback)
log_callback(avcl, level, fmt, vl);
} }
int av_log_get_level(void) int av_log_get_level(void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment