Commit 42da8ea8 authored by Ronald S. Bultje's avatar Ronald S. Bultje Committed by Diego Biurrun

LATM/AAC: Free previously initialized context on reinit.

Fixes memory leaks which are the result of overwriting already-initialized
MDCT contexts during context reinitialization, e.g. in valgrind
fate-aac-latm_000000001180bc60.
Signed-off-by: 's avatarDiego Biurrun <diego@biurrun.de>
parent 0a6db2a2
......@@ -2464,6 +2464,7 @@ static int latm_decode_frame(AVCodecContext *avctx, void *out, int *out_size,
*out_size = 0;
return avpkt->size;
} else {
aac_decode_close(avctx);
if ((err = aac_decode_init(avctx)) < 0)
return err;
latmctx->initialized = 1;
......
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