]> git.sesse.net Git - vlc/blobdiff - modules/access/bd/bd.c
android_window: check subtitles bounds
[vlc] / modules / access / bd / bd.c
index fd98f2f3f643c07405f215824bcc096e089e95df..3c7c737c2f2300413626a593322178936f4aaabe 100644 (file)
@@ -52,7 +52,7 @@ static void Close( vlc_object_t * );
 
 vlc_module_begin ()
     set_shortname( N_("BD") )
-    set_description( N_("BluRay Disc Input") )
+    set_description( N_("Blu-ray Disc Input") )
     set_category( CAT_INPUT )
     set_subcategory( SUBCAT_INPUT_ACCESS )
     set_capability( "access_demux", 60 )
@@ -161,7 +161,10 @@ static int Open( vlc_object_t *p_this )
     /* Fill p_demux field */
     p_demux->p_sys = p_sys = malloc( sizeof(*p_sys) );
     if( !p_sys )
+    {
+        free( psz_base );
         return VLC_EGENERIC;
+    }
     p_sys->psz_base = psz_base;
     p_sys->b_shortname = b_shortname;
     TAB_INIT( p_sys->i_mpls, p_sys->pp_mpls );
@@ -318,7 +321,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
 
         /* Duplicate title infos */
         *pi_int = p_sys->i_title;
-        *ppp_title = calloc( p_sys->i_title, sizeof(input_title_t **) );
+        *ppp_title = calloc( p_sys->i_title, sizeof(input_title_t *) );
         for( int i = 0; i < p_sys->i_title; i++ )
             (*ppp_title)[i] = vlc_input_title_Duplicate( p_sys->pp_title[i] );
 
@@ -610,6 +613,7 @@ static int SetPlayItem( demux_t *p_demux, int i_mpls, int i_play_item )
         if( p_sys->pp_clpi[i_clpi]->i_id == p_mpls_clpi->i_id )
             p_clpi = p_sys->pp_clpi[i_clpi];
     }
+    assert(p_clpi);
 
     const bool b_same_clpi = b_same_mpls && p_sys->p_clpi->i_id == p_clpi->i_id;
     stream_t *p_m2ts = NULL;
@@ -1255,7 +1259,7 @@ static es_out_id_t *EsOutAdd( es_out_t *p_out, const es_format_t *p_fmt )
     es_format_t fmt;
 
     es_format_Copy( &fmt, p_fmt );
-    fmt.i_priority = -2;
+    fmt.i_priority = ES_PRIORITY_NOT_SELECTABLE;
 
     for( int i = 0; i < p_item->i_stream; i++ )
     {
@@ -1267,7 +1271,7 @@ static es_out_id_t *EsOutAdd( es_out_t *p_out, const es_format_t *p_fmt )
         /* TODO improved priority for higher quality stream ?
          * if so, extending stream attributes parsing might be a good idea
          */
-        fmt.i_priority = 0;
+        fmt.i_priority = ES_PRIORITY_SELECTABLE_MIN;
 
 #if 0
         /* Useless, and beside not sure it is the right thing to do */
@@ -1297,7 +1301,7 @@ static es_out_id_t *EsOutAdd( es_out_t *p_out, const es_format_t *p_fmt )
         }
         break;
     }
-    if( fmt.i_priority < 0 )
+    if( fmt.i_priority < ES_PRIORITY_SELECTABLE_MIN )
         msg_Dbg( p_demux, "Hiding one stream (pid=%d)", fmt.i_id );
 
     /* */