1
0
Fork 0

Avoid calloc(0)

This commit is contained in:
hpi1 2018-01-20 14:08:47 +02:00
parent 8c15fdad77
commit 672463e317
1 changed files with 6 additions and 2 deletions

View File

@ -719,9 +719,13 @@ NAV_TITLE* nav_title_open(BD_DISC *disc, const char *playlist, unsigned angle)
}
title->chap_list.count = _pl_chapter_count(title->pl);
title->chap_list.mark = calloc(title->chap_list.count, sizeof(NAV_MARK));
if (title->chap_list.count) {
title->chap_list.mark = calloc(title->chap_list.count, sizeof(NAV_MARK));
}
title->mark_list.count = title->pl->mark_count;
title->mark_list.mark = calloc(title->pl->mark_count, sizeof(NAV_MARK));
if (title->mark_list.count) {
title->mark_list.mark = calloc(title->pl->mark_count, sizeof(NAV_MARK));
}
_extrapolate_title(title);