diff options
author | albeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-03-16 14:24:22 +0000 |
---|---|---|
committer | albeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2006-03-16 14:24:22 +0000 |
commit | c748950c9fcc1f50adb7b73b07fff6bfb96e2f5a (patch) | |
tree | 28b057373a144db5e7b47135916183bb1d1b21fb /libmpdemux | |
parent | 01bb22bcc39bf25a0bb139ef552fd4a473a9dcd1 (diff) | |
download | mpv-c748950c9fcc1f50adb7b73b07fff6bfb96e2f5a.tar.bz2 mpv-c748950c9fcc1f50adb7b73b07fff6bfb96e2f5a.tar.xz |
Fix a potential seek failure, fill_buffer doesn't have to
fill the whole buffer.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17879 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/stream.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libmpdemux/stream.c b/libmpdemux/stream.c index 1175b2e048..869b3e1f62 100644 --- a/libmpdemux/stream.c +++ b/libmpdemux/stream.c @@ -324,11 +324,13 @@ if(newpos==0 || newpos!=s->pos){ // putchar('%');fflush(stdout); } - stream_fill_buffer(s); - if(pos>=0 && pos<=s->buf_len){ +while(stream_fill_buffer(s) > 0 && pos >= 0) { + if(pos<=s->buf_len){ s->buf_pos=pos; // byte position in sector return 1; } + pos -= s->buf_len; +} // if(pos==s->buf_len) printf("XXX Seek to last byte of file -> EOF\n"); |