[gegl] buffer: in gegl_buffer_set(), allow NULL src buffer if rect is empty
- From: Ell <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] buffer: in gegl_buffer_set(), allow NULL src buffer if rect is empty
- Date: Tue, 22 Oct 2019 11:43:44 +0000 (UTC)
commit 876885898ddf2d29ac9f1bdad13459d28f6f0ef4
Author: Ell <ell_se yahoo com>
Date: Tue Oct 22 14:41:09 2019 +0300
buffer: in gegl_buffer_set(), allow NULL src buffer if rect is empty
In gegl_buffer_set(), don't raise a CRITICAL when src is NULL, if
the provided rect is empty.
gegl/buffer/gegl-buffer-access.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gegl/buffer/gegl-buffer-access.c b/gegl/buffer/gegl-buffer-access.c
index 13e0b38b2..1dc9160a9 100644
--- a/gegl/buffer/gegl-buffer-access.c
+++ b/gegl/buffer/gegl-buffer-access.c
@@ -1949,11 +1949,16 @@ gegl_buffer_set (GeglBuffer *buffer,
gint rowstride)
{
g_return_if_fail (GEGL_IS_BUFFER (buffer));
- g_return_if_fail (src);
+
+ if (gegl_rectangle_is_empty (rect ? rect : &buffer->extent))
+ return;
+
+ g_return_if_fail (src != NULL);
+
if (format == NULL)
format = buffer->soft_format;
- if (rect && (rect->width == 1))
+ if (rect && rect->width == 1)
{
if (rect->height == 1)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]