Commit bc7bf46f authored by Rafaël Carré's avatar Rafaël Carré

bluray: blurayInitTitles: fix memleaks on error paths

parent b323c876
...@@ -1026,23 +1026,30 @@ static void blurayInitTitles(demux_t *p_demux ) ...@@ -1026,23 +1026,30 @@ static void blurayInitTitles(demux_t *p_demux )
break; break;
BLURAY_TITLE_INFO *title_info = bd_get_title_info(p_sys->bluray, i, 0); BLURAY_TITLE_INFO *title_info = bd_get_title_info(p_sys->bluray, i, 0);
if (!title_info) if (!title_info) {
vlc_input_title_Delete(t);
break; break;
t->i_length = FROM_TICKS(title_info->duration);
if (t->i_length > duration) {
duration = t->i_length;
p_sys->i_longest_title = i;
} }
t->i_length = FROM_TICKS(title_info->duration);
for ( unsigned int j = 0; j < title_info->chapter_count; j++) { for ( unsigned int j = 0; j < title_info->chapter_count; j++) {
seekpoint_t *s = vlc_seekpoint_New(); seekpoint_t *s = vlc_seekpoint_New();
if (!s) if (!s) {
bd_free_title_info(title_info);
vlc_input_title_Delete(t);
break; break;
}
s->i_time_offset = title_info->chapters[j].offset; s->i_time_offset = title_info->chapters[j].offset;
TAB_APPEND( t->i_seekpoint, t->seekpoint, s ); TAB_APPEND( t->i_seekpoint, t->seekpoint, s );
} }
if (t->i_length > duration) {
duration = t->i_length;
p_sys->i_longest_title = i;
}
TAB_APPEND( p_sys->i_title, p_sys->pp_title, t ); TAB_APPEND( p_sys->i_title, p_sys->pp_title, t );
bd_free_title_info(title_info); bd_free_title_info(title_info);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment