[libbluray-devel] nav_*_search(): make sure returned packet number is not outside of the clip

hpi1 git at videolan.org
Wed Jul 2 14:38:29 CEST 2014


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Wed Jul  2 14:40:59 2014 +0300| [beff5a17d18e402557b9b97829b1f6a8cba78eb3] | committer: hpi1

nav_*_search(): make sure returned packet number is not outside of the clip

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=beff5a17d18e402557b9b97829b1f6a8cba78eb3
---

 ChangeLog                        |    1 +
 src/libbluray/bdnav/navigation.c |    6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index c8a6d78..5828f9a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+- Fix bd_seek() jumping outside of clip/playlist.
 - Fix out of array bounds exception in some BD-J menus
 
 2013-05-27: Version 0.6.0
diff --git a/src/libbluray/bdnav/navigation.c b/src/libbluray/bdnav/navigation.c
index 22edd85..9612242 100644
--- a/src/libbluray/bdnav/navigation.c
+++ b/src/libbluray/bdnav/navigation.c
@@ -655,6 +655,9 @@ NAV_CLIP* nav_packet_search(NAV_TITLE *title, uint32_t pkt, uint32_t *clip_pkt,
         clip = &title->clip_list.clip[ii];
         if (clip->cl != NULL) {
             *clip_pkt = clpi_access_point(clip->cl, pkt - pos + clip->start_pkt, 0, 0, out_time);
+            if (*clip_pkt < clip->start_pkt) {
+                *clip_pkt = clip->start_pkt;
+            }
         } else {
             *clip_pkt = clip->start_pkt;
         }
@@ -730,6 +733,9 @@ NAV_CLIP* nav_time_search(NAV_TITLE *title, uint32_t tick, uint32_t *clip_pkt, u
         if (clip->cl != NULL) {
             *clip_pkt = clpi_lookup_spn(clip->cl, tick - pos + pi->in_time, 1,
                       title->pl->play_item[clip->ref].clip[clip->angle].stc_id);
+            if (*clip_pkt < clip->start_pkt) {
+                *clip_pkt = clip->start_pkt;
+            }
         } else {
             *clip_pkt = clip->start_pkt;
         }



More information about the libbluray-devel mailing list