mirror of
https://github.com/brl/mutter.git
synced 2024-11-12 17:27:03 -05:00
buffer: warn if (offset + size) > buffer->size
previously we would silently bail out if the given offset + data size would overflow the buffer size. Now we use g_return_val_if_fail so we get a warning if we hit this case.
This commit is contained in:
parent
aafcee31b2
commit
525504f9bf
@ -458,11 +458,8 @@ cogl_buffer_set_data (CoglBuffer *buffer,
|
||||
const guint8 *data,
|
||||
gsize size)
|
||||
{
|
||||
if (!cogl_is_buffer (buffer))
|
||||
return FALSE;
|
||||
|
||||
if (G_UNLIKELY((offset + size) > buffer->size))
|
||||
return FALSE;
|
||||
g_return_val_if_fail (cogl_is_buffer (buffer), FALSE);
|
||||
g_return_val_if_fail ((offset + size) <= buffer->size, FALSE);
|
||||
|
||||
return buffer->vtable.set_data (buffer, offset, data, size);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user