diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-03-18 22:20:03 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-03-26 16:00:14 +0100 |
commit | 28859d6e7cdbf0cc230cbf782f3895a9fa22616c (patch) | |
tree | e24ef3bbb76b645dc7b019b6969db1d28aae7b36 | |
parent | 5c2ff44f915d6ceeea36a2f99e534562764218dd (diff) |
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>
-rw-r--r-- | libavcodec/aacpsy.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/aacpsy.c b/libavcodec/aacpsy.c index fca692cb15..482113d427 100644 --- a/libavcodec/aacpsy.c +++ b/libavcodec/aacpsy.c @@ -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); } |