]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/cngenc: Replace av_free() by av_freep() in close function
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sun, 13 Sep 2020 23:56:44 +0000 (01:56 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Fri, 18 Sep 2020 00:51:18 +0000 (02:51 +0200)
This avoids leaving pointers to already freed memory in memory.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/cngenc.c

index e185c4a40a98a0020c7fbb11ff62b20212dbcef0..8f23b7555a2c6fa721fb4e67d449591f3a276b92 100644 (file)
@@ -37,8 +37,8 @@ static av_cold int cng_encode_close(AVCodecContext *avctx)
 {
     CNGContext *p = avctx->priv_data;
     ff_lpc_end(&p->lpc);
-    av_free(p->samples32);
-    av_free(p->ref_coef);
+    av_freep(&p->samples32);
+    av_freep(&p->ref_coef);
     return 0;
 }