Commit 2f273701 authored by James Almer's avatar James Almer

avcodec/mpeg4videodec: unbreak multithreading decoding

Should fix double free related crashes.
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent 2f0e0dea
......@@ -3380,11 +3380,13 @@ static av_cold int decode_end(AVCodecContext *avctx)
Mpeg4DecContext *ctx = avctx->priv_data;
int i;
for (i = 0; i < 12; i++)
ff_free_vlc(&ctx->studio_intra_tab[i]);
if (!avctx->internal->is_copy) {
for (i = 0; i < 12; i++)
ff_free_vlc(&ctx->studio_intra_tab[i]);
ff_free_vlc(&ctx->studio_luma_dc);
ff_free_vlc(&ctx->studio_chroma_dc);
ff_free_vlc(&ctx->studio_luma_dc);
ff_free_vlc(&ctx->studio_chroma_dc);
}
return ff_h263_decode_end(avctx);
}
......
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