summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorulion <ulion@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-01-17 02:18:49 +0000
committerulion <ulion@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-01-17 02:18:49 +0000
commit969bc9cb89d22d9ed21a355c209a94f65eff67cf (patch)
tree395122120059f3e15d25f8f4fd43f0bbad8f042c
parentda446337145dd0f72d339eaee042aef15b31480e (diff)
downloadmpv-969bc9cb89d22d9ed21a355c209a94f65eff67cf.tar.bz2
mpv-969bc9cb89d22d9ed21a355c209a94f65eff67cf.tar.xz
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
-rw-r--r--vobsub.c3
1 files changed, 1 insertions, 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;