File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ struct demux_sys_t
65
65
{
66
66
subtitle_t * p_array ;
67
67
size_t i_count ;
68
+ size_t i_alloc ;
68
69
size_t i_current ;
69
70
} subs ;
70
71
@@ -585,7 +586,6 @@ static int ReadTTML( demux_t* p_demux )
585
586
node_t * p_node = NULL ;
586
587
char * psz_text = NULL ;
587
588
const char * psz_node_name ;
588
- int i_max_sub = 0 ;
589
589
int i_type ;
590
590
591
591
do
@@ -626,11 +626,11 @@ static int ReadTTML( demux_t* p_demux )
626
626
627
627
if ( p_node -> psz_begin && p_node -> psz_end )
628
628
{
629
- if ( p_sys -> subs .i_count >= i_max_sub )
629
+ if ( p_sys -> subs .i_count >= p_sys -> subs . i_alloc )
630
630
{
631
- i_max_sub += 500 ;
631
+ p_sys -> subs . i_alloc += 500 ;
632
632
subtitle_t * p_subtitles = realloc ( p_sys -> subs .p_array ,
633
- sizeof ( * p_sys -> subs .p_array ) * i_max_sub );
633
+ sizeof ( * p_sys -> subs .p_array ) * p_sys -> subs . i_alloc );
634
634
if ( unlikely ( p_subtitles == NULL ) )
635
635
goto error ;
636
636
p_sys -> subs .p_array = p_subtitles ;
You can’t perform that action at this time.
0 commit comments