Merge branch 'wip/chergert/fix-3770' into 'master'

ngl: ensure vertices buffer allocates enough vertices

Closes #3770

See merge request GNOME/gtk!3314
This commit is contained in:
Matthias Clasen 2021-03-18 17:55:26 +00:00
commit 140b7f0a61

View File

@ -32,7 +32,7 @@ typedef struct _GskNglBuffer
gsize buffer_len;
guint count;
GLenum target;
guint element_size;
gsize element_size;
} GskNglBuffer;
void gsk_ngl_buffer_init (GskNglBuffer *self,
@ -50,6 +50,7 @@ gsk_ngl_buffer_advance (GskNglBuffer *buffer,
if G_UNLIKELY (buffer->buffer_pos + to_alloc > buffer->buffer_len)
{
while (buffer->buffer_pos + to_alloc > buffer->buffer_len)
buffer->buffer_len *= 2;
buffer->buffer = g_realloc (buffer->buffer, buffer->buffer_len);
}