libobs/util: Fix bug with circlebuf_data
If the index specified is equal to the size of the data, return NULL.
This commit is contained in:
@@ -311,7 +311,7 @@ static inline void *circlebuf_data(struct circlebuf *cb, size_t idx)
|
||||
uint8_t *ptr = (uint8_t*)cb->data;
|
||||
size_t offset = cb->start_pos + idx;
|
||||
|
||||
if (idx > cb->size)
|
||||
if (idx >= cb->size)
|
||||
return NULL;
|
||||
|
||||
if (offset >= cb->capacity)
|
||||
|
Reference in New Issue
Block a user