diff --git a/ChangeLog b/ChangeLog
index 92d65c8..5cdbc55 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,28 @@
+2.10.0:
+	[ tatsuz ]
+	* updated Visual Studio projects to VS 2019 (#54)
+
+	[ Fabian Greffrath ]
+	* mp4read.c: fix stack-buffer-overflow in stringin()/ftypin()
+	* fix heap-buffer-overflow in mp4read.c
+
+	[ Clayton Smith ]
+	* Remove non-ASCII characters
+	* Remove trailing whitespace
+
+	[ Andrew Wesie ]
+	* Check return value of ltp_data.
+	* Restrict SBR frame length to 960 and 1024 samples.
+	* Support object type 29.
+	* Support implicit SBR signaling in frontend.
+	* Fix PNS decoding when only right channel is noise.
+	* Initialize element_id array with an invalid id.
+	* Fix NULL pointer dereferences.
+	* Fix infinite loop in adts_parse.
+	* Fix infinite loop in huffman_getescape.
+	* Check for error after each channel decode.
+	* Check for inconsistent number of channels.
+
 2.9.2:
 	[ Michał Janiszewski ]
 	* Only use x86-assembly when explicitly on x86
diff --git a/README b/README
index 0cb43fb..f4d5da0 100644
--- a/README
+++ b/README
@@ -1,6 +1,5 @@
 
 Freeware Advanced Audio (AAC) Decoder including SBR decoding
-http://www.audiocoding.com/
 
 FAAD2 is a HE, LC, MAIN and LTP profile, MPEG2 and MPEG-4 AAC decoder.
 FAAD2 includes code for SBR (HE AAC) decoding.
diff --git a/aacDECdrop/audio.h b/aacDECdrop/audio.h
index 906d503..93b0962 100644
--- a/aacDECdrop/audio.h
+++ b/aacDECdrop/audio.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/aacDECdrop/decthread.c b/aacDECdrop/decthread.c
index 5edbf21..300a5b8 100644
--- a/aacDECdrop/decthread.c
+++ b/aacDECdrop/decthread.c
@@ -183,7 +183,7 @@ DWORD WINAPI decode_thread(LPVOID arg)
 		numfiles = 0;
 
 		Sleep(500);
-	} 
+	}
 
 	DeleteCriticalSection(&mutex);
 
diff --git a/aacDECdrop/main.c b/aacDECdrop/main.c
index de3638b..eeed45c 100644
--- a/aacDECdrop/main.c
+++ b/aacDECdrop/main.c
@@ -28,7 +28,7 @@
 #define CREATEFONT(sz) \
 	CreateFont((sz), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
 		VARIABLE_PITCH | FF_SWISS, "")
-   
+
 HANDLE event = NULL;
 int width = 130, height = 130;
 RECT bar1, bar2, vbrBR;
@@ -232,7 +232,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine,
 	set_outputFormat(iniSettings.outputFormat);
 	set_fileType(iniSettings.fileType);
 	set_object_type(iniSettings.object_type);
-	
+
 	for (frame = 0; frame < 8; frame++)
 		hbm[frame] = LoadImage(hinst, MAKEINTRESOURCE(IDB_TF01 + frame), IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION);
 	frame = 0;
@@ -243,7 +243,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine,
 		DispatchMessage(&msg);
 	}
 
-	for (frame = 0; frame < 8; frame++) 
+	for (frame = 0; frame < 8; frame++)
 		DeleteObject(hbm[frame]);
 
 	return msg.wParam;
@@ -373,7 +373,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 			if (animate || frame)
 			{
 				frame++;
-				if (frame > 7) 
+				if (frame > 7)
 					frame -= 8;
 			}
 			else
@@ -437,7 +437,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 			return 0;
 
 		case WM_COMMAND:
