[libdvdnav-devel] Subject:[PATCH] Fix dvdnav_cell_find for cell boundaries
Pierre Rzekiecki
crystalp at kodi.tv
Sat Jul 18 16:09:25 UTC 2026
Hello,
This patch fixes a comparison error found in libdvdnav 6.1.1 and still
present in current master.
Exposed in Kodi https://github.com/xbmc/xbmc/issues/27864
Kodi calls dvdnav_jump_to_sector_by_time() with the timestamp of the
chapter and dvd state gets corrupted with the wrong cell, resulting in
the incorrect behavior.
In dvdnav_find_cell, when find_val equals exactly a cell boundary,
`find_val <= cell_data->end->time` matches the cell N-1 instead of the
cell N that starts with find_val.
With the condition modified from <= to <, the cell starting with
find_val is matched and returned.
Regards,
Pierre
-------------- next part --------------
From e2ecd478a2009a8fe9b6777dc70f968586744642 Mon Sep 17 00:00:00 2001
From: CrystalP <crystalp at kodi.tv>
Date: Tue, 14 Jul 2026 08:53:30 -0400
Subject: [PATCH] Fixed dvdnav_cell_find for cell boundary
---
src/searching.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/searching.c b/src/searching.c
index 52022b3..4fb38bc 100644
--- a/src/searching.c
+++ b/src/searching.c
@@ -1044,7 +1044,7 @@ static int32_t dvdnav_cell_find(dvdnav_t *this, dvd_state_t *state,
/* 90 pts to ms */
cell_data->end->time += (dvdnav_convert_time(&cell->playback_time) / 90);
if ( find_val >= cell_data->bgn->time
- && find_val <= cell_data->end->time) {
+ && find_val < cell_data->end->time) {
found = 1;
break;
}
--
2.52.0.windows.1
More information about the libdvdnav-devel
mailing list