]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - aac_afh.c
aac_afh.c: Fix serious memory leak.
[paraslash.git] / aac_afh.c
index 0a352c886164e858001fec0397da3aba7cab7cfb..6e4a542b673aa7d8db058d716ffea019046459c8 100644 (file)
--- a/aac_afh.c
+++ b/aac_afh.c
@@ -1,19 +1,7 @@
 /*
  * Copyright (C) 2006-2007 Andre Noll <maan@systemlinux.org>
  *
- *     This program is free software; you can redistribute it and/or modify
- *     it under the terms of the GNU General Public License as published by
- *     the Free Software Foundation; either version 2 of the License, or
- *     (at your option) any later version.
- *
- *     This program is distributed in the hope that it will be useful,
- *     but WITHOUT ANY WARRANTY; without even the implied warranty of
- *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *     GNU General Public License for more details.
- *
- *     You should have received a copy of the GNU General Public License
- *     along with this program; if not, write to the Free Software
- *     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Licensed under the GPL v2. For licencing details see COPYING.
  */
 /*
  * based in parts on libfaad, Copyright (C) 2003-2005 M. Bakker,
@@ -110,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;
-       NeAACDecHandle handle;
+       NeAACDecHandle handle = NULL;
        unsigned char *umap = (unsigned char *) map;
 
        ret = aac_find_esds(umap, numbytes, &skip, &decoder_len);
@@ -156,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:
+       if (handle)
+               NeAACDecClose(handle);
        return ret;
 }