mirror of https://code.videolan.org/videolan/vlc
libvlc: fix title count conditional for chapter descriptions
Chapter descriptions were not being returned for valid title indices. The conditional check would return true (and therefore abort the method) when the requested title index was less than the title count, i.e. when it was valid. Signed-off-by: Thomas Guillem <thomas@gllm.fr>
This commit is contained in:
parent
e5416ddad2
commit
756618d02e
|
@ -1364,7 +1364,7 @@ int libvlc_media_player_get_chapter_count_for_title(
|
|||
goto end;
|
||||
|
||||
size_t titles_count = vlc_player_title_list_GetCount(titles);
|
||||
if (idx < titles_count)
|
||||
if (idx >= titles_count)
|
||||
goto end;
|
||||
|
||||
const struct vlc_player_title *title =
|
||||
|
@ -1489,7 +1489,7 @@ int libvlc_media_player_get_full_chapter_descriptions( libvlc_media_player_t *p_
|
|||
goto end;
|
||||
|
||||
size_t titles_count = vlc_player_title_list_GetCount(titles);
|
||||
if (i_chapters_of_title < (int) titles_count)
|
||||
if (i_chapters_of_title >= (int) titles_count)
|
||||
goto end;
|
||||
|
||||
const struct vlc_player_title *title =
|
||||
|
|
Loading…
Reference in New Issue