shithub: aacdec

Download patch

ref: 877dfb805676e0d53b8aab970327e44fc7364814
parent: b92e2e27c42b004b31fc2394d53180e50a760ec3
author: menno <menno>
date: Tue Feb 4 11:49:38 EST 2003

Bugfixes, NULL pointer checks...

--- a/libfaad/decoder.c
+++ b/libfaad/decoder.c
@@ -16,7 +16,7 @@
 ** along with this program; if not, write to the Free Software 
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
-** $Id: decoder.c,v 1.47 2003/01/17 14:56:15 menno Exp $
+** $Id: decoder.c,v 1.48 2003/02/04 16:49:37 menno Exp $
 **/
 
 #include "common.h"
@@ -292,6 +292,9 @@
 void FAADAPI faacDecClose(faacDecHandle hDecoder)
 {
     uint8_t i;
+
+    if (hDecoder == NULL)
+        return;
 
     for (i = 0; i < MAX_CHANNELS; i++)
     {
--- a/libfaad/filtbank.c
+++ b/libfaad/filtbank.c
@@ -16,7 +16,7 @@
 ** along with this program; if not, write to the Free Software 
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
-** $Id: filtbank.c,v 1.23 2002/11/28 18:48:30 menno Exp $
+** $Id: filtbank.c,v 1.24 2003/02/04 16:49:37 menno Exp $
 **/
 
 #include "common.h"
@@ -82,13 +82,16 @@
 
 void filter_bank_end(fb_info *fb)
 {
-    faad_mdct_end(fb->mdct256);
-    faad_mdct_end(fb->mdct2048);
+    if (fb != NULL)
+    {
+        faad_mdct_end(fb->mdct256);
+        faad_mdct_end(fb->mdct2048);
 #ifdef LD_DEC
-    faad_mdct_end(fb->mdct1024);
+        faad_mdct_end(fb->mdct1024);
 #endif
 
-    if (fb) free(fb);
+        free(fb);
+    }
 }
 
 static INLINE void imdct(fb_info *fb, real_t *in_data, real_t *out_data, uint16_t len)
--- a/libfaad/mdct.c
+++ b/libfaad/mdct.c
@@ -16,7 +16,7 @@
 ** along with this program; if not, write to the Free Software 
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
-** $Id: mdct.c,v 1.23 2002/11/28 18:48:30 menno Exp $
+** $Id: mdct.c,v 1.24 2003/02/04 16:49:37 menno Exp $
 **/
 
 /*
@@ -147,12 +147,15 @@
 
 void faad_mdct_end(mdct_info *mdct)
 {
-    cfftu(mdct->cfft);
+    if (mdct != NULL)
+    {
+        cfftu(mdct->cfft);
 
-    if (mdct->Z1) free(mdct->Z1);
-    if (mdct->sincos) free(mdct->sincos);
+        if (mdct->Z1) free(mdct->Z1);
+        if (mdct->sincos) free(mdct->sincos);
 
-    if (mdct) free(mdct);
+        free(mdct);
+    }
 }
 
 void faad_imdct(mdct_info *mdct, real_t *X_in, real_t *X_out)
--- a/plugins/foo_mp4/foo_mp4.cpp
+++ b/plugins/foo_mp4/foo_mp4.cpp
@@ -16,7 +16,7 @@
 ** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
-** $Id: foo_mp4.cpp,v 1.12 2002/12/29 13:13:36 menno Exp $
+** $Id: foo_mp4.cpp,v 1.13 2003/02/04 16:49:38 menno Exp $
 **/
 
 #include <mp4.h>
@@ -49,7 +49,7 @@
         config->outputFormat = FAAD_FMT_FLOAT;
         faacDecSetConfiguration(hDecoder, config);
 
-        hFile = MP4ReadCb("blablabla", 0, open_cb, close_cb, read_cb, write_cb,
+        hFile = MP4ReadCb(0, open_cb, close_cb, read_cb, write_cb,
             setpos_cb, getpos_cb, filesize_cb, (void*)m_reader);
         if (hFile == MP4_INVALID_FILE_HANDLE) return 0;
 
@@ -139,7 +139,7 @@
     {
         m_reader = r;
 
-        hFile = MP4ModifyCb("blablabla", 0, 0, open_cb, close_cb, read_cb, write_cb,
+        hFile = MP4ModifyCb(0, 0, open_cb, close_cb, read_cb, write_cb,
             setpos_cb, getpos_cb, filesize_cb, (void*)m_reader);
         if (hFile == MP4_INVALID_FILE_HANDLE) return 0;
 
@@ -147,7 +147,7 @@
         if (track < 1) return 0;
 
         MP4TagDelete(hFile, track);
-        MP4TagCreate(hFile, track);
+//        MP4TagCreate(hFile, track);
 
         /* replay gain writing */
         const char *p = NULL;
--- a/plugins/foo_mp4/foo_mp4.dsw
+++ b/plugins/foo_mp4/foo_mp4.dsw
@@ -15,14 +15,14 @@
     Project_Dep_Name libfaad
     End Project Dependency
     Begin Project Dependency
-    Project_Dep_Name pfc_unicode
-    End Project Dependency
-    Begin Project Dependency
     Project_Dep_Name foobar2000_SDK
     End Project Dependency
     Begin Project Dependency
     Project_Dep_Name libmp4v2_cb
     End Project Dependency
+    Begin Project Dependency
+    Project_Dep_Name pfc
+    End Project Dependency
 }}}
 
 ###############################################################################
@@ -63,7 +63,7 @@
 
 ###############################################################################
 
-Project: "pfc_unicode"=.\pfc\pfc_unicode.dsp - Package Owner=<4>
+Project: "pfc"=.\pfc\pfc.dsp - Package Owner=<4>
 
 Package=<5>
 {{{