[FFmpeg-cvslog] avcodec/aacpsy: Check model_priv_data before dereferencing in psy_3gpp_end()

Michael Niedermayer git at videolan.org
Fri Mar 26 17:05:33 EET 2021


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Thu Mar 18 22:20:03 2021 +0100| [28859d6e7cdbf0cc230cbf782f3895a9fa22616c] | committer: Michael Niedermayer

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 at cispa.de>
Tested-by: Rafael Dutra <rafael.dutra at cispa.de>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=28859d6e7cdbf0cc230cbf782f3895a9fa22616c
---

 libavcodec/aacpsy.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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);
 }
 



More information about the ffmpeg-cvslog mailing list