summaryrefslogtreecommitdiffstats
path: root/vobsub.c
diff options
context:
space:
mode:
Diffstat (limited to 'vobsub.c')
-rw-r--r--vobsub.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/vobsub.c b/vobsub.c
index 13b8efc5e5..45eee2789b 100644
--- a/vobsub.c
+++ b/vobsub.c
@@ -1280,7 +1280,8 @@ void vobsub_seek(void * vobhandle, float pts)
return;
queue = vob->spu_streams + vobsub_id;
queue->current_index = 0;
- while ((queue->packets + queue->current_index)->pts100 < seek_pts100)
+ while (queue->current_index < queue->packets_size
+ && (queue->packets + queue->current_index)->pts100 < seek_pts100)
++queue->current_index;
if (queue->current_index > 0)
--queue->current_index;