diff --git a/src/opus_multistream_encoder.c b/src/opus_multistream_encoder.c
index 1847bd5ae6afea5264f61d20f0d9f04df06cc1ed..08dff3631eceb6eb77aca99830b1b1c7404a40ec 100644
--- a/src/opus_multistream_encoder.c
+++ b/src/opus_multistream_encoder.c
@@ -105,6 +105,8 @@ int opus_multistream_encoder_init(
    st->layout.nb_channels = channels;
    st->layout.nb_streams = streams;
    st->layout.nb_coupled_streams = coupled_streams;
+   st->subframe_mem[0]=st->subframe_mem[1]=st->subframe_mem[2]=0;
+   OPUS_CLEAR(&st->analysis,1);
 
    st->bitrate_bps = OPUS_AUTO;
    st->variable_duration = OPUS_FRAMESIZE_ARG;