]> git.sesse.net Git - vlc/blobdiff - modules/demux/subtitle.c
mkv.cpp: avoid dependency problems with older libmatroska
[vlc] / modules / demux / subtitle.c
index 2adec870e87e60faf052f5899c3e6f29531385c3..309b5128c092b6742797a9332012ebca6889b5fd 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * subtitle.c: Demux for subtitle text files.
  *****************************************************************************
- * Copyright (C) 1999-2004 VideoLAN
+ * Copyright (C) 1999-2004 the VideoLAN team
  * $Id$
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
@@ -318,6 +318,7 @@ static int Open ( vlc_object_t *p_this )
     if( p_sys->i_type == SUB_TYPE_UNKNOWN )
     {
         msg_Err( p_demux, "failed to recognize subtitle type" );
+        free( p_sys );
         return VLC_EGENERIC;
     }
 
@@ -347,6 +348,10 @@ static int Open ( vlc_object_t *p_this )
                                               sizeof(subtitle_t) * i_max ) ) )
             {
                 msg_Err( p_demux, "out of memory");
+                if( p_sys->subtitle != NULL )
+                    free( p_sys->subtitle );
+                TextUnload( &p_sys->txt );
+                free( p_sys );
                 return VLC_ENOMEM;
             }
         }