-			switch (LOWORD(wParam)) 
+			switch (LOWORD(wParam))
 			{
 				case IDM_QUIT:
 					WriteIniFile(INI_FILE);
@@ -446,7 +446,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 					break;
 				case IDM_ONTOP:
 					set_always_on_top(hwnd, ~GetMenuState(menu, LOWORD(wParam), MF_BYCOMMAND) & MF_CHECKED);
-					break;	
+					break;
 				case IDM_LOGERR:
 					set_logerr(hwnd, ~GetMenuState(menu, LOWORD(wParam), MF_BYCOMMAND) & MF_CHECKED);
 					break;
@@ -459,10 +459,10 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 				}
 				case IDM_VOLUME:
 				{
-					int value = 
+					int value =
 					DialogBox(
-					hinst,  
-					MAKEINTRESOURCE(IDD_VOLUME),   
+					hinst,
+					MAKEINTRESOURCE(IDD_VOLUME),
 					hwnd, QCProc);
 
 					if (value == -2)
@@ -484,7 +484,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 			hdrop = (HANDLE)wParam;
 			HandleDrag(hwnd, hdrop);
 			return 0;
-	
+
 		case WM_DESTROY:
 			decoding_done = 1;
 			PostQuitMessage(0);
@@ -498,13 +498,13 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
  *  Encode parameters dialog procedures.
  */
 
-BOOL CALLBACK QCProc(HWND hwndDlg, UINT message, 
-                     WPARAM wParam, LPARAM lParam) 
+BOOL CALLBACK QCProc(HWND hwndDlg, UINT message,
+                     WPARAM wParam, LPARAM lParam)
 {
-	switch (message) 
-	{ 
-		case WM_INITDIALOG: 
- 
+	switch (message)
+	{
+		case WM_INITDIALOG:
+
 			if(iniSettings.decode_mode == 0)
 			{
 				CheckDlgButton(hwndDlg,IDC_PLAYBACK,TRUE);
@@ -579,8 +579,8 @@ BOOL CALLBACK QCProc(HWND hwndDlg, UINT message,
 			EndDialog(hwndDlg, -1);
 			break;
 
-		case WM_COMMAND: 
-			switch (LOWORD(wParam)) 
+		case WM_COMMAND:
+			switch (LOWORD(wParam))
 			{
 				case IDC_BUTTON1:
 				{
@@ -670,7 +670,7 @@ BOOL CALLBACK QCProc(HWND hwndDlg, UINT message,
 					break;
        	  		}
 	}
-	return FALSE; 
+	return FALSE;
 }
 
 
diff --git a/aacDECdrop/misc.c b/aacDECdrop/misc.c
index 7b26532..1554bd8 100644
--- a/aacDECdrop/misc.c
+++ b/aacDECdrop/misc.c
@@ -39,8 +39,8 @@ void error_dialog(const char *fmt, ...)
 	if (strlen(fmt) > 750)
 	{
 		sprintf(msgbuf, "%s %s", "<buffer overflow> ", fmt);
-	} 
-	else 
+	}
+	else
 	{
 		if (_filename != NULL && strlen(_filename) < 255)
 		{
@@ -49,7 +49,7 @@ void error_dialog(const char *fmt, ...)
 		}
 
 		va_start(ap, fmt);
-		
+
 		vsprintf(bufp, fmt, ap);
 
 		va_end(ap);
diff --git a/aacDECdrop/resource.h b/aacDECdrop/resource.h
index d69b5a6..2409c46 100644
--- a/aacDECdrop/resource.h
+++ b/aacDECdrop/resource.h
@@ -42,7 +42,7 @@
 #define IDM_QUIT                        40019
 
 // Next default values for new objects
-// 
+//
 #ifdef APSTUDIO_INVOKED
 #ifndef APSTUDIO_READONLY_SYMBOLS
 #define _APS_NO_MFC                     1
diff --git a/configure.ac b/configure.ac
index 65b3cdd..9b12f2c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8,7 +8,7 @@ dnl - xmms input mp4/aac plugin
 dnl - mpeg4ip plugin (requires mpeg4ip's libmp4v2 to be installed)
 
 AC_PREREQ(2.50)
-AC_INIT(faad2, 2.9.2)
+AC_INIT(faad2, 2.10.0)
 AC_CONFIG_AUX_DIR(.)
 AM_INIT_AUTOMAKE([subdir-objects])
 
diff --git a/frontend/audio.c b/frontend/audio.c
index c8df015..4e0dad3 100644
--- a/frontend/audio.c
+++ b/frontend/audio.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/frontend/audio.h b/frontend/audio.h
index 72003d3..113b35a 100644
--- a/frontend/audio.h
+++ b/frontend/audio.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/frontend/getopt.c b/frontend/getopt.c
index 9ff965f..96bb980 100644
--- a/frontend/getopt.c
+++ b/frontend/getopt.c
@@ -204,7 +204,7 @@ my_index (str, chr)
 }
 
 #endif              /* GNU C library.  */
-
+
 /* Handle permutation of arguments.  */
 
 /* Describe the part of ARGV that contains non-options that have
@@ -265,7 +265,7 @@ exchange (argv)
     temp = *first; *first = *last; *last = temp; first++; last--;
   }
 }
-
+
 /* Scan elements of ARGV (whose length is ARGC) for option characters
    given in OPTSTRING.
 
@@ -680,7 +680,7 @@ getopt_long (argc, argv, options, long_options, opt_index)
 }
 
 #endif  /* _LIBC or not __GNU_LIBRARY__.  */
-
+
 #ifdef TEST
 
 /* Compile with -DTEST to make an executable for use in testing
diff --git a/frontend/main.c b/frontend/main.c
index fadc5cb..9ceb924 100644
--- a/frontend/main.c
+++ b/frontend/main.c
@@ -154,7 +154,7 @@ static void advance_buffer(aac_buffer *b, int bytes)
     while ((b->bytes_into_buffer > 0) && (bytes > 0))
     {
         int chunk = min(bytes, b->bytes_into_buffer);
-    
+
         bytes -= chunk;
         b->file_offset += chunk;
         b->bytes_consumed = chunk;
@@ -217,6 +217,8 @@ static int adts_parse(aac_buffer *b, int *bitrate, float *length)
 
             frame_length = ((((unsigned int)b->buffer[3] & 0x3)) << 11)
                 | (((unsigned int)b->buffer[4]) << 3) | (b->buffer[5] >> 5);
+            if (frame_length == 0)
+                break;
 
             t_framelength += frame_length;
 
@@ -697,6 +699,10 @@ static int decodeAACfile(char *aacfile, char *sndfile, char *adts_fn, int to_std
         /* update buffer indices */
         advance_buffer(&b, frameInfo.bytesconsumed);
 
+        /* check if the inconsistent number of channels */
+        if (aufile != NULL && frameInfo.channels != aufile->channels)
+            frameInfo.error = 12;
+
         if (frameInfo.error > 0)
         {
             faad_fprintf(stderr, "Error: %s\n",
@@ -872,7 +878,7 @@ static int decodeMP4file(char *mp4file, char *sndfile, char *adts_fn, int to_std
         if (NeAACDecAudioSpecificConfig(mp4config.asc.buf, mp4config.asc.size, &mp4ASC) >= 0)
         {
             if (mp4ASC.frameLengthFlag == 1) framesize = 960;
-            if (mp4ASC.sbr_present_flag == 1) framesize *= 2;
+            if (mp4ASC.sbr_present_flag == 1 || mp4ASC.forceUpSampling) framesize *= 2;
         }
     }
 
diff --git a/frontend/mp4read.c b/frontend/mp4read.c
index 1b24f18..6a618d3 100644
--- a/frontend/mp4read.c
+++ b/frontend/mp4read.c
@@ -95,6 +95,7 @@ static int stringin(char *txt, int sizemax)
         if (!txt[size])
             break;
     }
+    txt[sizemax-1] = '\0';
 
     return size;
 }
@@ -343,7 +344,10 @@ static int stszin(int size)
     u32in();
     // Number of entries
     mp4config.frame.ents = u32in();
-    // fixme: check atom size
+
+    if (!(mp4config.frame.ents + 1))
+        return ERR_FAIL;
+
     mp4config.frame.data = malloc(sizeof(*mp4config.frame.data)
                                   * (mp4config.frame.ents + 1));
 
diff --git a/frontend/unicode_support.c b/frontend/unicode_support.c
index 96ea5a4..1c1110e 100644
--- a/frontend/unicode_support.c
+++ b/frontend/unicode_support.c
@@ -102,7 +102,7 @@ void init_commandline_arguments_utf8(int *argc, char ***argv)
 		fprintf(stderr, "\nFATAL: Malloc failed\n\n");
 		exit(-1);
 	}
-	
+
 	for(i = 0; i < nArgs; i++)
 	{
 		(*argv)[i] = utf16_to_utf8(szArglist[i]);
@@ -119,7 +119,7 @@ void init_commandline_arguments_utf8(int *argc, char ***argv)
 void free_commandline_arguments_utf8(int *argc, char ***argv)
 {
 	int i = 0;
-	
+
 	if(*argv != NULL)
 	{
 		for(i = 0; i < *argc; i++)
@@ -140,7 +140,7 @@ FILE *fopen_utf8(const char *filename_utf8, const char *mode_utf8)
 	FILE *ret = NULL;
 	wchar_t *filename_utf16 = utf8_to_utf16(filename_utf8);
 	wchar_t *mode_utf16 = utf8_to_utf16(mode_utf8);
-	
+
 	if(filename_utf16 && mode_utf16)
 	{
 		ret = _wfopen(filename_utf16, mode_utf16);
diff --git a/include/faad.h b/include/faad.h
index 72f4072..0fc399c 100644
--- a/include/faad.h
+++ b/include/faad.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/include/neaacdec.h b/include/neaacdec.h
index 15bbbb9..8d52f74 100644
--- a/include/neaacdec.h
+++ b/include/neaacdec.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/analysis.h b/libfaad/analysis.h
index 50e43fa..a0a98e4 100644
--- a/libfaad/analysis.h
+++ b/libfaad/analysis.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/bits.c b/libfaad/bits.c
index 4c0de24..22c661d 100644
--- a/libfaad/bits.c
+++ b/libfaad/bits.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/bits.h b/libfaad/bits.h
index e303e8e..c34dfe7 100644
--- a/libfaad/bits.h
+++ b/libfaad/bits.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/cfft.c b/libfaad/cfft.c
index cf18a91..bc1b5fc 100644
--- a/libfaad/cfft.c
+++ b/libfaad/cfft.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/cfft.h b/libfaad/cfft.h
index dc89cdc..312def9 100644
--- a/libfaad/cfft.h
+++ b/libfaad/cfft.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/cfft_tab.h b/libfaad/cfft_tab.h
index 80b1b75..1a0a342 100644
--- a/libfaad/cfft_tab.h
+++ b/libfaad/cfft_tab.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/codebook/hcb.h b/libfaad/codebook/hcb.h
index 29bbca4..63c3d9a 100644
--- a/libfaad/codebook/hcb.h
+++ b/libfaad/codebook/hcb.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/codebook/hcb_1.h b/libfaad/codebook/hcb_1.h
index f6632c2..86c7159 100644
--- a/libfaad/codebook/hcb_1.h
+++ b/libfaad/codebook/hcb_1.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/codebook/hcb_10.h b/libfaad/codebook/hcb_10.h
index 87e621d..d31dc81 100644
--- a/libfaad/codebook/hcb_10.h
+++ b/libfaad/codebook/hcb_10.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/codebook/hcb_11.h b/libfaad/codebook/hcb_11.h
index 509a1d6..e181735 100644
--- a/libfaad/codebook/hcb_11.h
+++ b/libfaad/codebook/hcb_11.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/codebook/hcb_2.h b/libfaad/codebook/hcb_2.h
index 8edfe52..0d9fb51 100644
--- a/libfaad/codebook/hcb_2.h
+++ b/libfaad/codebook/hcb_2.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/codebook/hcb_3.h b/libfaad/codebook/hcb_3.h
index e9481e1..6bcf66c 100644
--- a/libfaad/codebook/hcb_3.h
+++ b/libfaad/codebook/hcb_3.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/codebook/hcb_4.h b/libfaad/codebook/hcb_4.h
index c2b43e0..0e5e06e 100644
--- a/libfaad/codebook/hcb_4.h
+++ b/libfaad/codebook/hcb_4.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/codebook/hcb_5.h b/libfaad/codebook/hcb_5.h
index ca7c473..f015641 100644
--- a/libfaad/codebook/hcb_5.h
+++ b/libfaad/codebook/hcb_5.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/codebook/hcb_6.h b/libfaad/codebook/hcb_6.h
index 2181d63..dbbaa42 100644
--- a/libfaad/codebook/hcb_6.h
+++ b/libfaad/codebook/hcb_6.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/codebook/hcb_7.h b/libfaad/codebook/hcb_7.h
index 54c85c1..f680693 100644
--- a/libfaad/codebook/hcb_7.h
+++ b/libfaad/codebook/hcb_7.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/codebook/hcb_8.h b/libfaad/codebook/hcb_8.h
index 6e3f100..751a3ad 100644
--- a/libfaad/codebook/hcb_8.h
+++ b/libfaad/codebook/hcb_8.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/codebook/hcb_9.h b/libfaad/codebook/hcb_9.h
index bdba2c2..37e3fdc 100644
--- a/libfaad/codebook/hcb_9.h
+++ b/libfaad/codebook/hcb_9.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/codebook/hcb_sf.h b/libfaad/codebook/hcb_sf.h
index 3c02b3d..0fc9f59 100644
--- a/libfaad/codebook/hcb_sf.h
+++ b/libfaad/codebook/hcb_sf.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/common.c b/libfaad/common.c
index be08d35..cdfaece 100644
--- a/libfaad/common.c
+++ b/libfaad/common.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/common.h b/libfaad/common.h
index 76722e4..cacd1c4 100644
--- a/libfaad/common.h
+++ b/libfaad/common.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/decoder.c b/libfaad/decoder.c
index 9bed248..c3bbf4c 100644
--- a/libfaad/decoder.c
+++ b/libfaad/decoder.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
@@ -153,6 +153,7 @@ NeAACDecHandle NeAACDecOpen(void)
 
     for (i = 0; i < MAX_CHANNELS; i++)
     {
+        hDecoder->element_id[i] = INVALID_ELEMENT_ID;
         hDecoder->window_shape_prev[i] = 0;
         hDecoder->time_out[i] = NULL;
         hDecoder->fb_intermed[i] = NULL;
@@ -286,7 +287,7 @@ long NeAACDecInit(NeAACDecHandle hpDecoder,
 #endif
 
         faad_initbits(&ld, buffer, buffer_size);
- 
+
 #if 0
         memset(l, 0, sizeof(latm_header));
         is_latm = latmCheck(l, &ld);
diff --git a/libfaad/drc.c b/libfaad/drc.c
index e247d62..f60bf0b 100644
--- a/libfaad/drc.c
+++ b/libfaad/drc.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/drc.h b/libfaad/drc.h
index 49118bc..3e3d823 100644
--- a/libfaad/drc.h
+++ b/libfaad/drc.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/drm_dec.c b/libfaad/drm_dec.c
index 61cb818..fb44a64 100644
--- a/libfaad/drm_dec.c
+++ b/libfaad/drm_dec.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
@@ -49,7 +49,7 @@ typedef const int8_t (*drm_ps_huff_tab)[2];
 
 
 /* binary search huffman tables */
-static const int8_t f_huffman_sa[][2] = 
+static const int8_t f_huffman_sa[][2] =
 {
     { /*0*/ -15, 1 },             /* index 0: 1 bits:  x */
     { 2, 3 },                     /* index 1: 2 bits:  1x */
@@ -67,7 +67,7 @@ static const int8_t f_huffman_sa[][2] =
     { /*-7*/ -22, /*-6*/ -21 }    /* index 13: 7 bits: 111111x */
 };
 
-static const int8_t t_huffman_sa[][2] = 
+static const int8_t t_huffman_sa[][2] =
 {
     { /*0*/ -15, 1 },             /* index 0: 1 bits: x */
     { 2, 3 },                     /* index 1: 2 bits: 1x */
@@ -85,7 +85,7 @@ static const int8_t t_huffman_sa[][2] =
     { /*6*/ -9, /*7*/ -8 }        /* index 13: 9 bits: 11111111x */
 };
 
-static const int8_t f_huffman_pan[][2] = 
+static const int8_t f_huffman_pan[][2] =
 {
     { /*0*/ -15, 1 },             /* index 0: 1 bits: x */
     { /*-1*/ -16, 2 },            /* index 1: 2 bits: 1x */
@@ -117,7 +117,7 @@ static const int8_t f_huffman_pan[][2] =
     { /*12*/ -3, /*14*/ -1 }      /* index 27: 16 bits: 111111111111111x */
 };
 
-static const int8_t t_huffman_pan[][2] = 
+static const int8_t t_huffman_pan[][2] =
 {
     { /*0*/ -15, 1 },             /* index 0: 1 bits: x */
     { /*-1*/ -16, 2 },            /* index 1: 2 bits: 1x */
@@ -150,7 +150,7 @@ static const int8_t t_huffman_pan[][2] =
 };
 
 /* There are 3 classes in the standard but the last 2 are identical */
-static const real_t sa_quant[8][2] = 
+static const real_t sa_quant[8][2] =
 {
     { FRAC_CONST(0.0000), FRAC_CONST(0.0000) },
     { FRAC_CONST(0.0501), FRAC_CONST(0.1778) },
@@ -164,7 +164,7 @@ static const real_t sa_quant[8][2] =
 
 /* We don't need the actual quantizer values */
 #if 0
-static const real_t pan_quant[8][5] = 
+static const real_t pan_quant[8][5] =
 {
     { COEF_CONST(0.0000), COEF_CONST(0.0000), COEF_CONST(0.0000), COEF_CONST(0.0000), COEF_CONST(0.0000) },
     { COEF_CONST(0.1661), COEF_CONST(0.1661), COEF_CONST(0.3322), COEF_CONST(0.3322), COEF_CONST(0.3322) },
@@ -203,35 +203,35 @@ static const real_t pan_pow_2_neg[8][5] = {
 
 /* 2^(pan_quant[x][y]/30) */
 static const real_t pan_pow_2_30_pos[8][5] = {
-    { COEF_CONST(1),           COEF_CONST(1),           COEF_CONST(1),           COEF_CONST(1),           COEF_CONST(1)           }, 
-    { COEF_CONST(1.003845098), COEF_CONST(1.003845098), COEF_CONST(1.007704982), COEF_CONST(1.007704982), COEF_CONST(1.007704982) }, 
-    { COEF_CONST(1.007704982), COEF_CONST(1.007704982), COEF_CONST(1.01546933),  COEF_CONST(1.019373909), COEF_CONST(1.019373909) }, 
-    { COEF_CONST(1.011579706), COEF_CONST(1.01546933),  COEF_CONST(1.023293502), COEF_CONST(1.035142941), COEF_CONST(1.039123167) }, 
+    { COEF_CONST(1),           COEF_CONST(1),           COEF_CONST(1),           COEF_CONST(1),           COEF_CONST(1)           },
+    { COEF_CONST(1.003845098), COEF_CONST(1.003845098), COEF_CONST(1.007704982), COEF_CONST(1.007704982), COEF_CONST(1.007704982) },
+    { COEF_CONST(1.007704982), COEF_CONST(1.007704982), COEF_CONST(1.01546933),  COEF_CONST(1.019373909), COEF_CONST(1.019373909) },
+    { COEF_CONST(1.011579706), COEF_CONST(1.01546933),  COEF_CONST(1.023293502), COEF_CONST(1.035142941), COEF_CONST(1.039123167) },
     { COEF_CONST(1.01546933),  COEF_CONST(1.023293502), COEF_CONST(1.035142941), COEF_CONST(1.051155908), COEF_CONST(1.059252598) },
-    { COEF_CONST(1.019373909), COEF_CONST(1.03117796),  COEF_CONST(1.051155908), COEF_CONST(1.071518432), COEF_CONST(1.0839263)   }, 
-    { COEF_CONST(1.023293502), COEF_CONST(1.043118698), COEF_CONST(1.067414119), COEF_CONST(1.092277933), COEF_CONST(1.113439626) }, 
+    { COEF_CONST(1.019373909), COEF_CONST(1.03117796),  COEF_CONST(1.051155908), COEF_CONST(1.071518432), COEF_CONST(1.0839263)   },
+    { COEF_CONST(1.023293502), COEF_CONST(1.043118698), COEF_CONST(1.067414119), COEF_CONST(1.092277933), COEF_CONST(1.113439626) },
     { COEF_CONST(1.03117796),  COEF_CONST(1.055195268), COEF_CONST(1.0839263),   COEF_CONST(1.113439626), COEF_CONST(1.143756546) }
 };
 
 /* 2^(-pan_quant[x][y]/30) */
 static const real_t pan_pow_2_30_neg[8][5] = {
     { COEF_CONST(1),           COEF_CONST(1),           COEF_CONST(1),           COEF_CONST(1),           COEF_CONST(1)           },
-    { COEF_CONST(0.99616963),  COEF_CONST(0.99616963),  COEF_CONST(0.992353931), COEF_CONST(0.992353931), COEF_CONST(0.99235393)  }, 
-    { COEF_CONST(0.992353931), COEF_CONST(0.992353931), COEF_CONST(0.984766325), COEF_CONST(0.980994305), COEF_CONST(0.980994305) }, 
-    { COEF_CONST(0.988552848), COEF_CONST(0.984766325), COEF_CONST(0.977236734), COEF_CONST(0.966050157), COEF_CONST(0.962349827) }, 
-    { COEF_CONST(0.984766325), COEF_CONST(0.977236734), COEF_CONST(0.966050157), COEF_CONST(0.951333663), COEF_CONST(0.944061881) }, 
-    { COEF_CONST(0.980994305), COEF_CONST(0.969764715), COEF_CONST(0.951333663), COEF_CONST(0.933255062), COEF_CONST(0.922571949) }, 
-    { COEF_CONST(0.977236734), COEF_CONST(0.958663671), COEF_CONST(0.936843519), COEF_CONST(0.915517901), COEF_CONST(0.898117847) }, 
+    { COEF_CONST(0.99616963),  COEF_CONST(0.99616963),  COEF_CONST(0.992353931), COEF_CONST(0.992353931), COEF_CONST(0.99235393)  },
+    { COEF_CONST(0.992353931), COEF_CONST(0.992353931), COEF_CONST(0.984766325), COEF_CONST(0.980994305), COEF_CONST(0.980994305) },
+    { COEF_CONST(0.988552848), COEF_CONST(0.984766325), COEF_CONST(0.977236734), COEF_CONST(0.966050157), COEF_CONST(0.962349827) },
+    { COEF_CONST(0.984766325), COEF_CONST(0.977236734), COEF_CONST(0.966050157), COEF_CONST(0.951333663), COEF_CONST(0.944061881) },
+    { COEF_CONST(0.980994305), COEF_CONST(0.969764715), COEF_CONST(0.951333663), COEF_CONST(0.933255062), COEF_CONST(0.922571949) },
+    { COEF_CONST(0.977236734), COEF_CONST(0.958663671), COEF_CONST(0.936843519), COEF_CONST(0.915517901), COEF_CONST(0.898117847) },
     { COEF_CONST(0.969764715), COEF_CONST(0.947691892), COEF_CONST(0.922571949), COEF_CONST(0.898117847), COEF_CONST(0.874311936) }
 };
 
 static const real_t g_decayslope[MAX_SA_BAND] = {
-    FRAC_CONST(1),   FRAC_CONST(1),   FRAC_CONST(1),   FRAC_CONST(0.95),FRAC_CONST(0.9), FRAC_CONST(0.85), FRAC_CONST(0.8), 
-    FRAC_CONST(0.75),FRAC_CONST(0.7), FRAC_CONST(0.65),FRAC_CONST(0.6), FRAC_CONST(0.55),FRAC_CONST(0.5),  FRAC_CONST(0.45), 
+    FRAC_CONST(1),   FRAC_CONST(1),   FRAC_CONST(1),   FRAC_CONST(0.95),FRAC_CONST(0.9), FRAC_CONST(0.85), FRAC_CONST(0.8),
+    FRAC_CONST(0.75),FRAC_CONST(0.7), FRAC_CONST(0.65),FRAC_CONST(0.6), FRAC_CONST(0.55),FRAC_CONST(0.5),  FRAC_CONST(0.45),
     FRAC_CONST(0.4), FRAC_CONST(0.35),FRAC_CONST(0.3), FRAC_CONST(0.25),FRAC_CONST(0.2), FRAC_CONST(0.15), FRAC_CONST(0.1),
-    FRAC_CONST(0.05),FRAC_CONST(0),   FRAC_CONST(0),   FRAC_CONST(0),   FRAC_CONST(0),   FRAC_CONST(0),    FRAC_CONST(0), 
-    FRAC_CONST(0),   FRAC_CONST(0),   FRAC_CONST(0),   FRAC_CONST(0),   FRAC_CONST(0),   FRAC_CONST(0),    FRAC_CONST(0),  
-    FRAC_CONST(0),   FRAC_CONST(0),   FRAC_CONST(0),   FRAC_CONST(0),   FRAC_CONST(0),   FRAC_CONST(0),    FRAC_CONST(0),   
+    FRAC_CONST(0.05),FRAC_CONST(0),   FRAC_CONST(0),   FRAC_CONST(0),   FRAC_CONST(0),   FRAC_CONST(0),    FRAC_CONST(0),
+    FRAC_CONST(0),   FRAC_CONST(0),   FRAC_CONST(0),   FRAC_CONST(0),   FRAC_CONST(0),   FRAC_CONST(0),    FRAC_CONST(0),
+    FRAC_CONST(0),   FRAC_CONST(0),   FRAC_CONST(0),   FRAC_CONST(0),   FRAC_CONST(0),   FRAC_CONST(0),    FRAC_CONST(0),
     FRAC_CONST(0),   FRAC_CONST(0),   FRAC_CONST(0)
 };
 
@@ -246,18 +246,18 @@ static const real_t sa_sqrt_1_minus[8][2] = {
     { FRAC_CONST(0.929071574),  FRAC_CONST(0)           }
 };
 
-static const uint8_t sa_freq_scale[9] = 
+static const uint8_t sa_freq_scale[9] =
 {
     0, 1, 2, 3, 5, 7, 10, 13, 23
 };
 
-static const uint8_t pan_freq_scale[21] = 
+static const uint8_t pan_freq_scale[21] =
 {
     0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
     11, 12, 13, 14, 15, 18, 22, 26, 32, 64
 };
 
-static const uint8_t pan_quant_class[20] = 
+static const uint8_t pan_quant_class[20] =
 {
     0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
     2, 2, 2, 2, 3, 3, 3, 4, 4, 4
@@ -265,32 +265,32 @@ static const uint8_t pan_quant_class[20] =
 
 /* Inverse mapping lookup */
 static const uint8_t pan_inv_freq[64] = {
-     0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 
-    15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 
+     0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
+    15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18,
     19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
     19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19
 };
 
 static const uint8_t sa_inv_freq[MAX_SA_BAND] = {
     0, 1, 2, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6,
-    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 
-    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 
+    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+    7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
     7, 7, 7, 7, 7, 7, 7
 };
 
-static const real_t filter_coeff[] = 
+static const real_t filter_coeff[] =
 {
     FRAC_CONST(0.65143905754106),
     FRAC_CONST(0.56471812200776),
     FRAC_CONST(0.48954165955695)
 };
 
-static const uint8_t delay_length[3] = 
+static const uint8_t delay_length[3] =
 {
     3, 4, 5
 };
 
-static const real_t delay_fraction[] = 
+static const real_t delay_fraction[] =
 {
     FRAC_CONST(0.43), FRAC_CONST(0.75), FRAC_CONST(0.347)
 };
@@ -534,7 +534,7 @@ static int8_t sa_delta_clip(drm_ps_info *ps, int8_t i)
 }
 
 static int8_t pan_delta_clip(drm_ps_info *ps, int8_t i)
-{   
+{
     if (i < -7) {
         /* printf(" PANminclip %d", i); */
         ps->pan_decode_error = 1;
@@ -547,31 +547,31 @@ static int8_t pan_delta_clip(drm_ps_info *ps, int8_t i)
         return i;
 }
 
-static void drm_ps_delta_decode(drm_ps_info *ps) 
+static void drm_ps_delta_decode(drm_ps_info *ps)
 {
-    uint8_t band;    
+    uint8_t band;
 
-    if (ps->bs_enable_sa) 
-    {    
-        if (ps->bs_sa_dt_flag && !ps->g_last_had_sa) 
-        {        
+    if (ps->bs_enable_sa)
+    {
+        if (ps->bs_sa_dt_flag && !ps->g_last_had_sa)
+        {
             /* wait until we get a DT frame */
             ps->bs_enable_sa = 0;
         } else if (ps->bs_sa_dt_flag) {
             /* DT frame, we have a last frame, so we can decode */
-            ps->g_sa_index[0] = sa_delta_clip(ps, ps->g_prev_sa_index[0]+ps->bs_sa_data[0]);            
+            ps->g_sa_index[0] = sa_delta_clip(ps, ps->g_prev_sa_index[0]+ps->bs_sa_data[0]);
         } else {
             /* DF always decodable */
-            ps->g_sa_index[0] = sa_delta_clip(ps,ps->bs_sa_data[0]);          
+            ps->g_sa_index[0] = sa_delta_clip(ps,ps->bs_sa_data[0]);
         }
-        
+
         for (band = 1; band < DRM_NUM_SA_BANDS; band++)
-        {   
+        {
             if (ps->bs_sa_dt_flag && ps->g_last_had_sa)
             {
                 ps->g_sa_index[band] = sa_delta_clip(ps, ps->g_prev_sa_index[band] + ps->bs_sa_data[band]);
             } else if (!ps->bs_sa_dt_flag) {
-                ps->g_sa_index[band] = sa_delta_clip(ps, ps->g_sa_index[band-1] + ps->bs_sa_data[band]);                
+                ps->g_sa_index[band] = sa_delta_clip(ps, ps->g_sa_index[band-1] + ps->bs_sa_data[band]);
             }
         }
     }
@@ -583,36 +583,36 @@ static void drm_ps_delta_decode(drm_ps_info *ps)
         ps->bs_enable_pan = ps->g_last_had_pan;
         ps->bs_enable_sa = ps->g_last_had_sa;
     }
-    
-       
-    if (ps->bs_enable_sa) 
-    {    
+
+
+    if (ps->bs_enable_sa)
+    {
         if (ps->sa_decode_error) {
             for (band = 0; band < DRM_NUM_SA_BANDS; band++)
-            {   
+            {
                 ps->g_sa_index[band] = ps->g_last_good_sa_index[band];
             }
         } else {
             for (band = 0; band < DRM_NUM_SA_BANDS; band++)
-            {   
+            {
                 ps->g_last_good_sa_index[band] = ps->g_sa_index[band];
             }
         }
     }
-    
-    if (ps->bs_enable_pan) 
+
+    if (ps->bs_enable_pan)
     {
-        if (ps->bs_pan_dt_flag && !ps->g_last_had_pan) 
+        if (ps->bs_pan_dt_flag && !ps->g_last_had_pan)
         {
             ps->bs_enable_pan = 0;
-        }  else if (ps->bs_pan_dt_flag) {   
+        }  else if (ps->bs_pan_dt_flag) {
             ps->g_pan_index[0] = pan_delta_clip(ps,  ps->g_prev_pan_index[0]+ps->bs_pan_data[0]);
         } else {
             ps->g_pan_index[0] = pan_delta_clip(ps, ps->bs_pan_data[0]);
         }
-    
+
         for (band = 1; band < DRM_NUM_PAN_BANDS; band++)
-        {   
+        {
             if (ps->bs_pan_dt_flag && ps->g_last_had_pan)
             {
                 ps->g_pan_index[band] = pan_delta_clip(ps, ps->g_prev_pan_index[band] + ps->bs_pan_data[band]);
@@ -620,23 +620,23 @@ static void drm_ps_delta_decode(drm_ps_info *ps)
                 ps->g_pan_index[band] = pan_delta_clip(ps, ps->g_pan_index[band-1] + ps->bs_pan_data[band]);
             }
         }
- 
+
         if (ps->pan_decode_error) {
             for (band = 0; band < DRM_NUM_PAN_BANDS; band++)
-            {   
+            {
                 ps->g_pan_index[band] = ps->g_last_good_pan_index[band];
             }
         } else {
             for (band = 0; band < DRM_NUM_PAN_BANDS; band++)
-            {   
+            {
                 ps->g_last_good_pan_index[band] = ps->g_pan_index[band];
             }
         }
     }
 }
 
-static void drm_calc_sa_side_signal(drm_ps_info *ps, qmf_t X[38][64]) 
-{      
+static void drm_calc_sa_side_signal(drm_ps_info *ps, qmf_t X[38][64])
+{
     uint8_t s, b, k;
     complex_t qfrac, tmp0, tmp, in, R0;
     real_t peakdiff;
@@ -652,7 +652,7 @@ static void drm_calc_sa_side_signal(drm_ps_info *ps, qmf_t X[38][64])
 
     for (b = 0; b < sa_freq_scale[DRM_NUM_SA_BANDS]; b++)
     {
-        /* set delay indices */    
+        /* set delay indices */
         for (k = 0; k < NUM_OF_LINKS; k++)
             temp_delay_ser[k] = ps->delay_buf_index_ser[k];
 
@@ -660,7 +660,7 @@ static void drm_calc_sa_side_signal(drm_ps_info *ps, qmf_t X[38][64])
         IM(Phi_Fract) = IM(Phi_Fract_Qmf[b]);
 
         for (s = 0; s < NUM_OF_SUBSAMPLES; s++)
-        {            
+        {
             const real_t gamma = REAL_CONST(1.5);
             const real_t sigma = REAL_CONST(1.5625);
 
@@ -695,8 +695,8 @@ static void drm_calc_sa_side_signal(drm_ps_info *ps, qmf_t X[38][64])
             } else {
                 transratio = MUL_R(DIV_R(nrg, MUL_R(peakdiff, gamma)), sigma);
             }
-            
-            for (k = 0; k < NUM_OF_LINKS; k++) 
+
+            for (k = 0; k < NUM_OF_LINKS; k++)
             {
                 new_delay_slopes[k] = MUL_F(g_decayslope[b], filter_coeff[k]);
             }
@@ -708,14 +708,14 @@ static void drm_calc_sa_side_signal(drm_ps_info *ps, qmf_t X[38][64])
             IM(ps->d_buff[0][b]) = IM(ps->d_buff[1][b]);
 
             RE(ps->d_buff[1][b]) = RE(in);
-            IM(ps->d_buff[1][b]) = IM(in);               
+            IM(ps->d_buff[1][b]) = IM(in);
 
             ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Phi_Fract), IM(Phi_Fract));
 
             RE(R0) = RE(tmp);
             IM(R0) = IM(tmp);
 
-            for (k = 0; k < NUM_OF_LINKS; k++) 
+            for (k = 0; k < NUM_OF_LINKS; k++)
             {
                 RE(qfrac) = RE(Q_Fract_allpass_Qmf[b][k]);
                 IM(qfrac) = IM(Q_Fract_allpass_Qmf[b][k]);
@@ -743,19 +743,19 @@ static void drm_calc_sa_side_signal(drm_ps_info *ps, qmf_t X[38][64])
                 if (++temp_delay_ser[k] >= delay_length[k])
                     temp_delay_ser[k] = 0;
             }
-        }       
+        }
     }
 
     for (k = 0; k < NUM_OF_LINKS; k++)
         ps->delay_buf_index_ser[k] = temp_delay_ser[k];
 }
 
-static void drm_add_ambiance(drm_ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38][64]) 
+static void drm_add_ambiance(drm_ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38][64])
 {
-    uint8_t s, b, ifreq, qclass;    
+    uint8_t s, b, ifreq, qclass;
     real_t sa_map[MAX_SA_BAND], sa_dir_map[MAX_SA_BAND], k_sa_map[MAX_SA_BAND], k_sa_dir_map[MAX_SA_BAND];
     real_t new_dir_map, new_sa_map;
-    
+
     if (ps->bs_enable_sa)
     {
         /* Instead of dequantization and mapping, we use an inverse mapping
@@ -770,11 +770,11 @@ static void drm_add_ambiance(drm_ps_info *ps, qmf_t X_left[38][64], qmf_t X_righ
             sa_map[b]  = sa_quant[ps->g_prev_sa_index[ifreq]][qclass];
             new_sa_map = sa_quant[ps->g_sa_index[ifreq]][qclass];
 
-            k_sa_map[b] = MUL_F(inv_f_num_of_subsamples, (new_sa_map - sa_map[b]));    
-            
-            sa_dir_map[b] = sa_sqrt_1_minus[ps->g_prev_sa_index[ifreq]][qclass];                        
+            k_sa_map[b] = MUL_F(inv_f_num_of_subsamples, (new_sa_map - sa_map[b]));
+
+            sa_dir_map[b] = sa_sqrt_1_minus[ps->g_prev_sa_index[ifreq]][qclass];
             new_dir_map   = sa_sqrt_1_minus[ps->g_sa_index[ifreq]][qclass];
-                                                   
+
             k_sa_dir_map[b] = MUL_F(inv_f_num_of_subsamples, (new_dir_map - sa_dir_map[b]));
 
         }
@@ -782,35 +782,35 @@ static void drm_add_ambiance(drm_ps_info *ps, qmf_t X_left[38][64], qmf_t X_righ
         for (s = 0; s < NUM_OF_SUBSAMPLES; s++)
         {
             for (b = 0; b < sa_freq_scale[DRM_NUM_SA_BANDS]; b++)
-            {                
+            {
                 QMF_RE(X_right[s][b]) = MUL_F(QMF_RE(X_left[s][b]), sa_dir_map[b]) - MUL_F(QMF_RE(ps->SA[s][b]), sa_map[b]);
                 QMF_IM(X_right[s][b]) = MUL_F(QMF_IM(X_left[s][b]), sa_dir_map[b]) - MUL_F(QMF_IM(ps->SA[s][b]), sa_map[b]);
                 QMF_RE(X_left[s][b]) = MUL_F(QMF_RE(X_left[s][b]), sa_dir_map[b]) + MUL_F(QMF_RE(ps->SA[s][b]), sa_map[b]);
                 QMF_IM(X_left[s][b]) = MUL_F(QMF_IM(X_left[s][b]), sa_dir_map[b]) + MUL_F(QMF_IM(ps->SA[s][b]), sa_map[b]);
-      
+
                 sa_map[b]     += k_sa_map[b];
                 sa_dir_map[b] += k_sa_dir_map[b];
             }
             for (b = sa_freq_scale[DRM_NUM_SA_BANDS]; b < NUM_OF_QMF_CHANNELS; b++)
-            {                
+            {
                 QMF_RE(X_right[s][b]) = QMF_RE(X_left[s][b]);
                 QMF_IM(X_right[s][b]) = QMF_IM(X_left[s][b]);
             }
         }
-    } 
+    }
     else {
         for (s = 0; s < NUM_OF_SUBSAMPLES; s++)
         {
             for (b = 0; b < NUM_OF_QMF_CHANNELS; b++)
             {
                 QMF_RE(X_right[s][b]) = QMF_RE(X_left[s][b]);
-                QMF_IM(X_right[s][b]) = QMF_IM(X_left[s][b]);                
+                QMF_IM(X_right[s][b]) = QMF_IM(X_left[s][b]);
             }
         }
     }
 }
 
-static void drm_add_pan(drm_ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38][64]) 
+static void drm_add_pan(drm_ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38][64])
 {
     uint8_t s, b, qclass, ifreq;
     real_t tmp, coeff1, coeff2;
@@ -820,7 +820,7 @@ static void drm_add_pan(drm_ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38]
 
     if (ps->bs_enable_pan)
     {
-        for (b = 0; b < NUM_OF_QMF_CHANNELS; b++) 
+        for (b = 0; b < NUM_OF_QMF_CHANNELS; b++)
         {
             /* Instead of dequantization, 20->64 mapping and 2^G(x,y) we do an
                inverse mapping 64->20 and look up the 2^G(x,y) values directly */
@@ -829,7 +829,7 @@ static void drm_add_pan(drm_ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38]
 
             if (ps->g_prev_pan_index[ifreq] >= 0)
             {
-                pan_base[b] = pan_pow_2_pos[ps->g_prev_pan_index[ifreq]][qclass]; 
+                pan_base[b] = pan_pow_2_pos[ps->g_prev_pan_index[ifreq]][qclass];
             } else {
                 pan_base[b] = pan_pow_2_neg[-ps->g_prev_pan_index[ifreq]][qclass];
             }
@@ -838,7 +838,7 @@ static void drm_add_pan(drm_ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38]
             /* a en b can be negative so we may need to inverse parts */
             if (ps->g_pan_index[ifreq] >= 0)
             {
-                if (ps->g_prev_pan_index[ifreq] >= 0) 
+                if (ps->g_prev_pan_index[ifreq] >= 0)
                 {
                     pan_delta[b] = MUL_C(pan_pow_2_30_pos[ps->g_pan_index[ifreq]][qclass],
                                          pan_pow_2_30_neg[ps->g_prev_pan_index[ifreq]][qclass]);
@@ -847,7 +847,7 @@ static void drm_add_pan(drm_ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38]
                                          pan_pow_2_30_pos[-ps->g_prev_pan_index[ifreq]][qclass]);
                 }
             } else {
-                if (ps->g_prev_pan_index[ifreq] >= 0) 
+                if (ps->g_prev_pan_index[ifreq] >= 0)
                 {
                     pan_delta[b] = MUL_C(pan_pow_2_30_neg[-ps->g_pan_index[ifreq]][qclass],
                                          pan_pow_2_30_neg[ps->g_prev_pan_index[ifreq]][qclass]);
@@ -866,7 +866,7 @@ static void drm_add_pan(drm_ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38]
                 tmp = pan_base[b];
 
                 coeff2 = DIV_R(REAL_CONST(2.0), (REAL_CONST(1.0) + tmp));
-                coeff1 = MUL_R(coeff2, tmp);                
+                coeff1 = MUL_R(coeff2, tmp);
 
                 QMF_RE(temp_l) = QMF_RE(X_left[s][b]);
                 QMF_IM(temp_l) = QMF_IM(X_left[s][b]);
@@ -877,20 +877,20 @@ static void drm_add_pan(drm_ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38]
                 QMF_IM(X_left[s][b]) = MUL_R(QMF_IM(temp_l), coeff1);
                 QMF_RE(X_right[s][b]) = MUL_R(QMF_RE(temp_r), coeff2);
                 QMF_IM(X_right[s][b]) = MUL_R(QMF_IM(temp_r), coeff2);
-                
+
                 /* 2^(a+k*b) = 2^a * 2^b * ... * 2^b */
                 /*                   ^^^^^^^^^^^^^^^ k times */
                 pan_base[b] = MUL_C(pan_base[b], pan_delta[b]);
-            }           
-        }       
-    }     
+            }
+        }
+    }
 }
 
 drm_ps_info *drm_ps_init(void)
 {
     drm_ps_info *ps = (drm_ps_info*)faad_malloc(sizeof(drm_ps_info));
 
-    memset(ps, 0, sizeof(drm_ps_info));     
+    memset(ps, 0, sizeof(drm_ps_info));
 
     return ps;
 }
@@ -902,14 +902,14 @@ void drm_ps_free(drm_ps_info *ps)
 
 /* main DRM PS decoding function */
 uint8_t drm_ps_decode(drm_ps_info *ps, uint8_t guess, qmf_t X_left[38][64], qmf_t X_right[38][64])
-{       
-    if (ps == NULL) 
+{
+    if (ps == NULL)
     {
         memcpy(X_right, X_left, sizeof(qmf_t)*30*64);
-        return 0;    
-    }     
+        return 0;
+    }
 
-    if (!ps->drm_ps_data_available && !guess) 
+    if (!ps->drm_ps_data_available && !guess)
     {
         memcpy(X_right, X_left, sizeof(qmf_t)*30*64);
         memset(ps->g_prev_sa_index, 0, sizeof(ps->g_prev_sa_index));
@@ -924,13 +924,13 @@ uint8_t drm_ps_decode(drm_ps_info *ps, uint8_t guess, qmf_t X_left[38][64], qmf_
         ps->sa_decode_error = 0;
         ps->pan_decode_error = 0;
         drm_ps_delta_decode(ps);
-    } else 
+    } else
     {
         ps->sa_decode_error = 1;
         ps->pan_decode_error = 1;
         /* don't even bother decoding */
     }
-  
+
     ps->drm_ps_data_available = 0;
 
     drm_calc_sa_side_signal(ps, X_left);
@@ -938,19 +938,19 @@ uint8_t drm_ps_decode(drm_ps_info *ps, uint8_t guess, qmf_t X_left[38][64], qmf_
 
     if (ps->bs_enable_sa)
     {
-        ps->g_last_had_sa = 1;        
+        ps->g_last_had_sa = 1;
 
-        memcpy(ps->g_prev_sa_index, ps->g_sa_index, sizeof(int8_t) * DRM_NUM_SA_BANDS);       
+        memcpy(ps->g_prev_sa_index, ps->g_sa_index, sizeof(int8_t) * DRM_NUM_SA_BANDS);
 
     } else {
         ps->g_last_had_sa = 0;
     }
-    
+
     if (ps->bs_enable_pan)
     {
         drm_add_pan(ps, X_left, X_right);
-    
-        ps->g_last_had_pan = 1;        
+
+        ps->g_last_had_pan = 1;
 
         memcpy(ps->g_prev_pan_index, ps->g_pan_index, sizeof(int8_t) * DRM_NUM_PAN_BANDS);
 
diff --git a/libfaad/drm_dec.h b/libfaad/drm_dec.h
index d0ac995..f644116 100644
--- a/libfaad/drm_dec.h
+++ b/libfaad/drm_dec.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
@@ -48,7 +48,7 @@ extern "C" {
 #define MAX_DELAY                5
 
 typedef struct
-{   
+{
     uint8_t drm_ps_data_available;
     uint8_t bs_enable_sa;
     uint8_t bs_enable_pan;
@@ -61,28 +61,28 @@ typedef struct
 
     int8_t bs_sa_data[DRM_NUM_SA_BANDS];
     int8_t bs_pan_data[DRM_NUM_PAN_BANDS];
-        
+
     int8_t g_sa_index[DRM_NUM_SA_BANDS];
-    int8_t g_pan_index[DRM_NUM_PAN_BANDS];                        
+    int8_t g_pan_index[DRM_NUM_PAN_BANDS];
     int8_t g_prev_sa_index[DRM_NUM_SA_BANDS];
-    int8_t g_prev_pan_index[DRM_NUM_PAN_BANDS];    
+    int8_t g_prev_pan_index[DRM_NUM_PAN_BANDS];
 
     int8_t sa_decode_error;
     int8_t pan_decode_error;
 
     int8_t g_last_good_sa_index[DRM_NUM_SA_BANDS];
     int8_t g_last_good_pan_index[DRM_NUM_PAN_BANDS];
-    
-    qmf_t SA[NUM_OF_SUBSAMPLES][MAX_SA_BAND];               
+
+    qmf_t SA[NUM_OF_SUBSAMPLES][MAX_SA_BAND];
 
     complex_t d_buff[2][MAX_SA_BAND];
     complex_t d2_buff[NUM_OF_LINKS][MAX_DELAY][MAX_SA_BAND];
 
-    uint8_t delay_buf_index_ser[NUM_OF_LINKS];    
-            
+    uint8_t delay_buf_index_ser[NUM_OF_LINKS];
+
     real_t prev_nrg[MAX_SA_BAND];
     real_t prev_peakdiff[MAX_SA_BAND];
-    real_t peakdecay_fast[MAX_SA_BAND]; 
+    real_t peakdecay_fast[MAX_SA_BAND];
 } drm_ps_info;
 
 
diff --git a/libfaad/error.c b/libfaad/error.c
index 8984a83..4f844e6 100644
--- a/libfaad/error.c
+++ b/libfaad/error.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/error.h b/libfaad/error.h
index 0e79423..b559da4 100644
--- a/libfaad/error.h
+++ b/libfaad/error.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/filtbank.c b/libfaad/filtbank.c
index 1b1464b..857194f 100644
--- a/libfaad/filtbank.c
+++ b/libfaad/filtbank.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/filtbank.h b/libfaad/filtbank.h
index de0149c..8fd331d 100644
--- a/libfaad/filtbank.h
+++ b/libfaad/filtbank.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/fixed.h b/libfaad/fixed.h
index 5315837..7990601 100644
--- a/libfaad/fixed.h
+++ b/libfaad/fixed.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/hcr.c b/libfaad/hcr.c
index 3cefe60..4ae4809 100644
--- a/libfaad/hcr.c
+++ b/libfaad/hcr.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
@@ -37,15 +37,15 @@
 #include "specrec.h"
 #include "huffman.h"
 
-/* ISO/IEC 14496-3/Amd.1 
- * 8.5.3.3: Huffman Codeword Reordering for AAC spectral data (HCR) 
+/* ISO/IEC 14496-3/Amd.1
+ * 8.5.3.3: Huffman Codeword Reordering for AAC spectral data (HCR)
  *
- * HCR devides the spectral data in known fixed size segments, and 
- * sorts it by the importance of the data. The importance is firstly 
- * the (lower) position in the spectrum, and secondly the largest 
- * value in the used codebook. 
+ * HCR devides the spectral data in known fixed size segments, and
+ * sorts it by the importance of the data. The importance is firstly
+ * the (lower) position in the spectrum, and secondly the largest
+ * value in the used codebook.
  * The most important data is written at the start of each segment
- * (at known positions), the remaining data is interleaved inbetween, 
+ * (at known positions), the remaining data is interleaved inbetween,
  * with the writing direction alternating.
  * Data length is not increased.
 */
@@ -60,10 +60,10 @@
 #define VCB11_FIRST 16
 #define VCB11_LAST  31
 
-static const uint8_t PreSortCB_STD[NUM_CB] = 
+static const uint8_t PreSortCB_STD[NUM_CB] =
     { 11, 9, 7, 5, 3, 1};
 
-static const uint8_t PreSortCB_ER[NUM_CB_ER] = 
+static const uint8_t PreSortCB_ER[NUM_CB_ER] =
     { 11, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 9, 7, 5, 3, 1};
 
 /* 8.5.3.3.2 Derivation of segment width */
@@ -74,7 +74,7 @@ static const uint8_t maxCwLen[MAX_CB] = {0, 11, 9, 20, 16, 13, 11, 14, 12, 17, 1
 #define segmentWidth(cb)    min(maxCwLen[cb], ics->length_of_longest_codeword)
 
 /* bit-twiddling helpers */
-static const uint8_t  S[] = {1, 2, 4, 8, 16};    
+static const uint8_t  S[] = {1, 2, 4, 8, 16};
 static const uint32_t B[] = {0x55555555, 0x33333333, 0x0F0F0F0F, 0x00FF00FF, 0x0000FFFF};
 
 typedef struct
@@ -88,11 +88,11 @@ typedef struct
 /* rewind and reverse */
 /* 32 bit version */
 static uint32_t rewrev_word(uint32_t v, const uint8_t len)
-{  
+{
     /* 32 bit reverse */
-    v = ((v >> S[0]) & B[0]) | ((v << S[0]) & ~B[0]); 
-    v = ((v >> S[1]) & B[1]) | ((v << S[1]) & ~B[1]); 
-    v = ((v >> S[2]) & B[2]) | ((v << S[2]) & ~B[2]); 
+    v = ((v >> S[0]) & B[0]) | ((v << S[0]) & ~B[0]);
+    v = ((v >> S[1]) & B[1]) | ((v << S[1]) & ~B[1]);
+    v = ((v >> S[2]) & B[2]) | ((v << S[2]) & ~B[2]);
     v = ((v >> S[3]) & B[3]) | ((v << S[3]) & ~B[3]);
     v = ((v >> S[4]) & B[4]) | ((v << S[4]) & ~B[4]);
 
@@ -104,7 +104,7 @@ static uint32_t rewrev_word(uint32_t v, const uint8_t len)
 
 /* 64 bit version */
 static void rewrev_lword(uint32_t *hi, uint32_t *lo, const uint8_t len)
-{   
+{
     if (len <= 32) {
         *hi = 0;
         *lo = rewrev_word(*lo, len);
@@ -113,22 +113,22 @@ static void rewrev_lword(uint32_t *hi, uint32_t *lo, const uint8_t len)
         uint32_t t = *hi, v = *lo;
 
         /* double 32 bit reverse */
-        v = ((v >> S[0]) & B[0]) | ((v << S[0]) & ~B[0]); 
-        t = ((t >> S[0]) & B[0]) | ((t << S[0]) & ~B[0]); 
-        v = ((v >> S[1]) & B[1]) | ((v << S[1]) & ~B[1]); 
-        t = ((t >> S[1]) & B[1]) | ((t << S[1]) & ~B[1]); 
-        v = ((v >> S[2]) & B[2]) | ((v << S[2]) & ~B[2]); 
-        t = ((t >> S[2]) & B[2]) | ((t << S[2]) & ~B[2]); 
+        v = ((v >> S[0]) & B[0]) | ((v << S[0]) & ~B[0]);
+        t = ((t >> S[0]) & B[0]) | ((t << S[0]) & ~B[0]);
+        v = ((v >> S[1]) & B[1]) | ((v << S[1]) & ~B[1]);
+        t = ((t >> S[1]) & B[1]) | ((t << S[1]) & ~B[1]);
+        v = ((v >> S[2]) & B[2]) | ((v << S[2]) & ~B[2]);
+        t = ((t >> S[2]) & B[2]) | ((t << S[2]) & ~B[2]);
         v = ((v >> S[3]) & B[3]) | ((v << S[3]) & ~B[3]);
         t = ((t >> S[3]) & B[3]) | ((t << S[3]) & ~B[3]);
-        v = ((v >> S[4]) & B[4]) | ((v << S[4]) & ~B[4]);                
+        v = ((v >> S[4]) & B[4]) | ((v << S[4]) & ~B[4]);
         t = ((t >> S[4]) & B[4]) | ((t << S[4]) & ~B[4]);
 
         /* last 32<>32 bit swap is implicit below */
-        
+
         /* shift off low bits (this is really only one 64 bit shift) */
         *lo = (t >> (64 - len)) | (v << (len - 32));
-        *hi = v >> (64 - len);          
+        *hi = v >> (64 - len);
     }
 }
 
@@ -150,7 +150,7 @@ static void concat_bits(bits_t *b, bits_t *a)
 
     al = a->bufa;
     ah = a->bufb;
-    
+
     if (b->len > 32)
     {
         /* maskoff superfluous high b bits */
@@ -161,7 +161,7 @@ static void concat_bits(bits_t *b, bits_t *a)
         al = 0;
     } else {
         bl = b->bufa & ((1 << (b->len)) - 1);
-        bh = 0;   
+        bh = 0;
         ah = (ah << (b->len)) | (al >> (32 - b->len));
         al = al << b->len;
     }
@@ -172,7 +172,7 @@ static void concat_bits(bits_t *b, bits_t *a)
 
     b->len += a->len;
 }
-     
+
 static uint8_t is_good_cb(uint8_t this_CB, uint8_t this_sec_CB)
 {
     /* only want spectral data CB's */
@@ -190,20 +190,20 @@ static uint8_t is_good_cb(uint8_t this_CB, uint8_t this_sec_CB)
     }
     return 0;
 }
-                    
+
 static void read_segment(bits_t *segment, uint8_t segwidth, bitfile *ld)
 {
     segment->len = segwidth;
 
      if (segwidth > 32)
      {
-        segment->bufb = faad_getbits(ld, segwidth - 32);        
-        segment->bufa = faad_getbits(ld, 32);        
+        segment->bufb = faad_getbits(ld, segwidth - 32);
+        segment->bufa = faad_getbits(ld, 32);
 
     } else {
         segment->bufa = faad_getbits(ld, segwidth);
-        segment->bufb = 0;        
-    }    
+        segment->bufb = 0;
+    }
 }
 
 static void fill_in_codeword(codeword_t *codeword, uint16_t index, uint16_t sp, uint8_t cb)
@@ -214,11 +214,11 @@ static void fill_in_codeword(codeword_t *codeword, uint16_t index, uint16_t sp,
     codeword[index].bits.len = 0;
 }
 
-uint8_t reordered_spectral_data(NeAACDecStruct *hDecoder, ic_stream *ics, 
+uint8_t reordered_spectral_data(NeAACDecStruct *hDecoder, ic_stream *ics,
                                 bitfile *ld, int16_t *spectral_data)
-{   
+{
     uint16_t PCWs_done;
-    uint16_t numberOfSegments, numberOfSets, numberOfCodewords;  
+    uint16_t numberOfSegments, numberOfSets, numberOfCodewords;
 
     codeword_t codeword[512];
     bits_t segment[512];
@@ -226,11 +226,11 @@ uint8_t reordered_spectral_data(NeAACDecStruct *hDecoder, ic_stream *ics,
     uint16_t sp_offset[8];
     uint16_t g, i, sortloop, set, bitsread;
     /*uint16_t bitsleft, codewordsleft*/;
-    uint8_t w_idx, sfb, this_CB, last_CB, this_sec_CB; 
-    
+    uint8_t w_idx, sfb, this_CB, last_CB, this_sec_CB;
+
     const uint16_t nshort = hDecoder->frameLength/8;
     const uint16_t sp_data_len = ics->length_of_reordered_spectral_data;
-    
+
     const uint8_t *PreSortCb;
 
     /* no data (e.g. silence) */
@@ -242,7 +242,7 @@ uint8_t reordered_spectral_data(NeAACDecStruct *hDecoder, ic_stream *ics,
         return 10;
 
     if (sp_data_len < ics->length_of_longest_codeword)
-        return 10; 
+        return 10;
 
     sp_offset[0] = 0;
     for (g = 1; g < ics->num_window_groups; g++)
@@ -265,13 +265,13 @@ uint8_t reordered_spectral_data(NeAACDecStruct *hDecoder, ic_stream *ics,
         PreSortCb = PreSortCB_STD;
         last_CB = NUM_CB;
     }
- 
+
     /* step 1: decode PCW's (set 0), and stuff data in easier-to-use format */
     for (sortloop = 0; sortloop < last_CB; sortloop++)
     {
         /* select codebook to process this pass */
         this_CB = PreSortCb[sortloop];
-        
+
         /* loop over sfbs */
         for (sfb = 0; sfb < ics->max_sfb; sfb++)
         {
@@ -284,34 +284,34 @@ uint8_t reordered_spectral_data(NeAACDecStruct *hDecoder, ic_stream *ics,
                     {
                         /* check whether sfb used here is the one we want to process */
                         if ((ics->sect_start[g][i] <= sfb) && (ics->sect_end[g][i] > sfb))
-                        {                            
+                        {
                             /* check whether codebook used here is the one we want to process */
                             this_sec_CB = ics->sect_cb[g][i];
-                 
-                            if (is_good_cb(this_CB, this_sec_CB))                              
+
+                            if (is_good_cb(this_CB, this_sec_CB))
                             {
                                 /* precalculate some stuff */
                                 uint16_t sect_sfb_size = ics->sect_sfb_offset[g][sfb+1] - ics->sect_sfb_offset[g][sfb];
                                 uint8_t inc = (this_sec_CB < FIRST_PAIR_HCB) ? QUAD_LEN : PAIR_LEN;
                                 uint16_t group_cws_count = (4*ics->window_group_length[g])/inc;
                                 uint8_t segwidth = segmentWidth(this_sec_CB);
-                                uint16_t cws;                                
+                                uint16_t cws;
 
-                                /* read codewords until end of sfb or end of window group (shouldn't only 1 trigger?) */                                 
+                                /* read codewords until end of sfb or end of window group (shouldn't only 1 trigger?) */
                                 for (cws = 0; (cws < group_cws_count) && ((cws + w_idx*group_cws_count) < sect_sfb_size); cws++)
                                 {
-                                    uint16_t sp = sp_offset[g] + ics->sect_sfb_offset[g][sfb] + inc * (cws + w_idx*group_cws_count);                                   
+                                    uint16_t sp = sp_offset[g] + ics->sect_sfb_offset[g][sfb] + inc * (cws + w_idx*group_cws_count);
 
                                     /* read and decode PCW */
                                     if (!PCWs_done)
-                                    {         
+                                    {
                                         /* read in normal segments */
                                         if (bitsread + segwidth <= sp_data_len)
-                                        {                                            
-                                            read_segment(&segment[numberOfSegments], segwidth, ld);                          
+                                        {
+                                            read_segment(&segment[numberOfSegments], segwidth, ld);
                                             bitsread += segwidth;
-                                            
-                                            huffman_spectral_data_2(this_sec_CB, &segment[numberOfSegments], &spectral_data[sp]);                                            
+
+                                            huffman_spectral_data_2(this_sec_CB, &segment[numberOfSegments], &spectral_data[sp]);
 
                                             /* keep leftover bits */
                                             rewrev_bits(&segment[numberOfSegments]);
@@ -322,48 +322,48 @@ uint8_t reordered_spectral_data(NeAACDecStruct *hDecoder, ic_stream *ics,
                                                this in earlier because it might not fit in 64 bits. since we already
                                                decoded (and removed) the PCW it is now guaranteed to fit */
                                             if (bitsread < sp_data_len)
-                                            {                                                
-                                                const uint8_t additional_bits = sp_data_len - bitsread;                                               
+                                            {
+                                                const uint8_t additional_bits = sp_data_len - bitsread;
 
-                                                read_segment(&segment[numberOfSegments], additional_bits, ld);                                                
+                                                read_segment(&segment[numberOfSegments], additional_bits, ld);
                                                 segment[numberOfSegments].len += segment[numberOfSegments-1].len;
-                                                rewrev_bits(&segment[numberOfSegments]);                                               
+                                                rewrev_bits(&segment[numberOfSegments]);
 
                                                 if (segment[numberOfSegments-1].len > 32)
                                                 {
-                                                    segment[numberOfSegments-1].bufb = segment[numberOfSegments].bufb + 
+                                                    segment[numberOfSegments-1].bufb = segment[numberOfSegments].bufb +
                                                         showbits_hcr(&segment[numberOfSegments-1], segment[numberOfSegments-1].len - 32);
-                                                    segment[numberOfSegments-1].bufa = segment[numberOfSegments].bufa + 
+                                                    segment[numberOfSegments-1].bufa = segment[numberOfSegments].bufa +
                                                         showbits_hcr(&segment[numberOfSegments-1], 32);
                                                 } else {
-                                                    segment[numberOfSegments-1].bufa = segment[numberOfSegments].bufa + 
+                                                    segment[numberOfSegments-1].bufa = segment[numberOfSegments].bufa +
                                                         showbits_hcr(&segment[numberOfSegments-1], segment[numberOfSegments-1].len);
                                                     segment[numberOfSegments-1].bufb = segment[numberOfSegments].bufb;
-                                                }                                                
+                                                }
                                                 segment[numberOfSegments-1].len += additional_bits;
                                             }
                                             bitsread = sp_data_len;
                                             PCWs_done = 1;
 
-                                            fill_in_codeword(codeword, 0, sp, this_sec_CB);                                            
+                                            fill_in_codeword(codeword, 0, sp, this_sec_CB);
                                         }
-                                    } else {    
-                                        fill_in_codeword(codeword, numberOfCodewords - numberOfSegments, sp, this_sec_CB);                                         
+                                    } else {
+                                        fill_in_codeword(codeword, numberOfCodewords - numberOfSegments, sp, this_sec_CB);
                                     }
                                     numberOfCodewords++;
-                                }                             
+                                }
                             }
                         }
-                    } 
-                 } 
+                    }
+                 }
              }
          }
     }
 
     if (numberOfSegments == 0)
-        return 10; 
+        return 10;
 
-    numberOfSets = numberOfCodewords / numberOfSegments;     
+    numberOfSets = numberOfCodewords / numberOfSegments;
 
     /* step 2: decode nonPCWs */
     for (set = 1; set <= numberOfSets; set++)
@@ -386,21 +386,21 @@ uint8_t reordered_spectral_data(NeAACDecStruct *hDecoder, ic_stream *ics,
                 {
                     uint8_t tmplen;
 
-                    if (codeword[codeword_idx].bits.len != 0)                   
-                        concat_bits(&segment[segment_idx], &codeword[codeword_idx].bits);                            
-                    
+                    if (codeword[codeword_idx].bits.len != 0)
+                        concat_bits(&segment[segment_idx], &codeword[codeword_idx].bits);
+
                     tmplen = segment[segment_idx].len;
 
                     if (huffman_spectral_data_2(codeword[codeword_idx].cb, &segment[segment_idx],
                                                &spectral_data[codeword[codeword_idx].sp_offset]) >= 0)
                     {
                         codeword[codeword_idx].decoded = 1;
-                    } else 
-                    {   
+                    } else
+                    {
                         codeword[codeword_idx].bits = segment[segment_idx];
-                        codeword[codeword_idx].bits.len = tmplen;                        
+                        codeword[codeword_idx].bits.len = tmplen;
                     }
-                                            
+
                 }
             }
         }
@@ -409,8 +409,8 @@ uint8_t reordered_spectral_data(NeAACDecStruct *hDecoder, ic_stream *ics,
     }
 
 #if 0 // Seems to give false errors
-    bitsleft = 0;    
-        
+    bitsleft = 0;
+
     for (i = 0; i < numberOfSegments && !bitsleft; i++)
         bitsleft += segment[i].len;
 
@@ -418,9 +418,9 @@ uint8_t reordered_spectral_data(NeAACDecStruct *hDecoder, ic_stream *ics,
 
     codewordsleft = 0;
 
-    for (i = 0; (i < numberOfCodewords - numberOfSegments) && (!codewordsleft); i++)    
-        if (!codeword[i].decoded)            
-                codewordsleft++; 
+    for (i = 0; (i < numberOfCodewords - numberOfSegments) && (!codewordsleft); i++)
+        if (!codeword[i].decoded)
+                codewordsleft++;
 
     if (codewordsleft) return 10;
 #endif
diff --git a/libfaad/huffman.c b/libfaad/huffman.c
index e2656c0..74d9c8a 100644
--- a/libfaad/huffman.c
+++ b/libfaad/huffman.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
@@ -43,7 +43,7 @@
 
 /* static function declarations */
 static INLINE void huffman_sign_bits(bitfile *ld, int16_t *sp, uint8_t len);
-static INLINE int16_t huffman_getescape(bitfile *ld, int16_t sp);
+static INLINE uint8_t huffman_getescape(bitfile *ld, int16_t *sp);
 static uint8_t huffman_2step_quad(uint8_t cb, bitfile *ld, int16_t *sp);
 static uint8_t huffman_2step_quad_sign(uint8_t cb, bitfile *ld, int16_t *sp);
 static uint8_t huffman_2step_pair(uint8_t cb, bitfile *ld, int16_t *sp);
@@ -121,24 +121,25 @@ static INLINE void huffman_sign_bits(bitfile *ld, int16_t *sp, uint8_t len)
     }
 }
 
-static INLINE int16_t huffman_getescape(bitfile *ld, int16_t sp)
+static INLINE uint8_t huffman_getescape(bitfile *ld, int16_t *sp)
 {
     uint8_t neg, i;
     int16_t j;
 	int16_t off;
+    int16_t x = *sp;
 
-    if (sp < 0)
+    if (x < 0)
     {
-        if (sp != -16)
-            return sp;
+        if (x != -16)
+            return 0;
         neg = 1;
     } else {
-        if (sp != 16)
-            return sp;
+        if (x != 16)
+            return 0;
         neg = 0;
     }
 
-    for (i = 4; ; i++)
+    for (i = 4; i < 16; i++)
     {
         if (faad_get1bit(ld
             DEBUGVAR(1,6,"huffman_getescape(): escape size")) == 0)
@@ -146,6 +147,8 @@ static INLINE int16_t huffman_getescape(bitfile *ld, int16_t sp)
             break;
         }
     }
+    if (i >= 16)
+        return 10;
 
     off = (int16_t)faad_getbits(ld, i
         DEBUGVAR(1,9,"huffman_getescape(): escape"));
@@ -154,7 +157,8 @@ static INLINE int16_t huffman_getescape(bitfile *ld, int16_t sp)
     if (neg)
         j = -j;
 
-    return j;
+    *sp = j;
+    return 0;
 }
 
 static uint8_t huffman_2step_quad(uint8_t cb, bitfile *ld, int16_t *sp)
@@ -357,13 +361,15 @@ uint8_t huffman_spectral_data(uint8_t cb, bitfile *ld, int16_t *sp)
         return huffman_2step_pair_sign(cb, ld, sp);
     case 12: {
         uint8_t err = huffman_2step_pair(11, ld, sp);
-        sp[0] = huffman_codebook(0); sp[1] = huffman_codebook(1); 
+        sp[0] = huffman_codebook(0); sp[1] = huffman_codebook(1);
         return err; }
     case 11:
     {
         uint8_t err = huffman_2step_pair_sign(11, ld, sp);
-        sp[0] = huffman_getescape(ld, sp[0]);
-        sp[1] = huffman_getescape(ld, sp[1]);
+        if (!err)
+            err = huffman_getescape(ld, &sp[0]);
+        if (!err)
+            err = huffman_getescape(ld, &sp[1]);
         return err;
     }
 #ifdef ERROR_RESILIENCE
@@ -372,8 +378,10 @@ uint8_t huffman_spectral_data(uint8_t cb, bitfile *ld, int16_t *sp)
     case 24: case 25: case 26: case 27: case 28: case 29: case 30: case 31:
     {
         uint8_t err = huffman_2step_pair_sign(11, ld, sp);
-        sp[0] = huffman_getescape(ld, sp[0]);
-        sp[1] = huffman_getescape(ld, sp[1]);
+        if (!err)
+            err = huffman_getescape(ld, &sp[0]);
+        if (!err)
+            err = huffman_getescape(ld, &sp[1]);
 
         /* check LAV (Largest Absolute Value) */
         /* this finds errors in the ESCAPE signal */
@@ -446,7 +454,7 @@ int8_t huffman_spectral_data_2(uint8_t cb, bits_t *ld, int16_t *sp)
             vcb11 = cb;
             cb = 11;
         }
-            
+
         cw = showbits_hcr(ld, hcbN[cb]);
         offset = hcb_table[cb][cw].offset;
         extra_bits = hcb_table[cb][cw].extra_bits;
@@ -469,7 +477,7 @@ int8_t huffman_spectral_data_2(uint8_t cb, bits_t *ld, int16_t *sp)
         while (!hcb3[offset].is_leaf)
         {
             uint8_t b;
-            
+
             if ( get1bit_hcr(ld, &b) ) return -1;
             offset += hcb3[offset].data[b];
         }
@@ -488,7 +496,7 @@ int8_t huffman_spectral_data_2(uint8_t cb, bits_t *ld, int16_t *sp)
         while (!hcb_bin_table[cb][offset].is_leaf)
         {
             uint8_t b;
-            
+
             if (get1bit_hcr(ld, &b) ) return -1;
             offset += hcb_bin_table[cb][offset].data[b];
         }
@@ -527,7 +535,7 @@ int8_t huffman_spectral_data_2(uint8_t cb, bits_t *ld, int16_t *sp)
                 int32_t j;
                 uint32_t off;
 
-                neg = (sp[k] < 0) ? 1 : 0; 
+                neg = (sp[k] < 0) ? 1 : 0;
 
                 for (i = 4; ; i++)
                 {
@@ -551,7 +559,7 @@ int8_t huffman_spectral_data_2(uint8_t cb, bits_t *ld, int16_t *sp)
             /* this finds errors in the ESCAPE signal */
             vcb11_check_LAV(vcb11, sp);
         }
-    }    
+    }
     return ld->len;
 }
 
diff --git a/libfaad/huffman.h b/libfaad/huffman.h
index f8bcb23..662f359 100644
--- a/libfaad/huffman.h
+++ b/libfaad/huffman.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/ic_predict.c b/libfaad/ic_predict.c
index 70027ba..f5bc134 100644
--- a/libfaad/ic_predict.c
+++ b/libfaad/ic_predict.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
@@ -54,7 +54,7 @@ static void flt_round(float32_t *pf)
         tmp |= (uint32_t)0x00010000;       /* insert 1 lsb */
         tmp2 = tmp;                             /* add 1 lsb and elided one */
         tmp &= (uint32_t)0xff800000;       /* extract exponent and sign */
-        
+
         *pf = *(float32_t*)&tmp1 + *(float32_t*)&tmp2 - *(float32_t*)&tmp;
     } else {
         *pf = *(float32_t*)&tmp;
diff --git a/libfaad/ic_predict.h b/libfaad/ic_predict.h
index e69cd11..60cf6a8 100644
--- a/libfaad/ic_predict.h
+++ b/libfaad/ic_predict.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/iq_table.h b/libfaad/iq_table.h
index 3cc2b80..feac6a6 100644
--- a/libfaad/iq_table.h
+++ b/libfaad/iq_table.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/is.c b/libfaad/is.c
index 5236db0..6faaac9 100644
--- a/libfaad/is.c
+++ b/libfaad/is.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/is.h b/libfaad/is.h
index 3e3b750..6a8d289 100644
--- a/libfaad/is.h
+++ b/libfaad/is.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/kbd_win.h b/libfaad/kbd_win.h
index de404c7..5f3a84b 100644
--- a/libfaad/kbd_win.h
+++ b/libfaad/kbd_win.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/lt_predict.c b/libfaad/lt_predict.c
index 2be18ae..105389b 100644
--- a/libfaad/lt_predict.c
+++ b/libfaad/lt_predict.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/lt_predict.h b/libfaad/lt_predict.h
index 117f834..9ca5e73 100644
--- a/libfaad/lt_predict.h
+++ b/libfaad/lt_predict.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/mdct.c b/libfaad/mdct.c
index 247691e..954990b 100644
--- a/libfaad/mdct.c
+++ b/libfaad/mdct.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
@@ -32,11 +32,11 @@
  * Fast (I)MDCT Implementation using (I)FFT ((Inverse) Fast Fourier Transform)
  * and consists of three steps: pre-(I)FFT complex multiplication, complex
  * (I)FFT, post-(I)FFT complex multiplication,
- * 
+ *
  * As described in:
  *  P. Duhamel, Y. Mahieux, and J.P. Petit, "A Fast Algorithm for the
  *  Implementation of Filter Banks Based on 'Time Domain Aliasing
- *  Cancellation�," IEEE Proc. on ICASSP�91, 1991, pp. 2209-2212.
+ *  Cancellation'," IEEE Proc. on ICASSP'91, 1991, pp. 2209-2212.
  *
  *
  * As of April 6th 2002 completely rewritten.
diff --git a/libfaad/mdct.h b/libfaad/mdct.h
index 736180e..43b9534 100644
--- a/libfaad/mdct.h
+++ b/libfaad/mdct.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/mdct_tab.h b/libfaad/mdct_tab.h
index eea285b..471610c 100644
--- a/libfaad/mdct_tab.h
+++ b/libfaad/mdct_tab.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/mp4.c b/libfaad/mp4.c
index dbcff83..35b1120 100644
--- a/libfaad/mp4.c
+++ b/libfaad/mp4.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
@@ -107,7 +107,11 @@ static uint8_t ObjectTypesTable[32] = {
     0, /* 27 ER Parametric */
 #endif
     0, /* 28 (Reserved) */
-    0, /* 29 (Reserved) */
+#ifdef PS_DEC
+    1, /* 29 AAC LC + SBR + PS */
+#else
+    0, /* 29 AAC LC + SBR + PS */
+#endif
     0, /* 30 (Reserved) */
     0  /* 31 (Reserved) */
 };
@@ -174,7 +178,7 @@ int8_t AudioSpecificConfigFromBitfile(bitfile *ld,
 
 #ifdef SBR_DEC
     mp4ASC->sbr_present_flag = -1;
-    if (mp4ASC->objectTypeIndex == 5)
+    if (mp4ASC->objectTypeIndex == 5 || mp4ASC->objectTypeIndex == 29)
     {
         uint8_t tmp;
 
@@ -231,7 +235,7 @@ int8_t AudioSpecificConfigFromBitfile(bitfile *ld,
     else
 		bits_to_decode = (int8_t)(buffer_size*8 - (startpos-faad_get_processed_bits(ld)));
 
-    if ((mp4ASC->objectTypeIndex != 5) && (bits_to_decode >= 16))
+    if ((mp4ASC->objectTypeIndex != 5 && mp4ASC->objectTypeIndex != 29) && (bits_to_decode >= 16))
     {
         int16_t syncExtensionType = (int16_t)faad_getbits(ld, 11
             DEBUGVAR(1,9,"parse_audio_decoder_specific_info(): syncExtensionType"));
diff --git a/libfaad/mp4.h b/libfaad/mp4.h
index d99a3e3..29cf512 100644
--- a/libfaad/mp4.h
+++ b/libfaad/mp4.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
@@ -42,7 +42,7 @@ int8_t AudioSpecificConfig2(uint8_t *pBuffer,
                             uint32_t buffer_size,
                             mp4AudioSpecificConfig *mp4ASC,
                             program_config *pce, uint8_t short_form);
- 
+
 int8_t AudioSpecificConfigFromBitfile(bitfile *ld,
                                       mp4AudioSpecificConfig *mp4ASC,
                                       program_config *pce, uint32_t bsize, uint8_t short_form);
diff --git a/libfaad/ms.c b/libfaad/ms.c
index 97c8fb1..eb4d266 100644
--- a/libfaad/ms.c
+++ b/libfaad/ms.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
@@ -48,7 +48,7 @@ void ms_decode(ic_stream *ics, ic_stream *icsr, real_t *l_spec, real_t *r_spec,
 
     if (ics->ms_mask_present >= 1)
     {
-        for (g = 0; g < ics->num_window_groups; g++) 
+        for (g = 0; g < ics->num_window_groups; g++)
         {
             for (b = 0; b < ics->window_group_length[g]; b++)
             {
diff --git a/libfaad/ms.h b/libfaad/ms.h
index 30cfada..3281391 100644
--- a/libfaad/ms.h
+++ b/libfaad/ms.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/output.c b/libfaad/output.c
index 4245627..59fcd15 100644
--- a/libfaad/output.c
+++ b/libfaad/output.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/output.h b/libfaad/output.h
index 9ab5c9e..72abf82 100644
--- a/libfaad/output.h
+++ b/libfaad/output.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/pns.c b/libfaad/pns.c
index 65cbcfd..3e7a650 100644
--- a/libfaad/pns.c
+++ b/libfaad/pns.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
@@ -236,7 +236,17 @@ void pns_decode(ic_stream *ics_left, ic_stream *ics_right,
                 if ((ics_right != NULL)
                     && is_noise(ics_right, g, sfb))
                 {
-                    if (channel_pair &&
+#ifdef LTP_DEC
+                    /* See comment above. */
+                    ics_right->ltp.long_used[sfb] = 0;
+                    ics_right->ltp2.long_used[sfb] = 0;
+#endif
+#ifdef MAIN_DEC
+                    /* See comment above. */
+                    ics_right->pred.prediction_used[sfb] = 0;
+#endif
+
+                    if (channel_pair && is_noise(ics_left, g, sfb) &&
                         (((ics_left->ms_mask_present == 1) &&
                         (ics_left->ms_used[g][sfb])) ||
                         (ics_left->ms_mask_present == 2)))
@@ -252,14 +262,6 @@ void pns_decode(ic_stream *ics_left, ic_stream *ics_right,
 
                     } else /*if (ics_left->ms_mask_present == 0)*/ {
 
-#ifdef LTP_DEC
-                        ics_right->ltp.long_used[sfb] = 0;
-                        ics_right->ltp2.long_used[sfb] = 0;
-#endif
-#ifdef MAIN_DEC
-                        ics_right->pred.prediction_used[sfb] = 0;
-#endif
-
                         offs = ics_right->swb_offset[sfb];
                         size = min(ics_right->swb_offset[sfb+1], ics_right->swb_offset_max) - offs;
 
diff --git a/libfaad/pns.h b/libfaad/pns.h
index 38ced25..24fc252 100644
--- a/libfaad/pns.h
+++ b/libfaad/pns.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/ps_dec.c b/libfaad/ps_dec.c
index b952665..acb222d 100644
--- a/libfaad/ps_dec.c
+++ b/libfaad/ps_dec.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/ps_dec.h b/libfaad/ps_dec.h
index 0902446..8f555aa 100644
--- a/libfaad/ps_dec.h
+++ b/libfaad/ps_dec.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/ps_tables.h b/libfaad/ps_tables.h
index f3370be..3a9aaf5 100644
--- a/libfaad/ps_tables.h
+++ b/libfaad/ps_tables.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/pulse.c b/libfaad/pulse.c
index 3dd973a..8d875e9 100644
--- a/libfaad/pulse.c
+++ b/libfaad/pulse.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/pulse.h b/libfaad/pulse.h
index f7676cd..5a68901 100644
--- a/libfaad/pulse.h
+++ b/libfaad/pulse.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/rvlc.c b/libfaad/rvlc.c
index 73619c6..b12b2d4 100644
--- a/libfaad/rvlc.c
+++ b/libfaad/rvlc.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
@@ -454,7 +454,7 @@ static int8_t rvlc_huffman_sf(bitfile *ld_sf, bitfile *ld_esc,
     int8_t index;
     uint32_t cw;
     rvlc_huff_table *h = book_rvlc;
-    
+
     i = h->len;
     if (direction > 0)
         cw = faad_getbits(ld_sf, i DEBUGVAR(1,0,""));
diff --git a/libfaad/rvlc.h b/libfaad/rvlc.h
index 56f630f..0aa78b4 100644
--- a/libfaad/rvlc.h
+++ b/libfaad/rvlc.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/sbr_dct.c b/libfaad/sbr_dct.c
index 16e7128..d47d8f5 100644
--- a/libfaad/sbr_dct.c
+++ b/libfaad/sbr_dct.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/sbr_dct.h b/libfaad/sbr_dct.h
index ce44fd7..861ec51 100644
--- a/libfaad/sbr_dct.h
+++ b/libfaad/sbr_dct.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/sbr_dec.c b/libfaad/sbr_dec.c
index 0705ddd..ff6f9dc 100644
--- a/libfaad/sbr_dec.c
+++ b/libfaad/sbr_dec.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
@@ -97,10 +97,17 @@ sbr_info *sbrDecodeInit(uint16_t framelength, uint8_t id_aac,
     {
         sbr->numTimeSlotsRate = RATE * NO_TIME_SLOTS_960;
         sbr->numTimeSlots = NO_TIME_SLOTS_960;
-    } else {
+    }
+    else if (framelength == 1024)
+    {
         sbr->numTimeSlotsRate = RATE * NO_TIME_SLOTS;
         sbr->numTimeSlots = NO_TIME_SLOTS;
     }
+    else
+    {
+        faad_free(sbr);
+        return NULL;
+    }
 
     sbr->GQ_ringbuf_index[0] = 0;
     sbr->GQ_ringbuf_index[1] = 0;
@@ -166,7 +173,7 @@ void sbrDecodeEnd(sbr_info *sbr)
         }
 
 #ifdef PS_DEC
-        if (sbr->ps != NULL) 
+        if (sbr->ps != NULL)
             ps_free(sbr->ps);
 #endif
 
@@ -205,7 +212,7 @@ void sbrReset(sbr_info *sbr)
 
     memset(sbr->Xsbr[0], 0, (sbr->numTimeSlotsRate+sbr->tHFGen)*64 * sizeof(qmf_t));
     memset(sbr->Xsbr[1], 0, (sbr->numTimeSlotsRate+sbr->tHFGen)*64 * sizeof(qmf_t));
-    
+
     sbr->GQ_ringbuf_index[0] = 0;
     sbr->GQ_ringbuf_index[1] = 0;
     sbr->header_count = 0;
diff --git a/libfaad/sbr_dec.h b/libfaad/sbr_dec.h
index 40c1d53..cb8e3b9 100644
--- a/libfaad/sbr_dec.h
+++ b/libfaad/sbr_dec.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/sbr_e_nf.c b/libfaad/sbr_e_nf.c
index 2181dff..279aefd 100644
--- a/libfaad/sbr_e_nf.c
+++ b/libfaad/sbr_e_nf.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/sbr_e_nf.h b/libfaad/sbr_e_nf.h
index 59017a9..7be6814 100644
--- a/libfaad/sbr_e_nf.h
+++ b/libfaad/sbr_e_nf.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/sbr_fbt.c b/libfaad/sbr_fbt.c
index ee77058..84ccb68 100644
--- a/libfaad/sbr_fbt.c
+++ b/libfaad/sbr_fbt.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
@@ -80,7 +80,7 @@ uint8_t qmf_start_channel(uint8_t bs_start_freq, uint8_t bs_samplerate_mode,
     {
         return startMin + offset[offsetIndex][bs_start_freq];
 
-#if 0 /* replaced by offsetIndexTable */ 
+#if 0 /* replaced by offsetIndexTable */
         switch (sample_rate)
         {
         case 16000:
diff --git a/libfaad/sbr_fbt.h b/libfaad/sbr_fbt.h
index d24a25e..2594225 100644
--- a/libfaad/sbr_fbt.h
+++ b/libfaad/sbr_fbt.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/sbr_hfadj.c b/libfaad/sbr_hfadj.c
index dda1ce8..fdca722 100644
--- a/libfaad/sbr_hfadj.c
+++ b/libfaad/sbr_hfadj.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
@@ -396,16 +396,16 @@ static const real_t log_Qplus1_pan[31][13] = {
 };
 
 static const real_t log_Qplus1[31] = {
-    REAL_CONST(6.022367813028454), REAL_CONST(5.044394119358453), REAL_CONST(4.087462841250339), 
-    REAL_CONST(3.169925001442313), REAL_CONST(2.321928094887362), REAL_CONST(1.584962500721156), 
-    REAL_CONST(1.000000000000000), REAL_CONST(0.584962500721156), REAL_CONST(0.321928094887362), 
-    REAL_CONST(0.169925001442312), REAL_CONST(0.087462841250339), REAL_CONST(0.044394119358453), 
-    REAL_CONST(0.022367813028455), REAL_CONST(0.011227255423254), REAL_CONST(0.005624549193878), 
-    REAL_CONST(0.002815015607054), REAL_CONST(0.001408194392808), REAL_CONST(0.000704269011247), 
-    REAL_CONST(0.000352177480301), REAL_CONST(0.000176099486443), REAL_CONST(0.000088052430122), 
-    REAL_CONST(0.000044026886827), REAL_CONST(0.000022013611360), REAL_CONST(0.000011006847667), 
-    REAL_CONST(0.000005503434331), REAL_CONST(0.000002751719790), REAL_CONST(0.000001375860551), 
-    REAL_CONST(0.000000687930439), REAL_CONST(0.000000343965261), REAL_CONST(0.000000171982641), 
+    REAL_CONST(6.022367813028454), REAL_CONST(5.044394119358453), REAL_CONST(4.087462841250339),
+    REAL_CONST(3.169925001442313), REAL_CONST(2.321928094887362), REAL_CONST(1.584962500721156),
+    REAL_CONST(1.000000000000000), REAL_CONST(0.584962500721156), REAL_CONST(0.321928094887362),
+    REAL_CONST(0.169925001442312), REAL_CONST(0.087462841250339), REAL_CONST(0.044394119358453),
+    REAL_CONST(0.022367813028455), REAL_CONST(0.011227255423254), REAL_CONST(0.005624549193878),
+    REAL_CONST(0.002815015607054), REAL_CONST(0.001408194392808), REAL_CONST(0.000704269011247),
+    REAL_CONST(0.000352177480301), REAL_CONST(0.000176099486443), REAL_CONST(0.000088052430122),
+    REAL_CONST(0.000044026886827), REAL_CONST(0.000022013611360), REAL_CONST(0.000011006847667),
+    REAL_CONST(0.000005503434331), REAL_CONST(0.000002751719790), REAL_CONST(0.000001375860551),
+    REAL_CONST(0.000000687930439), REAL_CONST(0.000000343965261), REAL_CONST(0.000000171982641),
     REAL_CONST(0.000000000000000)
 };
 
@@ -868,16 +868,16 @@ static const real_t log_Qplus1_pan[31][13] = {
 };
 
 static const real_t log_Qplus1[31] = {
-    REAL_CONST(6.022367813028454), REAL_CONST(5.044394119358453), REAL_CONST(4.087462841250339), 
-    REAL_CONST(3.169925001442313), REAL_CONST(2.321928094887362), REAL_CONST(1.584962500721156), 
-    REAL_CONST(1.000000000000000), REAL_CONST(0.584962500721156), REAL_CONST(0.321928094887362), 
-    REAL_CONST(0.169925001442312), REAL_CONST(0.087462841250339), REAL_CONST(0.044394119358453), 
-    REAL_CONST(0.022367813028455), REAL_CONST(0.011227255423254), REAL_CONST(0.005624549193878), 
-    REAL_CONST(0.002815015607054), REAL_CONST(0.001408194392808), REAL_CONST(0.000704269011247), 
-    REAL_CONST(0.000352177480301), REAL_CONST(0.000176099486443), REAL_CONST(0.000088052430122), 
-    REAL_CONST(0.000044026886827), REAL_CONST(0.000022013611360), REAL_CONST(0.000011006847667), 
-    REAL_CONST(0.000005503434331), REAL_CONST(0.000002751719790), REAL_CONST(0.000001375860551), 
-    REAL_CONST(0.000000687930439), REAL_CONST(0.000000343965261), REAL_CONST(0.000000171982641), 
+    REAL_CONST(6.022367813028454), REAL_CONST(5.044394119358453), REAL_CONST(4.087462841250339),
+    REAL_CONST(3.169925001442313), REAL_CONST(2.321928094887362), REAL_CONST(1.584962500721156),
+    REAL_CONST(1.000000000000000), REAL_CONST(0.584962500721156), REAL_CONST(0.321928094887362),
+    REAL_CONST(0.169925001442312), REAL_CONST(0.087462841250339), REAL_CONST(0.044394119358453),
+    REAL_CONST(0.022367813028455), REAL_CONST(0.011227255423254), REAL_CONST(0.005624549193878),
+    REAL_CONST(0.002815015607054), REAL_CONST(0.001408194392808), REAL_CONST(0.000704269011247),
+    REAL_CONST(0.000352177480301), REAL_CONST(0.000176099486443), REAL_CONST(0.000088052430122),
+    REAL_CONST(0.000044026886827), REAL_CONST(0.000022013611360), REAL_CONST(0.000011006847667),
+    REAL_CONST(0.000005503434331), REAL_CONST(0.000002751719790), REAL_CONST(0.000001375860551),
+    REAL_CONST(0.000000687930439), REAL_CONST(0.000000343965261), REAL_CONST(0.000000171982641),
     REAL_CONST(0.000000000000000)
 };
 
@@ -1417,7 +1417,7 @@ static void calc_gain_groups(sbr_info *sbr, sbr_hfadj_info *adj, real_t *deg, ui
                     i++;
                 }
             }
-        }        
+        }
 
         if (grouping)
         {
@@ -1439,7 +1439,7 @@ static void aliasing_reduction(sbr_info *sbr, sbr_hfadj_info *adj, real_t *deg,
         for (k = 0; k < sbr->N_G[l]; k++)
         {
             E_total_est = E_total = 0;
-            
+
             for (m = sbr->f_group[l][k<<1]; m < sbr->f_group[l][(k<<1) + 1]; m++)
             {
                 /* E_curr: integer */
diff --git a/libfaad/sbr_hfadj.h b/libfaad/sbr_hfadj.h
index 03ef71a..624ef5c 100644
--- a/libfaad/sbr_hfadj.h
+++ b/libfaad/sbr_hfadj.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/sbr_hfgen.c b/libfaad/sbr_hfgen.c
index b0f3219..2b26906 100644
--- a/libfaad/sbr_hfgen.c
+++ b/libfaad/sbr_hfgen.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
@@ -298,7 +298,7 @@ static void auto_correlation(sbr_info *sbr, acorr_coef *ac, qmf_t buffer[MAX_NTS
     /* improves accuracy */
     if (exp > 0)
         exp -= 1;
-   
+
     pow2_to_exp = 1<<(exp-1);
 
     temp2_r = (QMF_RE(buffer[offset-2][bd]) + pow2_to_exp) >> exp;
diff --git a/libfaad/sbr_hfgen.h b/libfaad/sbr_hfgen.h
index a7c8424..418cdfb 100644
--- a/libfaad/sbr_hfgen.h
+++ b/libfaad/sbr_hfgen.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/sbr_huff.c b/libfaad/sbr_huff.c
index 6ba8786..a22dbec 100644
--- a/libfaad/sbr_huff.c
+++ b/libfaad/sbr_huff.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/sbr_huff.h b/libfaad/sbr_huff.h
index f749f2e..67b937b 100644
--- a/libfaad/sbr_huff.h
+++ b/libfaad/sbr_huff.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/sbr_noise.h b/libfaad/sbr_noise.h
index 1cf7190..42d993f 100644
--- a/libfaad/sbr_noise.h
+++ b/libfaad/sbr_noise.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/sbr_qmf.c b/libfaad/sbr_qmf.c
index 68f4089..6068925 100644
--- a/libfaad/sbr_qmf.c
+++ b/libfaad/sbr_qmf.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/sbr_qmf.h b/libfaad/sbr_qmf.h
index efb167b..ac749e0 100644
--- a/libfaad/sbr_qmf.h
+++ b/libfaad/sbr_qmf.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/sbr_qmf_c.h b/libfaad/sbr_qmf_c.h
index c2fcd27..2297af0 100644
--- a/libfaad/sbr_qmf_c.h
+++ b/libfaad/sbr_qmf_c.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/sbr_syntax.c b/libfaad/sbr_syntax.c
index 12ca70a..29a6328 100644
--- a/libfaad/sbr_syntax.c
+++ b/libfaad/sbr_syntax.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
@@ -217,7 +217,7 @@ uint8_t sbr_extension_data(bitfile *ld, sbr_info *sbr, uint16_t cnt,
             {
                 result += calc_sbr_tables(sbr, saved_start_freq, saved_stop_freq,
                     saved_samplerate_mode, saved_freq_scale,
-                    saved_alter_scale, saved_xover_band);          
+                    saved_alter_scale, saved_xover_band);
             }
 
             /* we should be able to safely set result to 0 now, */
@@ -248,7 +248,7 @@ uint8_t sbr_extension_data(bitfile *ld, sbr_info *sbr, uint16_t cnt,
 #ifdef DRM
     if (!sbr->Is_DRM_SBR)
 #endif
-    {       
+    {
         /* -4 does not apply, bs_extension_type is re-read in this function */
         num_align_bits = 8*cnt /*- 4*/ - num_sbr_bits2;
 
diff --git a/libfaad/sbr_syntax.h b/libfaad/sbr_syntax.h
index a13b270..60c5ad3 100644
--- a/libfaad/sbr_syntax.h
+++ b/libfaad/sbr_syntax.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/sbr_tf_grid.c b/libfaad/sbr_tf_grid.c
index a073d96..78a919a 100644
--- a/libfaad/sbr_tf_grid.c
+++ b/libfaad/sbr_tf_grid.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/sbr_tf_grid.h b/libfaad/sbr_tf_grid.h
index 27a8f90..fb110c1 100644
--- a/libfaad/sbr_tf_grid.h
+++ b/libfaad/sbr_tf_grid.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/sine_win.h b/libfaad/sine_win.h
index e4198da..8799710 100644
--- a/libfaad/sine_win.h
+++ b/libfaad/sine_win.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/specrec.c b/libfaad/specrec.c
index c5a563a..d398bb3 100644
--- a/libfaad/specrec.c
+++ b/libfaad/specrec.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
@@ -622,10 +622,10 @@ static uint8_t quant_to_spec(NeAACDecStruct *hDecoder,
                     wb = wa + bin;
 
                     spec_data[wb+0] = iquant(quant_data[k+0], tab, &error) * scf;
-                    spec_data[wb+1] = iquant(quant_data[k+1], tab, &error) * scf;                        
-                    spec_data[wb+2] = iquant(quant_data[k+2], tab, &error) * scf;                        
+                    spec_data[wb+1] = iquant(quant_data[k+1], tab, &error) * scf;
+                    spec_data[wb+2] = iquant(quant_data[k+2], tab, &error) * scf;
                     spec_data[wb+3] = iquant(quant_data[k+3], tab, &error) * scf;
-                        
+
 #else
                     real_t iq0 = iquant(quant_data[k+0], tab, &error);
                     real_t iq1 = iquant(quant_data[k+1], tab, &error);
@@ -941,6 +941,10 @@ uint8_t reconstruct_single_channel(NeAACDecStruct *hDecoder, ic_stream *ics,
     /* sanity check, CVE-2018-20199, CVE-2018-20360 */
     if(!hDecoder->time_out[sce->channel])
         return 15;
+    if(output_channels > 1 && !hDecoder->time_out[sce->channel+1])
+        return 15;
+    if(!hDecoder->fb_intermed[sce->channel])
+        return 15;
 
     /* dequantisation and scaling */
     retval = quant_to_spec(hDecoder, ics, spec_data, spec_coef, hDecoder->frameLength);
@@ -1056,6 +1060,8 @@ uint8_t reconstruct_single_channel(NeAACDecStruct *hDecoder, ic_stream *ics,
 #endif
                 );
         }
+        if (!hDecoder->sbr[ele])
+            return 19;
 
         if (sce->ics1.window_sequence == EIGHT_SHORT_SEQUENCE)
             hDecoder->sbr[ele]->maxAACLine = 8*min(sce->ics1.swb_offset[max(sce->ics1.max_sfb-1, 0)], sce->ics1.swb_offset_max);
@@ -1122,7 +1128,9 @@ uint8_t reconstruct_channel_pair(NeAACDecStruct *hDecoder, ic_stream *ics1, ic_s
     }
 
     /* sanity check, CVE-2018-20199, CVE-2018-20360 */
-    if(!hDecoder->time_out[cpe->channel])
+    if(!hDecoder->time_out[cpe->channel] || !hDecoder->time_out[cpe->paired_channel])
+        return 15;
+    if(!hDecoder->fb_intermed[cpe->channel] || !hDecoder->fb_intermed[cpe->paired_channel])
         return 15;
 
     /* dequantisation and scaling */
@@ -1312,6 +1320,8 @@ uint8_t reconstruct_channel_pair(NeAACDecStruct *hDecoder, ic_stream *ics1, ic_s
 #endif
                 );
         }
+        if (!hDecoder->sbr[ele])
+            return 19;
 
         if (cpe->ics1.window_sequence == EIGHT_SHORT_SEQUENCE)
             hDecoder->sbr[ele]->maxAACLine = 8*min(cpe->ics1.swb_offset[max(cpe->ics1.max_sfb-1, 0)], cpe->ics1.swb_offset_max);
diff --git a/libfaad/specrec.h b/libfaad/specrec.h
index 5f42e2c..8464ca9 100644
--- a/libfaad/specrec.h
+++ b/libfaad/specrec.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/ssr.c b/libfaad/ssr.c
index 3681124..296c42b 100644
--- a/libfaad/ssr.c
+++ b/libfaad/ssr.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/ssr.h b/libfaad/ssr.h
index 7adcf2a..0be2aed 100644
--- a/libfaad/ssr.h
+++ b/libfaad/ssr.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/ssr_fb.c b/libfaad/ssr_fb.c
index a977c94..b6cc6fd 100644
--- a/libfaad/ssr_fb.c
+++ b/libfaad/ssr_fb.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/ssr_fb.h b/libfaad/ssr_fb.h
index 3ae4eb0..98fac2e 100644
--- a/libfaad/ssr_fb.h
+++ b/libfaad/ssr_fb.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/ssr_ipqf.c b/libfaad/ssr_ipqf.c
index 6963427..8dcb73a 100644
--- a/libfaad/ssr_ipqf.c
+++ b/libfaad/ssr_ipqf.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
@@ -59,7 +59,7 @@ void gc_set_protopqf(real_t *p_proto)
         -2.1939551286300665E-02, -2.4533179947088161E-02, -2.2591663337768787E-02,
         -1.5122066420044672E-02, -1.7971713448186293E-03,  1.6903413428575379E-02,
         3.9672315874127042E-02,  6.4487527248102796E-02,  8.8850025474701726E-02,
-        0.1101132906105560    ,  0.1258540205143761    ,  0.1342239368467012    
+        0.1101132906105560    ,  0.1258540205143761    ,  0.1342239368467012
     };
 
     for (j = 0; j < 48; ++j)
diff --git a/libfaad/ssr_ipqf.h b/libfaad/ssr_ipqf.h
index 4729921..323a54b 100644
--- a/libfaad/ssr_ipqf.h
+++ b/libfaad/ssr_ipqf.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/ssr_win.h b/libfaad/ssr_win.h
index 64b0f98..9abbac4 100644
--- a/libfaad/ssr_win.h
+++ b/libfaad/ssr_win.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/structs.h b/libfaad/structs.h
index 9357c60..497c178 100644
--- a/libfaad/structs.h
+++ b/libfaad/structs.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/syntax.c b/libfaad/syntax.c
index b3d3a85..a0ea100 100644
--- a/libfaad/syntax.c
+++ b/libfaad/syntax.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
@@ -344,7 +344,9 @@ static void decode_sce_lfe(NeAACDecStruct *hDecoder,
        can become 2 when some form of Parametric Stereo coding is used
     */
 
-    if (hDecoder->frame && hDecoder->element_id[hDecoder->fr_ch_ele] != id_syn_ele) {
+    if (hDecoder->element_id[hDecoder->fr_ch_ele] != INVALID_ELEMENT_ID &&
+        hDecoder->element_id[hDecoder->fr_ch_ele] != id_syn_ele)
+    {
         /* element inconsistency */
         hInfo->error = 21;
         return;
@@ -401,7 +403,9 @@ static void decode_cpe(NeAACDecStruct *hDecoder, NeAACDecFrameInfo *hInfo, bitfi
         return;
     }
 
-    if (hDecoder->frame && hDecoder->element_id[hDecoder->fr_ch_ele] != id_syn_ele) {
+    if (hDecoder->element_id[hDecoder->fr_ch_ele] != INVALID_ELEMENT_ID &&
+        hDecoder->element_id[hDecoder->fr_ch_ele] != id_syn_ele)
+    {
         /* element inconsistency */
         hInfo->error = 21;
         return;
@@ -535,37 +539,61 @@ void raw_data_block(NeAACDecStruct *hDecoder, NeAACDecFrameInfo *hInfo,
             break;
         case 3:
             decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
+            if (hInfo->error > 0)
+                return;
             decode_cpe(hDecoder, hInfo, ld, ID_CPE);
             if (hInfo->error > 0)
                 return;
             break;
         case 4:
             decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
+            if (hInfo->error > 0)
+                return;
             decode_cpe(hDecoder, hInfo, ld, ID_CPE);
+            if (hInfo->error > 0)
+                return;
             decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
             if (hInfo->error > 0)
                 return;
             break;
         case 5:
             decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
+            if (hInfo->error > 0)
+                return;
             decode_cpe(hDecoder, hInfo, ld, ID_CPE);
+            if (hInfo->error > 0)
+                return;
             decode_cpe(hDecoder, hInfo, ld, ID_CPE);
             if (hInfo->error > 0)
                 return;
             break;
         case 6:
             decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
+            if (hInfo->error > 0)
+                return;
             decode_cpe(hDecoder, hInfo, ld, ID_CPE);
+            if (hInfo->error > 0)
+                return;
             decode_cpe(hDecoder, hInfo, ld, ID_CPE);
+            if (hInfo->error > 0)
+                return;
             decode_sce_lfe(hDecoder, hInfo, ld, ID_LFE);
             if (hInfo->error > 0)
                 return;
             break;
         case 7: /* 8 channels */
             decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
+            if (hInfo->error > 0)
+                return;
             decode_cpe(hDecoder, hInfo, ld, ID_CPE);
+            if (hInfo->error > 0)
+                return;
             decode_cpe(hDecoder, hInfo, ld, ID_CPE);
+            if (hInfo->error > 0)
+                return;
             decode_cpe(hDecoder, hInfo, ld, ID_CPE);
+            if (hInfo->error > 0)
+                return;
             decode_sce_lfe(hDecoder, hInfo, ld, ID_LFE);
             if (hInfo->error > 0)
                 return;
@@ -884,7 +912,10 @@ static uint8_t ics_info(NeAACDecStruct *hDecoder, ic_stream *ics, bitfile *ld,
                     if ((ics->ltp.data_present = faad_get1bit(ld
                         DEBUGVAR(1,50,"ics_info(): ltp.data_present"))) & 1)
                     {
-                        ltp_data(hDecoder, ics, &(ics->ltp), ld);
+                        if ((retval = ltp_data(hDecoder, ics, &(ics->ltp), ld)) > 0)
+                        {
+                            return retval;
+                        }
                     }
                 }
 #endif
@@ -1091,6 +1122,8 @@ static uint8_t fill_element(NeAACDecStruct *hDecoder, bitfile *ld, drc_info *drc
 #endif
                     );
             }
+            if (!hDecoder->sbr[sbr_ele])
+                return 19;
 
             hDecoder->sbr_present_flag = 1;
 
@@ -1279,7 +1312,7 @@ void DRM_aac_scalable_main_element(NeAACDecStruct *hDecoder, NeAACDecFrameInfo *
     }
 #else
     faad_get1bit(ld);
-#endif    
+#endif
 
     hInfo->error = side_info(hDecoder, &cpe, ld, ics1, 1);
     if (hInfo->error > 0)
@@ -1360,6 +1393,11 @@ void DRM_aac_scalable_main_element(NeAACDecStruct *hDecoder, NeAACDecFrameInfo *
             hDecoder->sbr[0] = sbrDecodeInit(hDecoder->frameLength, hDecoder->element_id[0],
                 2*get_sample_rate(hDecoder->sf_index), 0 /* ds SBR */, 1);
         }
+        if (!hDecoder->sbr[0])
+        {
+            hInfo->error = 19;
+            return;
+        }
 
         /* Reverse bit reading of SBR data in DRM audio frame */
         revbuffer = (uint8_t*)faad_malloc(buffer_size*sizeof(uint8_t));
@@ -1611,7 +1649,7 @@ static uint8_t individual_channel_stream(NeAACDecStruct *hDecoder, element *ele,
     if (result > 0)
         return result;
 
-    if (hDecoder->object_type >= ER_OBJECT_START) 
+    if (hDecoder->object_type >= ER_OBJECT_START)
     {
         if (ics->tns_data_present)
             tns_data(ics, &(ics->tns), ld);
@@ -2179,11 +2217,11 @@ static uint16_t extension_payload(bitfile *ld, drc_info *drc, uint16_t count)
         return n;
     case EXT_FILL_DATA:
         /* fill_nibble = */ faad_getbits(ld, 4
-            DEBUGVAR(1,136,"extension_payload(): fill_nibble")); /* must be �0000� */
+            DEBUGVAR(1,136,"extension_payload(): fill_nibble")); /* must be '0000' */
         for (i = 0; i < count-1; i++)
         {
             /* fill_byte[i] = */ faad_getbits(ld, 8
-                DEBUGVAR(1,88,"extension_payload(): fill_byte")); /* must be �10100101� */
+                DEBUGVAR(1,88,"extension_payload(): fill_byte")); /* must be '10100101' */
         }
         return count;
     case EXT_DATA_ELEMENT:
@@ -2642,7 +2680,7 @@ uint32_t faad_latm_frame(latm_header *latm, bitfile *ld)
         endpos = faad_get_processed_bits(ld);
         if(ret>0)
             return (len*8)-(endpos-initpos);
-        //faad_getbits(ld, initpos-endpos); //go back to initpos, but is valid a getbits(-N) ? 
+        //faad_getbits(ld, initpos-endpos); //go back to initpos, but is valid a getbits(-N) ?
     }
     return 0xFFFFFFFF;
 }
diff --git a/libfaad/syntax.h b/libfaad/syntax.h
index 2a1fc6d..8be93e3 100644
--- a/libfaad/syntax.h
+++ b/libfaad/syntax.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
@@ -91,6 +91,7 @@ extern "C" {
 #define ID_PCE 0x5
 #define ID_FIL 0x6
 #define ID_END 0x7
+#define INVALID_ELEMENT_ID 255
 
 #define ONLY_LONG_SEQUENCE   0x0
 #define LONG_START_SEQUENCE  0x1
diff --git a/libfaad/tns.c b/libfaad/tns.c
index 6118652..3f2bf90 100644
--- a/libfaad/tns.c
+++ b/libfaad/tns.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/libfaad/tns.h b/libfaad/tns.h
index 8848c3f..22f8a45 100644
--- a/libfaad/tns.h
+++ b/libfaad/tns.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
@@ -38,7 +38,7 @@ extern "C" {
 
 #define TNS_MAX_ORDER 20
 
-    
+
 void tns_decode_frame(ic_stream *ics, tns_info *tns, uint8_t sr_index,
                       uint8_t object_type, real_t *spec, uint16_t frame_len);
 void tns_encode_frame(ic_stream *ics, tns_info *tns, uint8_t sr_index,
diff --git a/plugins/QCD/QCDFAAD.c b/plugins/QCD/QCDFAAD.c
index f474b38..8d55f7b 100644
--- a/plugins/QCD/QCDFAAD.c
+++ b/plugins/QCD/QCDFAAD.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD - Freeware Advanced Audio Decoder
 ** Copyright (C) 2002 M. Bakker
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** $Id: QCDFAAD.c,v 1.2 2003/04/28 19:04:35 menno Exp $
@@ -240,10 +240,10 @@ BOOL CALLBACK config_dialog_proc(HWND hwndDlg, UINT message, WPARAM wParam, LPAR
 	{
     case WM_INITDIALOG:
         /* Set priority slider range and previous position */
-		SendMessage(GetDlgItem(hwndDlg, THREAD_PRIORITY_SLIDER), TBM_SETRANGE, TRUE, MAKELONG(1, 5)); 
+		SendMessage(GetDlgItem(hwndDlg, THREAD_PRIORITY_SLIDER), TBM_SETRANGE, TRUE, MAKELONG(1, 5));
 		SendMessage(GetDlgItem(hwndDlg, THREAD_PRIORITY_SLIDER), TBM_SETPOS, TRUE, m_priority);
 		SetDlgItemText(hwndDlg, IDC_STATIC2, priority_text[m_priority]);
-		
+
 		/* Put a limit to the amount of characters allowed in the buffer boxes */
 		SendMessage(GetDlgItem(hwndDlg, LOCAL_BUFFER_TXT), EM_LIMITTEXT, 4, 0);
 		SendMessage(GetDlgItem(hwndDlg, STREAM_BUFFER_TXT), EM_LIMITTEXT, 4, 0);
@@ -289,12 +289,12 @@ BOOL CALLBACK config_dialog_proc(HWND hwndDlg, UINT message, WPARAM wParam, LPAR
 			if(GetDlgItem(hwndDlg, VARBITRATE_CHK) == (HWND) lParam)
 			{
 				/* Variable Bitrate checkbox hit */
-				m_variable_bitrate_display = SendMessage(GetDlgItem(hwndDlg, VARBITRATE_CHK), BM_GETCHECK, 0, 0); 
+				m_variable_bitrate_display = SendMessage(GetDlgItem(hwndDlg, VARBITRATE_CHK), BM_GETCHECK, 0, 0);
 			}
 			if(GetDlgItem(hwndDlg, IDC_MEMMAP) == (HWND) lParam)
 			{
 				/* Variable Bitrate checkbox hit */
-				m_memmap_file = SendMessage(GetDlgItem(hwndDlg, IDC_MEMMAP), BM_GETCHECK, 0, 0); 
+				m_memmap_file = SendMessage(GetDlgItem(hwndDlg, IDC_MEMMAP), BM_GETCHECK, 0, 0);
 			}
 		}
 
@@ -363,22 +363,22 @@ INT_PTR CALLBACK about_dialog_proc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
 
 		SetDlgItemText(hwndDlg, IDC_PLUGINVER, szPluginVer);
 		SetDlgItemText(hwndDlg, IDC_FAADVER, szFLACVer);
-		
+
 		return TRUE;
 	case WM_MOUSEMOVE:
 		ptMouse.x = LOWORD(lParam);
 		ptMouse.y = HIWORD(lParam);
 		ClientToScreen(hwndDlg, &ptMouse);
-		if( (ptMouse.x >= rcLOGO.left && ptMouse.x <= rcLOGO.right && 
-			ptMouse.y >= rcLOGO.top && ptMouse.y<= rcLOGO.bottom) 
+		if( (ptMouse.x >= rcLOGO.left && ptMouse.x <= rcLOGO.right &&
+			ptMouse.y >= rcLOGO.top && ptMouse.y<= rcLOGO.bottom)
 			||
-			(ptMouse.x >= rcMail1.left && ptMouse.x <= rcMail1.right && 
-			ptMouse.y >= rcMail1.top && ptMouse.y<= rcMail1.bottom) 
+			(ptMouse.x >= rcMail1.left && ptMouse.x <= rcMail1.right &&
+			ptMouse.y >= rcMail1.top && ptMouse.y<= rcMail1.bottom)
 			||
-			(ptMouse.x >= rcMail2.left && ptMouse.x <= rcMail2.right && 
-			ptMouse.y >= rcMail2.top && ptMouse.y<= rcMail2.bottom) 
+			(ptMouse.x >= rcMail2.left && ptMouse.x <= rcMail2.right &&
+			ptMouse.y >= rcMail2.top && ptMouse.y<= rcMail2.bottom)
 /*			||
-			(ptMouse.x >= rcMail3.left && ptMouse.x <= rcMail3.right && 
+			(ptMouse.x >= rcMail3.left && ptMouse.x <= rcMail3.right &&
 			ptMouse.y >= rcMail3.top && ptMouse.y<= rcMail3.bottom)*/ )
 			SetCursor(LoadCursor(NULL, MAKEINTRESOURCE(32649)));
 		else
@@ -389,16 +389,16 @@ INT_PTR CALLBACK about_dialog_proc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
 		ptMouse.x = LOWORD(lParam);
 		ptMouse.y = HIWORD(lParam);
 		ClientToScreen(hwndDlg, &ptMouse);
-		if(ptMouse.x >= rcLOGO.left && ptMouse.x <= rcLOGO.right && 
+		if(ptMouse.x >= rcLOGO.left && ptMouse.x <= rcLOGO.right &&
 			ptMouse.y >= rcLOGO.top && ptMouse.y<= rcLOGO.bottom)
 			ShellExecute(0, NULL, "http://www.audiocoding.com", NULL,NULL, SW_NORMAL);
-		else if(ptMouse.x >= rcMail1.left && ptMouse.x <= rcMail1.right && 
+		else if(ptMouse.x >= rcMail1.left && ptMouse.x <= rcMail1.right &&
 			ptMouse.y >= rcMail1.top && ptMouse.y<= rcMail1.bottom)
 			ShellExecute(0, NULL, "mailto:shaohao@elong.com", NULL,NULL, SW_NORMAL);
-		else if(ptMouse.x >= rcMail2.left && ptMouse.x <= rcMail2.right && 
+		else if(ptMouse.x >= rcMail2.left && ptMouse.x <= rcMail2.right &&
 			ptMouse.y >= rcMail2.top && ptMouse.y<= rcMail2.bottom)
 			ShellExecute(0, NULL, "mailto:menno@audiocoding.com", NULL,NULL, SW_NORMAL);
-/*		else if(ptMouse.x >= rcMail3.left && ptMouse.x <= rcMail3.right && 
+/*		else if(ptMouse.x >= rcMail3.left && ptMouse.x <= rcMail3.right &&
 			ptMouse.y >= rcMail3.top && ptMouse.y<= rcMail3.bottom)
 			ShellExecute(0, NULL, "I don't know", NULL,NULL, SW_NORMAL);
 */
@@ -418,7 +418,7 @@ INT_PTR CALLBACK about_dialog_proc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
 void About(int flags)
 {
 	if(!IsWindow(hwndAbout))
-		hwndAbout = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_ABOUT), hwndPlayer, about_dialog_proc); 
+		hwndAbout = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_ABOUT), hwndPlayer, about_dialog_proc);
 	ShowWindow(hwndAbout, SW_SHOW);
 }
 
@@ -483,7 +483,7 @@ BOOL GetMediaSupported(LPCSTR medianame, MediaInfo *mediaInfo)
     if(StringComp(ch, ".aac", 4) == 0)
     {
 		in = open_filestream((char *)medianame);
-		
+
 		if(in != NULL && mediaInfo)
 		{
 			if(in->http)
@@ -501,7 +501,7 @@ BOOL GetMediaSupported(LPCSTR medianame, MediaInfo *mediaInfo)
 				else
 					mediaInfo->op_canSeek = FALSE; /* ADIF or Headerless - not seekable */
 			}
-			
+
 			close_filestream(in);
 			return TRUE;
 		}
@@ -512,7 +512,7 @@ BOOL GetMediaSupported(LPCSTR medianame, MediaInfo *mediaInfo)
 		}
 	}
 	else
-		return FALSE;		
+		return FALSE;
 }
 
 unsigned long samplerate, channels;
@@ -522,7 +522,7 @@ int play_memmap(char *fn)
     int tagsize = 0;
 
     infile = open_filestream(fn);
-    
+
 	if (infile == NULL)
         return 1;
 
@@ -561,7 +561,7 @@ int play_file(char *fn)
     ZeroMemory(buffer, 768*2);
 
      infile = open_filestream(fn);
-    
+
 	if (infile == NULL)
         return 1;
 
@@ -654,7 +654,7 @@ BOOL Play(LPCSTR medianame, int playfrom, int playto, int flags)
 		buffer = (unsigned char*)LocalAlloc(LPTR, 768*2);
 
 		current_file_mode = m_memmap_file;
-		
+
 		if(current_file_mode)
 		{
 			if(play_memmap((char *)medianame))
@@ -665,16 +665,16 @@ BOOL Play(LPCSTR medianame, int playfrom, int playto, int flags)
 			if(play_file((char *)medianame))
 				return FALSE;
 		}
-		
+
 		if(seek_table)
 		{
 			free(seek_table);
 			seek_table = NULL;
 			seek_table_length = 0;
 		}
-		
+
 		get_AAC_format((char *)medianame, &file_info, &seek_table, &seek_table_length, 0);
-		
+
 		seek_needed = playfrom > 0 ? playfrom : -1;
 		killPlayThread = 0;
 		strcpy(lastfn,medianame);
@@ -689,11 +689,11 @@ BOOL Play(LPCSTR medianame, int playfrom, int playto, int flags)
 		play_thread_handle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) PlayThread, (void *) &killPlayThread, 0, &thread_id);
 		if(!play_thread_handle)
 			return FALSE;
-		
+
 		// Note: This line seriously slows down start up time
 		if(m_priority != 3) // if the priority in config window is set to normal, there is nothing to reset!
 			SetThreadPriority(play_thread_handle, priority_table[m_priority]);
-		
+
     }
 
 	return TRUE;
@@ -720,7 +720,7 @@ BOOL Stop(LPCSTR medianame, int flags)
 	if(medianame && *medianame && stricmp(lastfn, medianame) == 0)
 	{
 		sQCDCallbacks.toPlayer.OutputStop(flags);
-		
+
 		killPlayThread = 1;
 		if(play_thread_handle != INVALID_HANDLE_VALUE)
 		{
@@ -735,7 +735,7 @@ BOOL Stop(LPCSTR medianame, int flags)
 
 		if (oldAPIs)
 			QCDCallbacks->toPlayer.PlayStopped(lastfn);
-		
+
 		lastfn[0] = 0;
 	}
 
@@ -906,14 +906,14 @@ DWORD WINAPI PlayThread(void *b)
 						QCDCallbacks->toPlayer.PositionUpdate(decode_pos_ms);
 						updatePos = 0;
 					}
-					
+
 					{
 						WriteDataStruct wd;
 
 						l = frameInfo.samples * sizeof(short);
 
 						decode_pos_ms += (1024*1000)/file_info.sampling_rate;
-						
+
 						wd.bytelen = l;
 						wd.data = sample_buffer;
 						wd.markerend = 0;
@@ -922,7 +922,7 @@ DWORD WINAPI PlayThread(void *b)
 						wd.nch = frameInfo.channels;
 						wd.numsamples =l/file_info.channels/(16/8);
 						wd.srate = file_info.sampling_rate;
-						
+
 						if (!QCDCallbacks->toPlayer.OutputWrite(&wd))
 							done = TRUE;
 					}
diff --git a/plugins/QCD/QCDInputDLL.h b/plugins/QCD/QCDInputDLL.h
index 5a011fa..773d868 100644
--- a/plugins/QCD/QCDInputDLL.h
+++ b/plugins/QCD/QCDInputDLL.h
@@ -1,5 +1,5 @@
 //-----------------------------------------------------------------------------
-// 
+//
 // File:	QCDInputDLL.h
 //
 // About:	QCD Player Input module DLL interface.  For more documentation, see
@@ -11,7 +11,7 @@
 //
 //	Copyright (C) 1997-2002 Quinnware
 //
-//	This code is free.  If you redistribute it in any form, leave this notice 
+//	This code is free.  If you redistribute it in any form, leave this notice
 //	here.
 //
 //	This program is distributed in the hope that it will be useful,
diff --git a/plugins/QCD/QCDModDefs.h b/plugins/QCD/QCDModDefs.h
index 3b69771..4a73f28 100644
--- a/plugins/QCD/QCDModDefs.h
+++ b/plugins/QCD/QCDModDefs.h
@@ -13,7 +13,7 @@
 //
 //	Copyright (C) 1997-2002 Quinnware
 //
-//	This code is free.  If you redistribute it in any form, leave this notice 
+//	This code is free.  If you redistribute it in any form, leave this notice
 //	here.
 //
 //	This program is distributed in the hope that it will be useful,
@@ -47,7 +47,7 @@ typedef struct {
 //-----------------------------------------------------------------------------
 // Services (ops) provided by the Player
 //-----------------------------------------------------------------------------
-typedef enum 
+typedef enum
 {									//*** below returns numeric info (*buffer not used)
 
 	opGetPlayerVersion = 0,			// high-order word = major version (eg 3.01 is 3), low-order word = minor (eg 3.01 = 1)
@@ -65,7 +65,7 @@ typedef enum
 	opGetTrackLength = 14,			// get track length, param1 = index of track in playlist, -1 for current
 									//                   param2 = 0 for seconds, 1 for milliseconds
 	opGetTime = 15,					// get time on player, param1 = 0 for time displayed, 1 for track time, 2 for playlist time
-									//					   param2 = 0 for elapsed, 1 for remaining														   
+									//					   param2 = 0 for elapsed, 1 for remaining
 	opGetTrackState = 16,			// get whether track is marked, param1 = index of track, -1 for current
 	opGetPlaylistNum = 17,			// get playlist number of index, param1 = index of track in playlist, -1 for current
 	opGetMediaType = 18,			// get media type of track, param1 = index if track in playlist, -1 for current
@@ -88,18 +88,18 @@ typedef enum
 
 	opGetIndexFromPLNum = 28,		// get index from playlist number, param1 = playlist number
 
-	opGetChildWnd = 30,				// handle to the draggable window extension (only available on some skins) 
+	opGetChildWnd = 30,				// handle to the draggable window extension (only available on some skins)
 	opGetExtVisWnd = 31,			// handle to the external visual window
-	opGetMusicBrowserWnd = 32,		// handle to the music browser window 
-	opGetSkinPreviewWnd = 33,		// handle to the skin preview window 
-	opGetPropertiesWnd = 34,		// handle to the player properties window 
-	opGetExtInfoWnd = 35,			// handle to the extended information window 
-	opGetAboutWnd = 36,				// handle to the about window 
-	opGetSegmentsWnd = 37,			// handle to the segments window 
-	opGetEQPresetsWnd = 38,			// handle to the EQ presets window 
+	opGetMusicBrowserWnd = 32,		// handle to the music browser window
+	opGetSkinPreviewWnd = 33,		// handle to the skin preview window
+	opGetPropertiesWnd = 34,		// handle to the player properties window
+	opGetExtInfoWnd = 35,			// handle to the extended information window
+	opGetAboutWnd = 36,				// handle to the about window
+	opGetSegmentsWnd = 37,			// handle to the segments window
+	opGetEQPresetsWnd = 38,			// handle to the EQ presets window
 
 	opGetVisDimensions = 50,		// gets the width and height of visual window (param1 = -1 current vis window, 0 internal vis, 1 external vis, 2 full screen)
-									//		returns: HEIGHT in high word, WIDTH in low word 
+									//		returns: HEIGHT in high word, WIDTH in low word
 
 	opGetQueriesComplete = 60,		// get status on whether all tracks in playlist have been queryied for their info
 
@@ -133,10 +133,10 @@ typedef enum
 	opGetSkinFolder = 112,			// get current skin folder
 	opGetCDDBCacheFolder = 113,		// get current folder for CDDB cached info
 
-	opGetCurrentPlaylist = 114,		// get full pathname of playlist currently loaded 
+	opGetCurrentPlaylist = 114,		// get full pathname of playlist currently loaded
 
 	opGetMediaID = 115,				// get media identifier, param2 = index of track in playlist, -1 for current
-									//		- for CD's it's the TOC - for anything else, right now it's 0      
+									//		- for CD's it's the TOC - for anything else, right now it's 0
 
 	opGetSupportedExtensions = 116,	// get file extensions supported by the player, param2 = 0 - get all extensions, 1 - get registered extensions
 									//		- returned extensions will be colon delimited
@@ -221,7 +221,7 @@ typedef struct				// for Output Plugin Write callback
 	UINT	nch;			// number of channels
 	UINT	srate;			// sample rate
 
-	UINT	markerstart;	// Marker position at start of data (marker is time value of data) 
+	UINT	markerstart;	// Marker position at start of data (marker is time value of data)
 							// (set to WAVE_VIS_DATA_ONLY to not have data sent to output plugins)
 	UINT	markerend;		// Marker position at end of data (not currently used, set to 0)
 } WriteDataStruct;
@@ -230,18 +230,18 @@ typedef struct				// for Output Plugin Write callback
 typedef struct			// for GetTrackExtents Input Plugin callback
 {
 	UINT track;			// for CD's, set the track number. Otherwise set to 1.
-	UINT start;			// for CD's or media that doesn't start at the beginning 
+	UINT start;			// for CD's or media that doesn't start at the beginning
 						// of the file, set to start position. Otherwise set to 0.
 	UINT end;			// set to end position of media.
 	UINT unitpersec;	// whatever units are being used for this media, how many
-						// of them per second. 
+						// of them per second.
 						// (Note: ((end - start) / unitpersecond) = file length
 	UINT bytesize;		// size of file in bytes (if applicable, otherwise 0).
 } TrackExtents;
 
 //-----------------------------------------------------------------------------
 typedef struct			// for opSetAudioInfo service
-{		
+{
     long struct_size;	// sizeof(AudioInfo)
     long level;			// MPEG level (1 for MPEG1, 2 for MPEG2, 3 for MPEG2.5, 7 for MPEGpro)
     long layer;			// and layer (1, 2 or 3)
@@ -256,7 +256,7 @@ typedef struct			// for opSetAudioInfo service
 typedef struct			// for coming QCD version
 {
 	long struct_size;	// sizeof(EQInfo)
-	char enabled;		
+	char enabled;
 	char preamp;		// -128 to 127, 0 is even
 	char bands[10];		// -128 to 127, 0 is even
 } EQInfo;
@@ -273,7 +273,7 @@ typedef struct
 
 //-----------------------------------------------------------------------------
 typedef enum			// for MediaInfo.mediaType
-{ 
+{
 	UNKNOWN_MEDIA = 0,
 	CD_AUDIO_MEDIA = 1,
 	DIGITAL_FILE_MEDIA = 2,
diff --git a/plugins/QCD/QCDModInput.h b/plugins/QCD/QCDModInput.h
index e714ea4..6f0b8df 100644
--- a/plugins/QCD/QCDModInput.h
+++ b/plugins/QCD/QCDModInput.h
@@ -2,7 +2,7 @@
 //
 // File:	QCDModInput.h
 //
-// About:	Input plugin module interface.  This file is published with the 
+// About:	Input plugin module interface.  This file is published with the
 //			Input plugin SDK.
 //
 // Authors:	Written by Paul Quinn and Richard Carlson.
@@ -13,7 +13,7 @@
 //
 //	Copyright (C) 1997-2002 Quinnware
 //
-//	This code is free.  If you redistribute it in any form, leave this notice 
+//	This code is free.  If you redistribute it in any form, leave this notice
 //	here.
 //
 //	This program is distributed in the hope that it will be useful,
@@ -46,7 +46,7 @@
 #define PLAYFLAG_SEEKING			0x2
 
 // Wave Marker flags
-#define WAVE_VIS_DATA_ONLY			-1	// set to WaveDataStruct.markerstart in OutputWrite() call have data only go to vis 
+#define WAVE_VIS_DATA_ONLY			-1	// set to WaveDataStruct.markerstart in OutputWrite() call have data only go to vis
 										// and not to output plugin
 // pause flags
 #define PAUSE_DISABLED				0	// Pause() call is to unpause playback
@@ -55,7 +55,7 @@
 //-----------------------------------------------------------------------------
 // Input Module
 //-----------------------------------------------------------------------------
-typedef struct 
+typedef struct
 {
 	unsigned int		size;			// size of init structure
 	unsigned int		version;		// plugin structure version (set to PLUGIN_API_VERSION)
@@ -74,8 +74,8 @@ typedef struct
 
 																	// output plugin calls
 		int  (*OutputOpen)(const char* medianame, WAVEFORMATEX*);	// open output for wave data
-		int  (*OutputWrite)(WriteDataStruct*);						// send PCM audio data to output 
-																		// (blocks until write completes, thus if output is paused can 
+		int  (*OutputWrite)(WriteDataStruct*);						// send PCM audio data to output
+																		// (blocks until write completes, thus if output is paused can
 																		// block until unpaused)
 		int  (*OutputDrain)(int flags);								// wait for all output to complete (blocking)
 		int  (*OutputDrainCancel)(int flags);						// break a drain in progress
@@ -89,7 +89,7 @@ typedef struct
 		void *Reserved[10];
 	} toPlayer;
 
-	struct 
+	struct
 	{
 		int  (*Initialize)(QCDModInfo *modInfo, int flags);			// initialize plugin
 		void (*ShutDown)(int flags);								// shutdown plugin
diff --git a/plugins/QCD/resource.h b/plugins/QCD/resource.h
index 1080a77..81a33ad 100644
--- a/plugins/QCD/resource.h
+++ b/plugins/QCD/resource.h
@@ -22,7 +22,7 @@
 #define IDC_MAIL3                       1054
 
 // Next default values for new objects
-// 
+//
 #ifdef APSTUDIO_INVOKED
 #ifndef APSTUDIO_READONLY_SYMBOLS
 #define _APS_NEXT_RESOURCE_VALUE        109
diff --git a/plugins/QCDMp4/QCDInputDLL.h b/plugins/QCDMp4/QCDInputDLL.h
index d1ac911..3d021ba 100644
--- a/plugins/QCDMp4/QCDInputDLL.h
+++ b/plugins/QCDMp4/QCDInputDLL.h
@@ -1,5 +1,5 @@
 //-----------------------------------------------------------------------------
-// 
+//
 // File:	QCDInputDLL.h
 //
 // About:	QCD Player Input module DLL interface.  For more documentation, see
@@ -11,7 +11,7 @@
 //
 //	Copyright (C) 1997-2002 Quinnware
 //
-//	This code is free.  If you redistribute it in any form, leave this notice 
+//	This code is free.  If you redistribute it in any form, leave this notice
 //	here.
 //
 //	This program is distributed in the hope that it will be useful,
diff --git a/plugins/QCDMp4/QCDModDefs.h b/plugins/QCDMp4/QCDModDefs.h
index ee8da33..55ad9e5 100644
--- a/plugins/QCDMp4/QCDModDefs.h
+++ b/plugins/QCDMp4/QCDModDefs.h
@@ -13,7 +13,7 @@
 //
 //	Copyright (C) 1997-2002 Quinnware
 //
-//	This code is free.  If you redistribute it in any form, leave this notice 
+//	This code is free.  If you redistribute it in any form, leave this notice
 //	here.
 //
 //	This program is distributed in the hope that it will be useful,
@@ -37,7 +37,7 @@
 // Current plugin version
 
 // use this version for old style API calls (all returned text in native encoding)
-#define PLUGIN_API_VERSION				250		
+#define PLUGIN_API_VERSION				250
 
 // use this version for new style API calls (all returned text in UTF8 encoding on WinNT/2K/XP (native encoding on Win9x))
 #define PLUGIN_API_VERSION_WANTUTF8		((PLUGIN_API_WANTUTF8<<16)|PLUGIN_API_VERSION)
@@ -45,7 +45,7 @@
 
 //-----------------------------------------------------------------------------
 
-typedef struct 
+typedef struct
 {
 	char				*moduleString;
 	char				*moduleExtensions;
@@ -54,7 +54,7 @@ typedef struct
 //-----------------------------------------------------------------------------
 // Services (ops) provided by the Player
 //-----------------------------------------------------------------------------
-typedef enum 
+typedef enum
 {									//*** below returns numeric info (*buffer not used)
 
 	opGetPlayerVersion = 0,			// high-order word = major version (eg 3.01 is 3), low-order word = minor (eg 3.01 = 1)
@@ -72,7 +72,7 @@ typedef enum
 	opGetTrackLength = 14,			// get track length, param1 = index of track in playlist, -1 for current
 									//                   param2 = 0 for seconds, 1 for milliseconds
 	opGetTime = 15,					// get time on player, param1 = 0 for time displayed, 1 for track time, 2 for playlist time
-									//					   param2 = 0 for elapsed, 1 for remaining														   
+									//					   param2 = 0 for elapsed, 1 for remaining
 	opGetTrackState = 16,			// get whether track is marked, param1 = index of track, -1 for current
 	opGetPlaylistNum = 17,			// get playlist number of index, param1 = index of track in playlist, -1 for current
 	opGetMediaType = 18,			// get media type of track, param1 = index if track in playlist, -1 for current
@@ -97,17 +97,17 @@ typedef enum
 
 	opGetExtensionWnd = 30,			// handle to the draggable window extension (only available on some skins), param1 = extension number (0 - 9)
 	opGetExtVisWnd = 31,			// handle to the external visual window
-	opGetMusicBrowserWnd = 32,		// handle to the music browser window 
-	opGetSkinPreviewWnd = 33,		// handle to the skin preview window 
-	opGetPropertiesWnd = 34,		// handle to the player properties window 
-	opGetExtInfoWnd = 35,			// handle to the extended information window 
-	opGetAboutWnd = 36,				// handle to the about window 
-	opGetSegmentsWnd = 37,			// handle to the segments window 
-	opGetEQPresetsWnd = 38,			// handle to the EQ presets window 
-	opGetVideoWnd = 39,				// handle to the video window 
+	opGetMusicBrowserWnd = 32,		// handle to the music browser window
+	opGetSkinPreviewWnd = 33,		// handle to the skin preview window
+	opGetPropertiesWnd = 34,		// handle to the player properties window
+	opGetExtInfoWnd = 35,			// handle to the extended information window
+	opGetAboutWnd = 36,				// handle to the about window
+	opGetSegmentsWnd = 37,			// handle to the segments window
+	opGetEQPresetsWnd = 38,			// handle to the EQ presets window
+	opGetVideoWnd = 39,				// handle to the video window
 
 	opGetVisDimensions = 50,		// gets the width and height of visual window (param1 = -1 current vis window, 0 internal vis, 1 external vis, 2 full screen)
-									//		returns: HEIGHT in high word, WIDTH in low word 
+									//		returns: HEIGHT in high word, WIDTH in low word
 
 	opShowVideoWindow = 55,			// Show or Close video window (param1 = 1 for create, 2 for create and show, 0 for close)
 
@@ -143,10 +143,10 @@ typedef enum
 	opGetSkinFolder = 112,			// get current skin folder
 	opGetCDDBCacheFolder = 113,		// get current folder for CDDB cached info
 
-	opGetCurrentPlaylist = 114,		// get full pathname of playlist currently loaded 
+	opGetCurrentPlaylist = 114,		// get full pathname of playlist currently loaded
 
 	opGetMediaID = 115,				// get media identifier, param2 = index of track in playlist, -1 for current
-									//		- for CD's it's the TOC - for anything else, right now it's 0      
+									//		- for CD's it's the TOC - for anything else, right now it's 0
 
 	opGetSupportedExtensions = 116,	// get file extensions supported by the player, param2 = 0 - get all extensions, 1 - get registered extensions
 									//		- returned extensions will be colon delimited
@@ -196,14 +196,14 @@ typedef enum
 	opSetPlayNext = 1009,			// set the next index to be played (buffer = NULL, param1 = index, index = -1 unsets playnext)
 	opSetIndexFilename = 1010,		// updates the filename (or stream) that an index in the current playlist refers to, buffer = new filename, param1 = index
 
-	opSetPlaylist = 1006,			// clear playlist, add files to playlist or reset playlist with new files 
+	opSetPlaylist = 1006,			// clear playlist, add files to playlist or reset playlist with new files
 									//		buffer = file list (each file in quotes, string null terminated) Eg; buffer="\"file1.mp3\" \"file2.mp3\"\0" - NULL to clear playlist
-									//		param1 = (string ptr)originating path (can be NULL if paths included with files) 
+									//		param1 = (string ptr)originating path (can be NULL if paths included with files)
 									//		param2 = 1 - clear playlist flag, 2 - enqueue to top
 
-	opInsertPlaylist = 1011,		// insert tracks into playlist 
+	opInsertPlaylist = 1011,		// insert tracks into playlist
 									//		buffer = file list (each file in quotes, string null terminated) Eg; buffer="\"file1.mp3\" \"file2.mp3\"\0"
-									//		param1 = (string ptr)originating path (can be NULL if paths included with files) 
+									//		param1 = (string ptr)originating path (can be NULL if paths included with files)
 									//		param2 = index location to insert tracks (-1 to insert at end)
 
 	opMovePlaylistTrack = 1012,		// param1 = index of track to move, param2 = destination index (move shifts tracks between param1 and param2)
@@ -267,7 +267,7 @@ typedef struct				// for Output Plugin Write callback
 	UINT	nch;			// number of channels
 	UINT	srate;			// sample rate
 
-	UINT	markerstart;	// Marker position at start of data (marker is time value of data) 
+	UINT	markerstart;	// Marker position at start of data (marker is time value of data)
 							// (set to WAVE_VIS_DATA_ONLY to not have data sent to output plugins)
 	UINT	markerend;		// Marker position at end of data (not currently used, set to 0)
 } WriteDataStruct;
@@ -276,18 +276,18 @@ typedef struct				// for Output Plugin Write callback
 typedef struct			// for GetTrackExtents Input Plugin callback
 {
 	UINT track;			// for CD's, set the track number. Otherwise set to 1.
-	UINT start;			// for CD's or media that doesn't start at the beginning 
+	UINT start;			// for CD's or media that doesn't start at the beginning
 						// of the file, set to start position. Otherwise set to 0.
 	UINT end;			// set to end position of media.
 	UINT unitpersec;	// whatever units are being used for this media, how many
-						// of them per second. 
+						// of them per second.
 						// (Note: ((end - start) / unitpersecond) = file length
 	UINT bytesize;		// size of file in bytes (if applicable, otherwise 0).
 } TrackExtents;
 
 //-----------------------------------------------------------------------------
 typedef struct			// for opSetAudioInfo service
-{		
+{
     long struct_size;	// sizeof(AudioInfo)
     long level;			// MPEG level (1 for MPEG1, 2 for MPEG2, 3 for MPEG2.5, 7 for MPEGpro)
     long layer;			// and layer (1, 2 or 3)
@@ -303,7 +303,7 @@ typedef struct			// for opSetAudioInfo service
 typedef struct			// for coming QCD version
 {
 	long struct_size;	// sizeof(EQInfo)
-	char enabled;		
+	char enabled;
 	char preamp;		// -128 to 127, 0 is even
 	char bands[10];		// -128 to 127, 0 is even
 } EQInfo;
@@ -320,7 +320,7 @@ typedef struct
 
 //-----------------------------------------------------------------------------
 typedef enum			// for MediaInfo.mediaType
-{ 
+{
 	UNKNOWN_MEDIA = 0,
 	CD_AUDIO_MEDIA = 1,
 	DIGITAL_FILE_MEDIA = 2,
diff --git a/plugins/QCDMp4/QCDModInput.h b/plugins/QCDMp4/QCDModInput.h
index 31d3bff..97d0c26 100644
--- a/plugins/QCDMp4/QCDModInput.h
+++ b/plugins/QCDMp4/QCDModInput.h
@@ -2,7 +2,7 @@
 //
 // File:	QCDModInput.h
 //
-// About:	Input plugin module interface.  This file is published with the 
+// About:	Input plugin module interface.  This file is published with the
 //			Input plugin SDK.
 //
 // Authors:	Written by Paul Quinn and Richard Carlson.
@@ -13,7 +13,7 @@
 //
 //	Copyright (C) 1997-2002 Quinnware
 //
-//	This code is free.  If you redistribute it in any form, leave this notice 
+//	This code is free.  If you redistribute it in any form, leave this notice
 //	here.
 //
 //	This program is distributed in the hope that it will be useful,
@@ -46,7 +46,7 @@
 #define PLAYFLAG_SEEKING			0x2
 
 // Wave Marker flags
-#define WAVE_VIS_DATA_ONLY			-1	// set to WaveDataStruct.markerstart in OutputWrite() call have data only go to vis 
+#define WAVE_VIS_DATA_ONLY			-1	// set to WaveDataStruct.markerstart in OutputWrite() call have data only go to vis
 										// and not to output plugin
 // pause flags
 #define PAUSE_DISABLED				0	// Pause() call is to unpause playback
@@ -55,7 +55,7 @@
 //-----------------------------------------------------------------------------
 // Input Module
 //-----------------------------------------------------------------------------
-typedef struct 
+typedef struct
 {
 	unsigned int		size;			// size of init structure
 	unsigned int		version;		// plugin structure version (set to PLUGIN_API_VERSION)
@@ -74,8 +74,8 @@ typedef struct
 
 																	// output plugin calls
 		int  (*OutputOpen)(const char* medianame, WAVEFORMATEX*);	// open output for wave data
-		int  (*OutputWrite)(WriteDataStruct*);						// send PCM audio data to output 
-																		// (blocks until write completes, thus if output is paused can 
+		int  (*OutputWrite)(WriteDataStruct*);						// send PCM audio data to output
+																		// (blocks until write completes, thus if output is paused can
 																		// block until unpaused)
 		int  (*OutputDrain)(int flags);								// wait for all output to complete (blocking)
 		int  (*OutputDrainCancel)(int flags);						// break a drain in progress
@@ -89,7 +89,7 @@ typedef struct
 		void *Reserved[10];
 	} toPlayer;
 
-	struct 
+	struct
 	{
 		int  (*Initialize)(QCDModInfo *modInfo, int flags);			// initialize plugin
 		void (*ShutDown)(int flags);								// shutdown plugin
diff --git a/plugins/QCDMp4/QCDModTagEditor.h b/plugins/QCDMp4/QCDModTagEditor.h
index c06f5d1..b8ae16e 100644
--- a/plugins/QCDMp4/QCDModTagEditor.h
+++ b/plugins/QCDMp4/QCDModTagEditor.h
@@ -2,7 +2,7 @@
 //
 // File:	QCDModTagEditor
 //
-// About:	Tag Editing plugin module interface.  This file is published with the 
+// About:	Tag Editing plugin module interface.  This file is published with the
 //			QCD plugin SDK.
 //
 // Authors:	Written by Paul Quinn
@@ -13,7 +13,7 @@
 //
 //	Copyright (C) 2002 Quinnware
 //
-//	This code is free.  If you redistribute it in any form, leave this notice 
+//	This code is free.  If you redistribute it in any form, leave this notice
 //	here.
 //
 //	This program is distributed in the hope that it will be useful,
@@ -37,10 +37,10 @@ typedef enum
 
 	TAGFIELD_TITLE = 0,
 	TAGFIELD_ARTIST,
-	TAGFIELD_ALBUM, 
+	TAGFIELD_ALBUM,
 	TAGFIELD_GENRE,
-	TAGFIELD_YEAR,  
-	TAGFIELD_TRACK, 
+	TAGFIELD_YEAR,
+	TAGFIELD_TRACK,
 	TAGFIELD_COMMENT,
 
 	TAGFIELD_COMPOSER,
@@ -49,7 +49,7 @@ typedef enum
 	TAGFIELD_YEARCOMPOSED,
 
 	TAGFIELD_ORIGARTIST,
-	TAGFIELD_LABEL, 
+	TAGFIELD_LABEL,
 	TAGFIELD_COPYRIGHT,
 	TAGFIELD_ENCODER,
 	TAGFIELD_CDDBTAGID,
@@ -59,7 +59,7 @@ typedef enum
 
 //-----------------------------------------------------------------------------
 
-typedef struct 
+typedef struct
 {
 	UINT	size;			// size of init structure
 	UINT	version;		// plugin structure version (set to PLUGIN_API_VERSION)
diff --git a/plugins/QCDMp4/QCDMp4.c b/plugins/QCDMp4/QCDMp4.c
index da5063b..ce81378 100644
--- a/plugins/QCDMp4/QCDMp4.c
+++ b/plugins/QCDMp4/QCDMp4.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
@@ -544,7 +544,7 @@ int Initialize(QCDModInfo *ModInfo, int flags)
 
 //----------------------------------------------------------------------------
 
-void ShutDown(int flags) 
+void ShutDown(int flags)
 {
 	Stop(mp4state.filename, STOPFLAG_FORCESTOP);
 }
@@ -1443,7 +1443,7 @@ int skip_id3v2_tag()
     return tagsize;
 }
 
-int GetMediaSupported(const char* medianame, MediaInfo *mediaInfo) 
+int GetMediaSupported(const char* medianame, MediaInfo *mediaInfo)
 {
     int tagsize = 0, init;
 
@@ -2451,7 +2451,7 @@ DWORD WINAPI MP4PlayThread(void *b)
                 }
             }
         }
-		
+
 		Sleep(10);
 
 		// catch pause
@@ -2710,7 +2710,7 @@ DWORD WINAPI AACPlayThread(void *b)
             if (frameInfo.channels > 0 && mp4state.samplerate > 0)
                 mp4state.cur_pos_sec += ((double)(frameInfo.samples/frameInfo.channels))/(double)mp4state.samplerate;
         }
-		
+
 		Sleep(10);
 
 		// catch pause
@@ -2748,7 +2748,7 @@ PLUGIN_API QCDModInitIn* INPUTDLL_ENTRY_POINT(QCDModInitIn *ModInit, QCDModInfo
 	module.QCDCallbacks.toModule.Pause				= Pause;
 	module.QCDCallbacks.toModule.Stop				= Stop;
 	module.QCDCallbacks.toModule.About				= About;
-	module.QCDCallbacks.toModule.Configure			= Configure;	
+	module.QCDCallbacks.toModule.Configure			= Configure;
 	module.QCDCallbacks.toModule.SetEQ				= NULL;
 	module.QCDCallbacks.toModule.SetVolume			= SetVolume;
 
@@ -2964,7 +2964,7 @@ PLUGIN_API QCDModInitIn* INPUTDLL_ENTRY_POINT(QCDModInitIn *ModInit, QCDModInfo
 //    free(temp);
 //
 //    return ret;
-//}    
+//}
 //
 //__declspec(dllexport) int winampWriteExtendedFileInfo()
 //{
diff --git a/plugins/QCDMp4/QCDMp4Tag.cpp b/plugins/QCDMp4/QCDMp4Tag.cpp
index ed49c1d..23ff577 100644
--- a/plugins/QCDMp4/QCDMp4Tag.cpp
+++ b/plugins/QCDMp4/QCDMp4Tag.cpp
@@ -304,7 +304,7 @@ UINT uGetDlgItemText(void *tagHandle, int fieldId, char *str, int max);
 //------------------------------------------------------------------------------
 
 PLUGIN_API QCDModInitTag* TAGEDITORDLL_ENTRY_POINT()
-{	
+{
 	ModInitTag.size			= sizeof(QCDModInitTag);
 	ModInitTag.version		= PLUGIN_API_VERSION;
 	ModInitTag.ShutDown		= ShutDown_Tag;
@@ -607,7 +607,7 @@ bool Strip_Tag(LPCSTR filename)
 	file = MP4Modify(filename, 0, 0);
 	if (file == MP4_INVALID_FILE_HANDLE)
 		return false;
-	
+
 	MP4MetadataDelete(file);
 
 	MP4Close(file);
diff --git a/plugins/QCDMp4/aac2mp4.cpp b/plugins/QCDMp4/aac2mp4.cpp
index 1a0aba4..cf5b6d1 100644
--- a/plugins/QCDMp4/aac2mp4.cpp
+++ b/plugins/QCDMp4/aac2mp4.cpp
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
@@ -89,8 +89,8 @@ int covert_aac_to_mp4(char *inputFileName, char *mp4FileName)
 
 static u_int8_t firstHeader[ADTS_HEADER_MAX_SIZE];
 
-/* 
- * hdr must point to at least ADTS_HEADER_MAX_SIZE bytes of memory 
+/*
+ * hdr must point to at least ADTS_HEADER_MAX_SIZE bytes of memory
  */
 static bool LoadNextAdtsHeader(FILE* inFile, u_int8_t* hdr)
 {
@@ -136,7 +136,7 @@ static bool LoadNextAdtsHeader(FILE* inFile, u_int8_t* hdr)
 					hdr[state] = b;
 					state = 1;
 				} else {
-					 /* else drop it */ 
+					 /* else drop it */
 					dropped++;
 				}
 			}
@@ -160,14 +160,14 @@ static bool LoadNextAacFrame(FILE* inFile, u_int8_t* pBuf, u_int32_t* pBufSize,
 	if (!LoadNextAdtsHeader(inFile, hdrBuf)) {
 		return false;
 	}
-	
+
 	/* get frame size from header */
 	frameSize = MP4AV_AdtsGetFrameSize(hdrBuf);
 
 	/* get header size in bits and bytes from header */
 	hdrBitSize = MP4AV_AdtsGetHeaderBitSize(hdrBuf);
 	hdrByteSize = MP4AV_AdtsGetHeaderByteSize(hdrBuf);
-	
+
 	/* adjust the frame size to what remains to be read */
 	frameSize -= hdrByteSize;
 
@@ -219,7 +219,7 @@ static bool GetFirstHeader(FILE* inFile)
 
 	/* remember where we are */
 	fgetpos(inFile, &curPos);
-	
+
 	/* go back to start of file */
 	rewind(inFile);
 
@@ -273,8 +273,8 @@ MP4TrackId AacCreator(MP4FileHandle mp4File, FILE* inFile)
 	}
 
 	// add the new audio track
-	MP4TrackId trackId = 
-		MP4AddAudioTrack(mp4File, 
+	MP4TrackId trackId =
+		MP4AddAudioTrack(mp4File,
 			samplesPerSecond, 1024, audioType);
 
 	if (trackId == MP4_INVALID_TRACK_ID) {
@@ -295,7 +295,7 @@ MP4TrackId AacCreator(MP4FileHandle mp4File, FILE* inFile)
 		samplesPerSecond,
 		channelConfig);
 
-	if (!MP4SetTrackESConfiguration(mp4File, trackId, 
+	if (!MP4SetTrackESConfiguration(mp4File, trackId,
 	  pConfig, configLength)) {
 		MP4DeleteTrack(mp4File, trackId);
 		return MP4_INVALID_TRACK_ID;
diff --git a/plugins/QCDMp4/aac2mp4.h b/plugins/QCDMp4/aac2mp4.h
index 30fe280..9906065 100644
--- a/plugins/QCDMp4/aac2mp4.h
+++ b/plugins/QCDMp4/aac2mp4.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/plugins/QCDMp4/aacinfo.c b/plugins/QCDMp4/aacinfo.c
index b192d64..71b5543 100644
--- a/plugins/QCDMp4/aacinfo.c
+++ b/plugins/QCDMp4/aacinfo.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/plugins/QCDMp4/aacinfo.h b/plugins/QCDMp4/aacinfo.h
index fe501ce..2e9fbd5 100644
--- a/plugins/QCDMp4/aacinfo.h
+++ b/plugins/QCDMp4/aacinfo.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/plugins/QCDMp4/config.c b/plugins/QCDMp4/config.c
index 3dbbbec..b7d0ad1 100644
--- a/plugins/QCDMp4/config.c
+++ b/plugins/QCDMp4/config.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/plugins/QCDMp4/config.h b/plugins/QCDMp4/config.h
index 077d46c..4be4ad2 100644
--- a/plugins/QCDMp4/config.h
+++ b/plugins/QCDMp4/config.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/plugins/QCDMp4/mbs.h b/plugins/QCDMp4/mbs.h
index cca5745..f5722d6 100644
--- a/plugins/QCDMp4/mbs.h
+++ b/plugins/QCDMp4/mbs.h
@@ -3,24 +3,24 @@
  * License Version 1.1 (the "License"); you may not use this file
  * except in compliance with the License. You may obtain a copy of
  * the License at http://www.mozilla.org/MPL/
- * 
+ *
  * Software distributed under the License is distributed on an "AS
  * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  * implied. See the License for the specific language governing
  * rights and limitations under the License.
- * 
+ *
  * The Original Code is MPEG4IP.
- * 
+ *
  * The Initial Developer of the Original Code is Cisco Systems Inc.
  * Portions created by Cisco Systems Inc. are
  * Copyright (C) Cisco Systems Inc. 2001-2002.  All Rights Reserved.
- * 
- * Contributor(s): 
+ *
+ * Contributor(s):
  *		Dave Mackie		dmackie@cisco.com
  */
 
 #ifndef __MBS_INCLUDED__
-#define __MBS_INCLUDED__ 
+#define __MBS_INCLUDED__
 
 class CMemoryBitstream {
 public:
@@ -77,5 +77,5 @@ protected:
 	u_int32_t	m_numBits;
 };
 
-#endif /* __MBS_INCLUDED__ */ 
+#endif /* __MBS_INCLUDED__ */
 
diff --git a/plugins/QCDMp4/resource.h b/plugins/QCDMp4/resource.h
index 08fa5e1..79cd7d6 100644
--- a/plugins/QCDMp4/resource.h
+++ b/plugins/QCDMp4/resource.h
@@ -56,7 +56,7 @@
 #define IDC_TITLEFORMAT                 1040
 
 // Next default values for new objects
-// 
+//
 #ifdef APSTUDIO_INVOKED
 #ifndef APSTUDIO_READONLY_SYMBOLS
 #define _APS_NEXT_RESOURCE_VALUE        103
diff --git a/plugins/QCDMp4/utils.c b/plugins/QCDMp4/utils.c
index c5e5680..366bba4 100644
--- a/plugins/QCDMp4/utils.c
+++ b/plugins/QCDMp4/utils.c
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/plugins/QCDMp4/utils.h b/plugins/QCDMp4/utils.h
index e6014fa..d497265 100644
--- a/plugins/QCDMp4/utils.h
+++ b/plugins/QCDMp4/utils.h
@@ -1,19 +1,19 @@
 /*
 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
-**  
+**
 ** 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 
+** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 **
 ** Any non-GPL usage of this software or parts of this software is strictly
diff --git a/project/msvc/faad.vcxproj b/project/msvc/faad.vcxproj
index c741e31..c26bb2e 100644
--- a/project/msvc/faad.vcxproj
+++ b/project/msvc/faad.vcxproj
@@ -5,23 +5,39 @@
       <Configuration>Debug</Configuration>
       <Platform>Win32</Platform>
     </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
     <ProjectConfiguration Include="Release|Win32">
       <Configuration>Release</Configuration>
       <Platform>Win32</Platform>
     </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGuid>{2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}</ProjectGuid>
-    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset>v141</PlatformToolset>
+    <PlatformToolset>v142</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <PlatformToolset>v142</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
     <ConfigurationType>Application</ConfigurationType>
-    <PlatformToolset>v141</PlatformToolset>
+    <PlatformToolset>v142</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>Application</ConfigurationType>
+    <PlatformToolset>v142</PlatformToolset>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">
@@ -29,9 +45,15 @@
   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
   </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
   </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup>
     <_ProjectFileVersion>15.0.26730.12</_ProjectFileVersion>
@@ -44,6 +66,14 @@
     <CodeAnalysisRules />
     <CodeAnalysisRuleAssemblies />
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <OutDir>.\bin\$(Configuration)\</OutDir>
+    <IntDir>.\intermediate\$(Configuration)\$(ProjectName)\</IntDir>
+    <LinkIncremental>true</LinkIncremental>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <CodeAnalysisRules />
+    <CodeAnalysisRuleAssemblies />
+  </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <OutDir>.\bin\$(Configuration)\</OutDir>
     <IntDir>.\intermediate\$(Configuration)\$(ProjectName)\</IntDir>
@@ -52,13 +82,21 @@
     <CodeAnalysisRules />
     <CodeAnalysisRuleAssemblies />
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <OutDir>.\bin\$(Configuration)\</OutDir>
+    <IntDir>.\intermediate\$(Configuration)\$(ProjectName)\</IntDir>
+    <LinkIncremental>false</LinkIncremental>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <CodeAnalysisRules />
+    <CodeAnalysisRuleAssemblies />
+  </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <Midl>
       <TypeLibraryName>.\Debug/faad.tlb</TypeLibraryName>
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>../../include;../../common/mp4ff;../../frontend;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../include;../../frontend;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -75,6 +113,30 @@
       <SubSystem>Console</SubSystem>
     </Link>
   </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <Midl>
+      <TypeLibraryName>.\Debug/faad.tlb</TypeLibraryName>
+    </Midl>
+    <ClCompile>
+      <Optimization>Disabled</Optimization>
+      <AdditionalIncludeDirectories>../../include;../../frontend;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+    </ClCompile>
+    <ResourceCompile>
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <Culture>0x0413</Culture>
+    </ResourceCompile>
+    <Link>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <SubSystem>Console</SubSystem>
+    </Link>
+  </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <Midl>
       <TypeLibraryName>.\Release/faad.tlb</TypeLibraryName>
@@ -84,7 +146,7 @@
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
       <IntrinsicFunctions>true</IntrinsicFunctions>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
-      <AdditionalIncludeDirectories>../../include;../../common/mp4ff;../../frontend;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../include;../../frontend;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -100,6 +162,32 @@
       <SubSystem>Console</SubSystem>
     </Link>
   </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <Midl>
+      <TypeLibraryName>.\Release/faad.tlb</TypeLibraryName>
+    </Midl>
+    <ClCompile>
+      <Optimization>MinSpace</Optimization>
+      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+      <AdditionalIncludeDirectories>../../include;../../frontend;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <StringPooling>true</StringPooling>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+    </ClCompile>
+    <ResourceCompile>
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <Culture>0x0413</Culture>
+    </ResourceCompile>
+    <Link>
+      <SubSystem>Console</SubSystem>
+    </Link>
+  </ItemDefinitionGroup>
   <ItemGroup>
     <ClCompile Include="..\..\frontend\audio.c" />
     <ClCompile Include="..\..\frontend\main.c" />
@@ -108,7 +196,6 @@
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\frontend\getopt.h" />
-    <ClInclude Include="..\..\common\mp4v2\win32_ver.h" />
     <ClInclude Include="..\..\frontend\mp4read.h" />
     <ClInclude Include="..\..\frontend\unicode_support.h" />
     <ClInclude Include="..\..\include\neaacdec.h" />
diff --git a/project/msvc/faad.vcxproj.filters b/project/msvc/faad.vcxproj.filters
index 47e778a..d380b99 100644
--- a/project/msvc/faad.vcxproj.filters
+++ b/project/msvc/faad.vcxproj.filters
@@ -34,9 +34,6 @@
     <ClInclude Include="..\..\include\neaacdec.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\common\mp4v2\win32_ver.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\frontend\mp4read.h">
       <Filter>Header Files</Filter>
     </ClInclude>
diff --git a/project/msvc/faad2.sln b/project/msvc/faad2.sln
index 3be42cd..9094553 100644
--- a/project/msvc/faad2.sln
+++ b/project/msvc/faad2.sln
@@ -1,6 +1,6 @@
 Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.27130.2010
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30114.105
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfaad", "libfaad.vcxproj", "{BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}"
 EndProject
@@ -11,21 +11,35 @@ EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Win32 = Debug|Win32
+		Debug|x64 = Debug|x64
 		Release|Win32 = Release|Win32
+		Release|x64 = Release|x64
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
 		{BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Debug|Win32.ActiveCfg = Debug|Win32
 		{BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Debug|Win32.Build.0 = Debug|Win32
+		{BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Debug|x64.ActiveCfg = Debug|x64
+		{BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Debug|x64.Build.0 = Debug|x64
 		{BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Release|Win32.ActiveCfg = Release|Win32
 		{BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Release|Win32.Build.0 = Release|Win32
+		{BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Release|x64.ActiveCfg = Release|x64
+		{BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Release|x64.Build.0 = Release|x64
 		{482DA264-EE88-4575-B208-87C4CB80CD08}.Debug|Win32.ActiveCfg = Debug|Win32
 		{482DA264-EE88-4575-B208-87C4CB80CD08}.Debug|Win32.Build.0 = Debug|Win32
+		{482DA264-EE88-4575-B208-87C4CB80CD08}.Debug|x64.ActiveCfg = Debug|x64
+		{482DA264-EE88-4575-B208-87C4CB80CD08}.Debug|x64.Build.0 = Debug|x64
 		{482DA264-EE88-4575-B208-87C4CB80CD08}.Release|Win32.ActiveCfg = Release|Win32
 		{482DA264-EE88-4575-B208-87C4CB80CD08}.Release|Win32.Build.0 = Release|Win32
+		{482DA264-EE88-4575-B208-87C4CB80CD08}.Release|x64.ActiveCfg = Release|x64
+		{482DA264-EE88-4575-B208-87C4CB80CD08}.Release|x64.Build.0 = Release|x64
 		{2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Debug|Win32.ActiveCfg = Debug|Win32
 		{2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Debug|Win32.Build.0 = Debug|Win32
+		{2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Debug|x64.ActiveCfg = Debug|x64
+		{2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Debug|x64.Build.0 = Debug|x64
 		{2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Release|Win32.ActiveCfg = Release|Win32
 		{2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Release|Win32.Build.0 = Release|Win32
+		{2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Release|x64.ActiveCfg = Release|x64
+		{2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Release|x64.Build.0 = Release|x64
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
diff --git a/project/msvc/libfaad.vcxproj b/project/msvc/libfaad.vcxproj
index 5f194b5..6f75dce 100644
--- a/project/msvc/libfaad.vcxproj
+++ b/project/msvc/libfaad.vcxproj
@@ -5,23 +5,39 @@
       <Configuration>Debug</Configuration>
       <Platform>Win32</Platform>
     </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
     <ProjectConfiguration Include="Release|Win32">
       <Configuration>Release</Configuration>
       <Platform>Win32</Platform>
     </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGuid>{BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}</ProjectGuid>
-    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
     <ConfigurationType>StaticLibrary</ConfigurationType>
-    <PlatformToolset>v141</PlatformToolset>
+    <PlatformToolset>v142</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <PlatformToolset>v142</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
     <ConfigurationType>StaticLibrary</ConfigurationType>
-    <PlatformToolset>v141</PlatformToolset>
+    <PlatformToolset>v142</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <PlatformToolset>v142</PlatformToolset>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">
@@ -29,9 +45,15 @@
   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
   </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
   </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup>
     <_ProjectFileVersion>15.0.26730.12</_ProjectFileVersion>
@@ -43,6 +65,13 @@
     <CodeAnalysisRules />
     <CodeAnalysisRuleAssemblies />
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <OutDir>.\bin\$(Configuration)\</OutDir>
+    <IntDir>.\intermediate\$(Configuration)\$(ProjectName)\</IntDir>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <CodeAnalysisRules />
+    <CodeAnalysisRuleAssemblies />
+  </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <OutDir>.\bin\$(Configuration)\</OutDir>
     <IntDir>.\intermediate\$(Configuration)\$(ProjectName)\</IntDir>
@@ -50,6 +79,13 @@
     <CodeAnalysisRules />
     <CodeAnalysisRuleAssemblies />
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <OutDir>.\bin\$(Configuration)\</OutDir>
+    <IntDir>.\intermediate\$(Configuration)\$(ProjectName)\</IntDir>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <CodeAnalysisRules />
+    <CodeAnalysisRuleAssemblies />
+  </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
@@ -74,6 +110,31 @@
       <Message>Retrieving package version...</Message>
     </PreBuildEvent>
   </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <ClCompile>
+      <Optimization>MaxSpeed</Optimization>
+      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+      <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;NDEBUG;WIN32;_LIB;HAVE_LRINTF;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <StringPooling>true</StringPooling>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+    </ClCompile>
+    <ResourceCompile>
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <Culture>0x0413</Culture>
+    </ResourceCompile>
+    <Lib />
+    <PreBuildEvent>
+      <Command>"$(SolutionDir)..\..\utils\win32\ac2ver.exe" "faad2" "$(SolutionDir)..\..\configure.ac" &gt; "$(SolutionDir)..\..\libfaad\win32_ver.h"</Command>
+    </PreBuildEvent>
+    <PreBuildEvent>
+      <Message>Retrieving package version...</Message>
+    </PreBuildEvent>
+  </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
@@ -97,6 +158,30 @@
       <Message>Retrieving package version...</Message>
     </PreBuildEvent>
   </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <ClCompile>
+      <Optimization>Disabled</Optimization>
+      <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_DEBUG;WIN32;_LIB;HAVE_LRINTF;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+    </ClCompile>
+    <ResourceCompile>
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <Culture>0x0413</Culture>
+    </ResourceCompile>
+    <Lib />
+    <PreBuildEvent>
+      <Command>"$(SolutionDir)..\..\utils\win32\ac2ver.exe" "faad2" "$(SolutionDir)..\..\configure.ac" &gt; "$(SolutionDir)..\..\libfaad\win32_ver.h"</Command>
+    </PreBuildEvent>
+    <PreBuildEvent>
+      <Message>Retrieving package version...</Message>
+    </PreBuildEvent>
+  </ItemDefinitionGroup>
   <ItemGroup>
     <ClCompile Include="..\..\libfaad\bits.c" />
     <ClCompile Include="..\..\libfaad\cfft.c" />
diff --git a/project/msvc/libfaad2_dll.vcxproj b/project/msvc/libfaad2_dll.vcxproj
index 51b43b9..9c3c766 100644
--- a/project/msvc/libfaad2_dll.vcxproj
+++ b/project/msvc/libfaad2_dll.vcxproj
@@ -5,23 +5,39 @@
       <Configuration>Debug</Configuration>
       <Platform>Win32</Platform>
     </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
     <ProjectConfiguration Include="Release|Win32">
       <Configuration>Release</Configuration>
       <Platform>Win32</Platform>
     </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGuid>{482DA264-EE88-4575-B208-87C4CB80CD08}</ProjectGuid>
-    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
     <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <PlatformToolset>v141</PlatformToolset>
+    <PlatformToolset>v142</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <PlatformToolset>v142</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
     <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <PlatformToolset>v141</PlatformToolset>
+    <PlatformToolset>v142</PlatformToolset>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <PlatformToolset>v142</PlatformToolset>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ImportGroup Label="ExtensionSettings">
@@ -29,9 +45,15 @@
   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
   </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
   <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
     <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
   </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup>
     <_ProjectFileVersion>15.0.26730.12</_ProjectFileVersion>
@@ -44,6 +66,14 @@
     <CodeAnalysisRules />
     <CodeAnalysisRuleAssemblies />
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <OutDir>.\bin\$(Configuration)\</OutDir>
+    <IntDir>.\intermediate\$(Configuration)\$(ProjectName)\</IntDir>
+    <LinkIncremental>true</LinkIncremental>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <CodeAnalysisRules />
+    <CodeAnalysisRuleAssemblies />
+  </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <OutDir>.\bin\$(Configuration)\</OutDir>
     <IntDir>.\intermediate\$(Configuration)\$(ProjectName)\</IntDir>
@@ -52,6 +82,14 @@
     <CodeAnalysisRules />
     <CodeAnalysisRuleAssemblies />
   </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <OutDir>.\bin\$(Configuration)\</OutDir>
+    <IntDir>.\intermediate\$(Configuration)\$(ProjectName)\</IntDir>
+    <LinkIncremental>false</LinkIncremental>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+    <CodeAnalysisRules />
+    <CodeAnalysisRuleAssemblies />
+  </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <Midl>
       <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -84,6 +122,38 @@
       <Command>"$(SolutionDir)..\..\utils\win32\ac2ver.exe" "faad2" "$(SolutionDir)..\..\configure.ac" &gt; "$(SolutionDir)..\..\libfaad\win32_ver.h"</Command>
     </PreBuildEvent>
   </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <Midl>
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MkTypLibCompatible>true</MkTypLibCompatible>
+      <SuppressStartupBanner>true</SuppressStartupBanner>
+      <TypeLibraryName>.\DebugDLL/libfaad2_dll.tlb</TypeLibraryName>
+    </Midl>
+    <ClCompile>
+      <Optimization>Disabled</Optimization>
+      <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;_USRDLL;HAVE_LRINTF;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <SuppressStartupBanner>true</SuppressStartupBanner>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+    </ClCompile>
+    <ResourceCompile>
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <Culture>0x0407</Culture>
+    </ResourceCompile>
+    <Link>
+      <ModuleDefinitionFile>.\libfaad2.def</ModuleDefinitionFile>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+    </Link>
+    <PreBuildEvent>
+      <Message>Retrieving package version...</Message>
+      <Command>"$(SolutionDir)..\..\utils\win32\ac2ver.exe" "faad2" "$(SolutionDir)..\..\configure.ac" &gt; "$(SolutionDir)..\..\libfaad\win32_ver.h"</Command>
+    </PreBuildEvent>
+  </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <Midl>
       <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -117,6 +187,39 @@
       <Command>"$(SolutionDir)..\..\utils\win32\ac2ver.exe" "faad2" "$(SolutionDir)..\..\configure.ac" &gt; "$(SolutionDir)..\..\libfaad\win32_ver.h"</Command>
     </PreBuildEvent>
   </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <Midl>
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MkTypLibCompatible>true</MkTypLibCompatible>
+      <SuppressStartupBanner>true</SuppressStartupBanner>
+      <TypeLibraryName>.\ReleaseDLL/libfaad2_dll.tlb</TypeLibraryName>
+    </Midl>
+    <ClCompile>
+      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+      <IntrinsicFunctions>true</IntrinsicFunctions>
+      <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;HAVE_LRINTF;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <StringPooling>true</StringPooling>
+      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+      <FunctionLevelLinking>true</FunctionLevelLinking>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level3</WarningLevel>
+      <SuppressStartupBanner>true</SuppressStartupBanner>
+      <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+    </ClCompile>
+    <ResourceCompile>
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <Culture>0x0407</Culture>
+    </ResourceCompile>
+    <Link>
+      <ModuleDefinitionFile>.\libfaad2.def</ModuleDefinitionFile>
+    </Link>
+    <PreBuildEvent>
+      <Message>Retrieving package version...</Message>
+      <Command>"$(SolutionDir)..\..\utils\win32\ac2ver.exe" "faad2" "$(SolutionDir)..\..\configure.ac" &gt; "$(SolutionDir)..\..\libfaad\win32_ver.h"</Command>
+    </PreBuildEvent>
+  </ItemDefinitionGroup>
   <ItemGroup>
     <ClCompile Include="..\..\libfaad\bits.c" />
     <ClCompile Include="..\..\libfaad\cfft.c" />
diff --git a/utils/win32/ac2ver.c b/utils/win32/ac2ver.c
index 171d6dd..d6a5456 100644
--- a/utils/win32/ac2ver.c
+++ b/utils/win32/ac2ver.c
@@ -1,7 +1,7 @@
 /*
 ** AC2VER - extract version number from AC_INIT macro (configure.ac)
 ** Copyright (C) 2017 LoRd_MuldeR <mulder2@GMX.de>
-**  
+**
 ** This software is released under the CC0 1.0 Universal [CC0 1.0] licence!
 ** https://creativecommons.org/publicdomain/zero/1.0/legalcode
 **/