summaryrefslogtreecommitdiff
path: root/libavcodec/mpc7.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-11-15 20:56:22 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-11-24 11:35:03 +0100
commit16bb8247b45a51c06e27e8563d8a546f3dddc79e (patch)
tree9522fce749a98bb547e5e6292f804c25f0a8940d /libavcodec/mpc7.c
parentead313415037bbb94954a346a17796c0f741f790 (diff)
downloadffmpeg-16bb8247b45a51c06e27e8563d8a546f3dddc79e.tar.gz
avcodec/mpegaudiodsp: Make initializing synth windows thread-safe
These arrays are used by the Musepack decoders, the MPEG audio decoders as well as qdm2 and up until now, these arrays might be initialized more than once, leading to potential data races as well as unnecessary initializations. Therefore this commit ensures that each array will only be initialized once. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/mpc7.c')
-rw-r--r--libavcodec/mpc7.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/mpc7.c b/libavcodec/mpc7.c
index 6482029efc..e4aa8586d4 100644
--- a/libavcodec/mpc7.c
+++ b/libavcodec/mpc7.c
@@ -71,7 +71,6 @@ static av_cold int mpc7_decode_init(AVCodecContext * avctx)
ff_bswapdsp_init(&c->bdsp);
ff_mpadsp_init(&c->mpadsp);
c->bdsp.bswap_buf((uint32_t *) buf, (const uint32_t *) avctx->extradata, 4);
- ff_mpc_init();
init_get_bits(&gb, buf, 128);
c->IS = get_bits1(&gb);
@@ -114,6 +113,7 @@ static av_cold int mpc7_decode_init(AVCodecContext * avctx)
}
}
vlc_initialized = 1;
+ ff_mpa_synth_init_fixed();
return 0;
}