[vlc-commits] bluray: blurayInitTitles: fix memleaks on error paths
Rafaël Carré
git at videolan.org
Fri Aug 16 13:26:09 CEST 2013
vlc | branch: master | Rafaël Carré <funman at videolan.org> | Mon Aug 12 09:39:12 2013 +0200| [bc7bf46f46c61c2be0664035ec4ac722d26f0034] | committer: Rafaël Carré
bluray: blurayInitTitles: fix memleaks on error paths
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bc7bf46f46c61c2be0664035ec4ac722d26f0034
---
modules/access/bluray.c | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/modules/access/bluray.c b/modules/access/bluray.c
index f0b147e..f5978c4 100644
--- a/modules/access/bluray.c
+++ b/modules/access/bluray.c
@@ -1026,23 +1026,30 @@ static void blurayInitTitles(demux_t *p_demux )
break;
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;
- 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++) {
seekpoint_t *s = vlc_seekpoint_New();
- if (!s)
+ if (!s) {
+ bd_free_title_info(title_info);
+ vlc_input_title_Delete(t);
break;
+ }
s->i_time_offset = title_info->chapters[j].offset;
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 );
bd_free_title_info(title_info);
}
More information about the vlc-commits
mailing list