[FFmpeg-devel] [PATCH 27/39] avcodec/ituh263enc: Make static initializations thread-safe

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Wed Feb 3 22:25:57 EET 2021


Anton Khirnov:
> Just noticed
> static int16_t basis[64][64];
> in mpegvideo_enc.c, which will be accessed in a racy way if
> quantizer_noise_shaping is enabled. This applies to all mpegvideo
> encoders as far as I can tell.
> 
The reason I didn't spot this is that this part of the code is not
accessible from any init function. And I am not certain that the code
as-is is even correct: basis depends upon the idct_permutation in use
and so one might need different bases for different callers, i.e. one
would need to make this part of the context.

- Andreas


More information about the ffmpeg-devel mailing list