Browse Source

avcodec/cngenc: Replace av_free() by av_freep() in close function

This avoids leaving pointers to already freed memory in memory.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
tags/n4.4
Andreas Rheinhardt 5 years ago
parent
commit
29c5c8fdfb
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      libavcodec/cngenc.c

+ 2
- 2
libavcodec/cngenc.c View 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;
}



Loading…
Cancel
Save