shithub: aacdec

Download patch

ref: b6b4f6080f9e7dda16d2d1c6c2cb2ab08c87a742
parent: d4d4ca170af541d51c566a3d5b2dcdf8ffb9fe60
author: menno <menno>
date: Fri Sep 19 18:50:20 EDT 2008

Security fix in main.c
Bugfix in envelope border calculation
Small bugfixes

--- a/frontend/audio.c
+++ b/frontend/audio.c
@@ -25,7 +25,7 @@
 ** Commercial non-GPL licensing of this software is possible.
 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
 **
-** $Id: audio.c,v 1.28 2007/11/01 12:33:29 menno Exp $
+** $Id: audio.c,v 1.29 2008/09/19 22:50:17 menno Exp $
 **/
 
 #ifdef _WIN32
@@ -120,7 +120,7 @@
 
 void close_audio_file(audio_file *aufile)
 {
-    if (aufile->fileType == OUTPUT_WAV)
+    if ((aufile->fileType == OUTPUT_WAV) && (aufile->toStdio == 0))
     {
         fseek(aufile->sndfile, 0, SEEK_SET);
 
--- a/frontend/faad.sln
+++ b/frontend/faad.sln
@@ -1,9 +1,10 @@
+
 Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual C++ Express 2005
+# Visual Studio 2005
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "faad", "faad.vcproj", "{2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}"
 	ProjectSection(ProjectDependencies) = postProject
-		{BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114} = {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}
 		{F470BB4A-7675-4D6A-B310-41F33AC6F987} = {F470BB4A-7675-4D6A-B310-41F33AC6F987}
+		{BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114} = {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfaad", "..\libfaad\libfaad.vcproj", "{BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}"
--- a/frontend/main.c
+++ b/frontend/main.c
@@ -25,7 +25,7 @@
 ** Commercial non-GPL licensing of this software is possible.
 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
 **
-** $Id: main.c,v 1.82 2008/03/23 23:03:27 menno Exp $
+** $Id: main.c,v 1.83 2008/09/19 22:50:19 menno Exp $
 **/
 
 #ifdef _WIN32
@@ -916,6 +916,8 @@
                 sample_count = frameInfo.samples;
             } else {
                 sample_count = (unsigned int)(dur * frameInfo.channels);
+                if (sample_count > frameInfo.samples)
+                    sample_count = frameInfo.samples;
 
                 if (!useAacLength && !initial && (sampleId < numSamples/2) && (sample_count != frameInfo.samples))
                 {
@@ -1192,11 +1194,13 @@
         return 1;
     }
 
+#if 0
     /* only allow raw data on stdio */
     if (writeToStdio == 1)
     {
         format = 2;
     }
+#endif
 
     /* point to the specified file name */
     strcpy(aacFileName, argv[optind]);
--- a/libfaad/sbr_hfadj.c
+++ b/libfaad/sbr_hfadj.c
@@ -25,7 +25,7 @@
 ** Commercial non-GPL licensing of this software is possible.
 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
 **
-** $Id: sbr_hfadj.c,v 1.22 2007/11/01 12:33:35 menno Exp $
+** $Id: sbr_hfadj.c,v 1.23 2008/09/19 22:50:20 menno Exp $
 **/
 
 /* High Frequency adjustment */
@@ -66,9 +66,9 @@
         sbr->l_A[ch] = -1;
     } else if (sbr->bs_frame_class[ch] == VARFIX) {
         if (sbr->bs_pointer[ch] > 1)
-            sbr->l_A[ch] = -1;
-        else
             sbr->l_A[ch] = sbr->bs_pointer[ch] - 1;
+        else
+            sbr->l_A[ch] = -1;
     } else {
         if (sbr->bs_pointer[ch] == 0)
             sbr->l_A[ch] = -1;
--- a/libfaad/sbr_tf_grid.c
+++ b/libfaad/sbr_tf_grid.c
@@ -25,7 +25,7 @@
 ** Commercial non-GPL licensing of this software is possible.
 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
 **
-** $Id: sbr_tf_grid.c,v 1.19 2007/11/01 12:33:36 menno Exp $
+** $Id: sbr_tf_grid.c,v 1.20 2008/09/19 22:50:20 menno Exp $
 **/
 
 /* Time/Frequency grid */
@@ -65,13 +65,13 @@
         switch (sbr->L_E[ch])
         {
         case 4:
-            temp = (int) (sbr->numTimeSlots / 4);
+            temp = (sbr->numTimeSlots / 4);
             t_E_temp[3] = sbr->rate * 3 * temp;
             t_E_temp[2] = sbr->rate * 2 * temp;
             t_E_temp[1] = sbr->rate * temp;
             break;
         case 2:
-            t_E_temp[1] = sbr->rate * (int) (sbr->numTimeSlots / 2);
+            t_E_temp[1] = sbr->rate * (sbr->numTimeSlots / 2);
             break;
         default:
             break;