From 969bc9cb89d22d9ed21a355c209a94f65eff67cf Mon Sep 17 00:00:00 2001 From: ulion Date: Thu, 17 Jan 2008 02:18:49 +0000 Subject: [PATCH] Fix code to prevent from accessing queue->packets[-1].pts that causes a crash. Found and patched by Reimar. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25774 b3059339-0415-0410-9bf9-f77b7e298cf2 --- vobsub.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vobsub.c b/vobsub.c index e46ee59cc6..c3230ff25b 100644 --- a/vobsub.c +++ b/vobsub.c @@ -1295,8 +1295,7 @@ vobsub_get_packet(void *vobhandle, float pts,void** data, int* timestamp) { ++queue->current_index; ++reseek_count; } - while (reseek_count--) { - --queue->current_index; + while (reseek_count-- && --queue->current_index) { if (queue->packets[queue->current_index-1].pts100 != UINT_MAX && queue->packets[queue->current_index-1].pts100 != lastpts) break;