mp_ring: make mp_ring_read_cb provide an exact amount of bytes

The previous code would pass down `len` instead of `read_len` which, in theory,
could be more than what was available in the buffer.
This commit is contained in:
Stefano Pigozzi 2013-07-13 10:25:39 +02:00
parent dc4dcf34e5
commit 9d9bcfa4f3
1 changed files with 1 additions and 1 deletions

View File

@ -99,7 +99,7 @@ int mp_ring_read_cb(struct mp_ring *buffer, void *ctx, int len,
int read_len = FFMIN(len, buffered);
int read_ptr = mp_ring_get_rpos(buffer) % size;
func(ctx, buffer->buffer + read_ptr, len);
func(ctx, buffer->buffer + read_ptr, read_len);
return mp_ring_drain(buffer, read_len);
}