1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-10-02 09:09:59 +02:00

avcodec/aacpsy: Check model_priv_data before dereferencing in psy_3gpp_end()

Fixes: null pointer dereference
Fixes: av_freep.mp4

Found-by: Rafael Dutra <rafael.dutra@cispa.de>
Tested-by: Rafael Dutra <rafael.dutra@cispa.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2021-03-18 22:20:03 +01:00
parent 5c2ff44f91
commit 28859d6e7c

View File

@ -855,7 +855,8 @@ static void psy_3gpp_analyze(FFPsyContext *ctx, int channel,
static av_cold void psy_3gpp_end(FFPsyContext *apc)
{
AacPsyContext *pctx = (AacPsyContext*) apc->model_priv_data;
av_freep(&pctx->ch);
if (pctx)
av_freep(&pctx->ch);
av_freep(&apc->model_priv_data);
}