]> git.sesse.net Git - vlc/commitdiff
* MPEG audio emphasis fix, courtesy of Matthieu Lochegnies
authorChristophe Massiot <massiot@videolan.org>
Wed, 5 Sep 2001 16:46:10 +0000 (16:46 +0000)
committerChristophe Massiot <massiot@videolan.org>
Wed, 5 Sep 2001 16:46:10 +0000 (16:46 +0000)
<lochegm1@cti.ecp.fr> ;
* ac3dec uninitialized data structure fix, courtesy of Damian Ivereigh
<damian@cisco.com>.

src/ac3_decoder/ac3_decoder_thread.c
src/audio_decoder/adec_generic.c

index 1bbf064656715253bef4d80e698dd1d4be42c4b9..e8db6e9a126c2cd9be10dd76dc67e40076d5acf5 100644 (file)
@@ -2,7 +2,7 @@
  * ac3_decoder_thread.c: ac3 decoder thread
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: ac3_decoder_thread.c,v 1.36 2001/08/05 15:32:46 gbazin Exp $
+ * $Id: ac3_decoder_thread.c,v 1.37 2001/09/05 16:46:10 massiot Exp $
  *
  * Authors: Michel Lespinasse <walken@zoy.org>
  *
@@ -84,6 +84,7 @@ vlc_thread_t ac3dec_CreateThread( adec_config_t * p_config )
 
     /* Allocate the memory needed to store the thread's structure */
     p_ac3thread_temp = (ac3dec_thread_t *)malloc(sizeof(ac3dec_thread_t) + 15);
+    memset( p_ac3thread_temp, 0, sizeof(ac3dec_thread_t) + 15 );
 
     /* We need to be 16 bytes aligned */
     p_ac3thread = (ac3dec_thread_t *)(((unsigned long)p_ac3thread_temp + 15)
index 692eb3038fc05968b1e42ed0988ce368392bef3e..8aa6a00e2c7c248b6fa5f61cb807a4be1951e54a 100644 (file)
@@ -2,7 +2,7 @@
  * adec_generic.c: MPEG audio decoder
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: adec_generic.c,v 1.5 2001/04/06 09:15:47 sam Exp $
+ * $Id: adec_generic.c,v 1.6 2001/09/05 16:46:10 massiot Exp $
  *
  * Authors: Michel Kaempf <maxx@via.ecp.fr>
  *          Michel Lespinasse <walken@via.ecp.fr>
@@ -86,8 +86,8 @@ int adec_SyncFrame( adec_thread_t * p_adec, adec_sync_info_t * p_sync_info )
 
     p_adec->header = header;
 
-    /* basic header check : sync word, no emphasis */
-    if( (header & 0xfff00003) != 0xfff00000 )
+    /* basic header check : sync word */
+    if( (header & 0xfff00000) != 0xfff00000 )
     {
         return 1;
     }
@@ -95,7 +95,7 @@ int adec_SyncFrame( adec_thread_t * p_adec, adec_sync_info_t * p_sync_info )
     /* calculate bit rate */
     index = ( header >> 17 ) & 7; /* mpeg ID + layer */
     bit_rates = bit_rate_table[ index ];
-    if( bit_rate_table == NULL )
+    if( bit_rates == NULL )
     {
         return 1; /* invalid layer */
     }