mirror of
https://github.com/brl/mutter.git
synced 2024-11-23 00:20:42 -05:00
vertex-buffer: don't unref NULL object
In cogl_vertex_buffer_indices_get_for_quads() we sometimes have to extend the length of an existing array, but when we came to unref the previous array we didn't first check that it wasn't simply NULL.
This commit is contained in:
parent
982f1b4bd0
commit
20a1f87628
@ -1725,7 +1725,8 @@ cogl_vertex_buffer_indices_get_for_quads (unsigned int n_indices)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (ctx->quad_buffer_indices_len < n_indices)
|
if (ctx->quad_buffer_indices &&
|
||||||
|
ctx->quad_buffer_indices_len < n_indices)
|
||||||
{
|
{
|
||||||
cogl_handle_unref (ctx->quad_buffer_indices);
|
cogl_handle_unref (ctx->quad_buffer_indices);
|
||||||
ctx->quad_buffer_indices = COGL_INVALID_HANDLE;
|
ctx->quad_buffer_indices = COGL_INVALID_HANDLE;
|
||||||
|
Loading…
Reference in New Issue
Block a user