diff options
author | Oliver Freyermuth <o.freyermuth@googlemail.com> | 2015-01-13 00:54:03 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-01-13 02:39:16 +0100 |
commit | 794804725d76b489ed28cbcdb33d12d8bafa23c5 (patch) | |
tree | 85894d54c99f770107e26786b6cf82c36d9f02e3 /stream | |
parent | 3d1b9ba4bd20fcbcc7611ee713f5e2dd3ebc930b (diff) | |
download | mpv-794804725d76b489ed28cbcdb33d12d8bafa23c5.tar.bz2 mpv-794804725d76b489ed28cbcdb33d12d8bafa23c5.tar.xz |
cache: cache-position needs to be int64_t
Both max_filepos and offset are int64_t,
so pos can overflow, e.g. causing endless loops
in stream implementation.
Diffstat (limited to 'stream')
-rw-r--r-- | stream/cache.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/stream/cache.c b/stream/cache.c index f076ff47fb..356a49afc7 100644 --- a/stream/cache.c +++ b/stream/cache.c @@ -241,7 +241,7 @@ static bool cache_fill(struct priv *s) int64_t space = s->buffer_size - (newb + back); // offset into the buffer that maps to max_filepos - int pos = s->max_filepos - s->offset; + int64_t pos = s->max_filepos - s->offset; if (pos >= s->buffer_size) pos -= s->buffer_size; // wrap-around |