diff options
author | Oliver Freyermuth <o.freyermuth@googlemail.com> | 2015-01-13 00:54:03 +0100 |
---|---|---|
committer | Diogo Franco (Kovensky) <diogomfranco@gmail.com> | 2015-01-25 17:00:09 +0900 |
commit | 4bb2da8204f6a05801bc0a67ca87d7549f856ca5 (patch) | |
tree | 3eaa3beca966759e2ce863b870ae9f63d24a73b5 | |
parent | 6d7eb8346ac19f7106ba7416d137ca45d57bb7e7 (diff) | |
download | mpv-4bb2da8204f6a05801bc0a67ca87d7549f856ca5.tar.bz2 mpv-4bb2da8204f6a05801bc0a67ca87d7549f856ca5.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.
-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 12c66a32bb..ea51fd2421 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 |