mirror of
https://github.com/mpv-player/mpv.git
synced 2026-10-25 12:42:04 +08:00
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.
This commit is contained in:
committed by
Diogo Franco (Kovensky)
parent
6d7eb8346a
commit
4bb2da8204
+1
-1
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user