]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
aac_afh.c: Fix serious memory leak.
authorAndre Noll <maan@systemlinux.org>
Thu, 13 Sep 2007 21:05:53 +0000 (23:05 +0200)
committerAndre Noll <maan@systemlinux.org>
Thu, 13 Sep 2007 21:05:53 +0000 (23:05 +0200)
Ooops. We forgot to close the AAC decoder handle...

aac_afh.c

index be301c5ce38f530bf29ddef4781f89c4d2b4926b..6e4a542b673aa7d8db058d716ffea019046459c8 100644 (file)
--- a/aac_afh.c
+++ b/aac_afh.c
@@ -98,7 +98,7 @@ static int aac_get_file_info(char *map, size_t numbytes,
        unsigned long rate = 0, decoder_len;
        unsigned char channels = 0;
        mp4AudioSpecificConfig mp4ASC;
        unsigned long rate = 0, decoder_len;
        unsigned char channels = 0;
        mp4AudioSpecificConfig mp4ASC;
-       NeAACDecHandle handle;
+       NeAACDecHandle handle = NULL;
        unsigned char *umap = (unsigned char *) map;
 
        ret = aac_find_esds(umap, numbytes, &skip, &decoder_len);
        unsigned char *umap = (unsigned char *) map;
 
        ret = aac_find_esds(umap, numbytes, &skip, &decoder_len);
@@ -144,6 +144,8 @@ static int aac_get_file_info(char *map, size_t numbytes,
        tv_scale(20, &afi->chunk_tv, &afi->eof_tv);
        ret = 1;
 out:
        tv_scale(20, &afi->chunk_tv, &afi->eof_tv);
        ret = 1;
 out:
+       if (handle)
+               NeAACDecClose(handle);
        return ret;
 }
 
        return ret;
 }