avcodec/snow: Use ff_thread_once() in ff_snow_common_init()
ff_snow_common_init() currently initializes static data every time it is invoked; given that both the Snow encoder and decoder have the FF_CODEC_CAP_INIT_THREADSAFE flag set, this can lead to data races (and therefore undefined behaviour) even though all threads write the same values. This commit fixes this by using ff_thread_once() for the initializations. Reviewed-by: NMichael Niedermayer <michael@niedermayer.cc> Signed-off-by: NAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Showing
想要评论请 注册 或 登录