]> git.sesse.net Git - vlc/commitdiff
* Added a missing call to DecoderError() in mpeg_adec.c.
authorSam Hocevar <sam@videolan.org>
Mon, 31 Dec 2001 03:59:59 +0000 (03:59 +0000)
committerSam Hocevar <sam@videolan.org>
Mon, 31 Dec 2001 03:59:59 +0000 (03:59 +0000)
  * Fixed a segfault in the aRts plugin.

plugins/arts/aout_arts.c
plugins/mpeg_adec/mpeg_adec.c

index 7da9ea29f9cc54e319c11b08b77a9abc0a7e926d..76c22ead9cc3decabd528e29a2bf730e5be82e4c 100644 (file)
@@ -114,12 +114,20 @@ static int aout_Open( aout_thread_t *p_aout )
     p_aout->i_channels = 1 + main_GetIntVariable( AOUT_STEREO_VAR, AOUT_STEREO_DEFAULT );
     p_aout->l_rate = AOUT_RATE_DEFAULT;
 
+    /* Allocate structure */
+    p_aout->p_sys = malloc( sizeof( aout_sys_t ) );
+    if( p_aout->p_sys == NULL )
+    {
+        intf_ErrMsg("error: %s", strerror(ENOMEM) );
+        return( 1 );
+    }
 
     i_err = arts_init();
     
     if (i_err < 0)
     {
         fprintf(stderr, "arts_init error: %s\n", arts_error_text(i_err));
+        free( p_aout->p_sys );
         return(-1);
     }
 
@@ -175,5 +183,6 @@ static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
 static void aout_Close( aout_thread_t *p_aout )
 {
     arts_close_stream( p_aout->p_sys->stream );
+    free( p_aout->p_sys );
 }
 
index b2d96f761b9b9950d8a804b30c5928ed9ba77070..37d85fa669c2f73970e920f99aa580d1d1c829b5 100644 (file)
@@ -2,7 +2,7 @@
  * mpeg_adec.c: MPEG audio decoder thread
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: mpeg_adec.c,v 1.5.2.2 2001/12/31 01:21:45 massiot Exp $
+ * $Id: mpeg_adec.c,v 1.5.2.3 2001/12/31 03:59:59 sam Exp $
  *
  * Authors: Michel Kaempf <maxx@via.ecp.fr>
  *          Michel Lespinasse <walken@via.ecp.fr>
@@ -157,6 +157,7 @@ static int decoder_Run ( decoder_config_t * p_config )
     if ( p_adec->p_aout_fifo == NULL )
     {
         intf_ErrMsg("mpeg_adec error: cannot create audio output fifo");
+        DecoderError( p_config->p_decoder_fifo );
         return -1;
     }