shithub: aacdec

Download patch

ref: 96eeea189ca734359c7707ecb942771e3ec95138
parent: b6b4f6080f9e7dda16d2d1c6c2cb2ab08c87a742
author: menno <menno>
date: Fri Sep 19 19:31:40 EDT 2008

Made sure MAIN prediction can't be started after the first frame

--- 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.83 2008/09/19 22:50:19 menno Exp $
+** $Id: main.c,v 1.84 2008/09/19 23:31:39 menno Exp $
 **/
 
 #ifdef _WIN32
@@ -133,6 +133,8 @@
     b->file_offset += bytes;
     b->bytes_consumed = bytes;
     b->bytes_into_buffer -= bytes;
+	if (b->bytes_into_buffer < 0)
+		b->bytes_into_buffer = 0;
 }
 
 static int adts_sample_rates[] = {96000,88200,64000,48000,44100,32000,24000,22050,16000,12000,11025,8000,7350,0,0,0};
--- a/libfaad/error.c
+++ b/libfaad/error.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: error.c,v 1.32 2007/11/01 12:33:30 menno Exp $
+** $Id: error.c,v 1.33 2008/09/19 23:31:39 menno Exp $
 **/
 
 #include "common.h"
@@ -64,6 +64,7 @@
     "PNS not allowed in DRM data stream",
     "No standard extension payload allowed in DRM",
     "PCE shall be the first element in a frame",
-    "Bitstream value not allowed by specification"
+    "Bitstream value not allowed by specification",
+	"MAIN prediction not initialised"
 };
 
--- a/libfaad/error.h
+++ b/libfaad/error.h
@@ -25,7 +25,7 @@
 ** Commercial non-GPL licensing of this software is possible.
 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
 **
-** $Id: error.h,v 1.26 2007/11/01 12:33:30 menno Exp $
+** $Id: error.h,v 1.27 2008/09/19 23:31:40 menno Exp $
 **/
 
 #ifndef __ERROR_H__
@@ -35,7 +35,7 @@
 extern "C" {
 #endif
 
-#define NUM_ERROR_MESSAGES 33
+#define NUM_ERROR_MESSAGES 34
 extern char *err_msg[];
 
 #ifdef __cplusplus
--- a/libfaad/specrec.c
+++ b/libfaad/specrec.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: specrec.c,v 1.60 2007/11/01 12:33:36 menno Exp $
+** $Id: specrec.c,v 1.61 2008/09/19 23:31:40 menno Exp $
 **/
 
 /*
@@ -958,6 +958,9 @@
     /* MAIN object type prediction */
     if (hDecoder->object_type == MAIN)
     {
+		if (!hDecoder->pred_stat[sce->channel])
+			return 33;
+
         /* intra channel prediction */
         ic_prediction(ics, spec_coef, hDecoder->pred_stat[sce->channel], hDecoder->frameLength,
             hDecoder->sf_index);