buffer: avoid a potential NULL dereference

parent fe20271e
Pipeline #187090 passed with stages
in 9 minutes and 9 seconds
......@@ -1081,7 +1081,7 @@ gegl_buffer_create_sub_buffer (GeglBuffer *buffer,
if (extent == NULL)
extent = gegl_buffer_get_extent (buffer);
if (extent->width < 0 || extent->height < 0)
if (!extent || extent->width < 0 || extent->height < 0)
{
g_warning ("avoiding creating buffer of size: %ix%i returning an empty buffer instead.\n", extent->width, extent->height);
return g_object_new (GEGL_TYPE_BUFFER,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment