changeset 11995:0d0446295060 libavcodec

Make ff_psy_preprocess_end() act like av_freep().
author alexc
date Mon, 28 Jun 2010 21:36:19 +0000
parents ea2cb1a9e815
children e0dae84d60ae
files psymodel.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/psymodel.c	Mon Jun 28 21:34:57 2010 +0000
+++ b/psymodel.c	Mon Jun 28 21:36:19 2010 +0000
@@ -117,11 +117,14 @@
 
 av_cold void ff_psy_preprocess_end(struct FFPsyPreprocessContext *ctx)
 {
+    if (ctx) {
     int i;
     ff_iir_filter_free_coeffs(ctx->fcoeffs);
     if (ctx->fstate)
         for (i = 0; i < ctx->avctx->channels; i++)
             ff_iir_filter_free_state(ctx->fstate[i]);
     av_freep(&ctx->fstate);
+    }
+    ctx = NULL;
 }