changeset 7002:518faaa2aee4

corrects an off-by-one error when trying to seek beyond the end of file. patch by Jindrich Makovicka <makovick@kmlinux.fjfi.cvut.cz>
author arpi
date Wed, 14 Aug 2002 21:25:01 +0000
parents 797e7ba735ac
children 60a473935d7d
files libmpdemux/demux_avi.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_avi.c	Wed Aug 14 20:33:26 2002 +0000
+++ b/libmpdemux/demux_avi.c	Wed Aug 14 21:25:01 2002 +0000
@@ -594,7 +594,7 @@
       // find nearest video keyframe chunk pos:
       if(rel_seek_frames>0){
         // seek forward
-        while(video_chunk_pos<priv->idx_size){
+        while(video_chunk_pos<priv->idx_size-1){
           int id=((AVIINDEXENTRY *)priv->idx)[video_chunk_pos].ckid;
           if(avi_stream_id(id)==d_video->id){  // video frame
             if((--rel_seek_frames)<0 && ((AVIINDEXENTRY *)priv->idx)[video_chunk_pos].dwFlags&AVIIF_KEYFRAME) break;