Commit 4a55d147 authored by Thomas Guillem's avatar Thomas Guillem

cache: fix seek when skipping data

AStreamReadNoSeekStream can return a value less than the length argument
without failing.
parent 9fce6fdc
...@@ -401,7 +401,8 @@ static int AStreamSeekStream(stream_t *s, uint64_t i_pos) ...@@ -401,7 +401,8 @@ static int AStreamSeekStream(stream_t *s, uint64_t i_pos)
while (i_skip > 0) while (i_skip > 0)
{ {
const int i_read_max = __MIN(10 * STREAM_READ_ATONCE, i_skip); const int i_read_max = __MIN(10 * STREAM_READ_ATONCE, i_skip);
if (AStreamReadNoSeekStream(s, NULL, i_read_max) != i_read_max) int i_read = 0;
if ((i_read = AStreamReadNoSeekStream(s, NULL, i_read_max)) <= 0)
return VLC_EGENERIC; return VLC_EGENERIC;
i_skip -= i_read_max; i_skip -= i_read_max;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment