summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2023-02-13 01:08:53 +0100
committerMatthias Clasen <mclasen@redhat.com>2023-03-03 11:24:46 -0600
commit98eac8ac830d6c98d3cb187831555b007aaa932b (patch)
tree4589c3f7f246f96c4c7f599abcc0310237ded8f1 /gdk
parent4b46097748caed8c34572ed5305cedb8a385e367 (diff)
downloadgtk+-98eac8ac830d6c98d3cb187831555b007aaa932b.tar.gz
Fixes for gdk_memory_texture_new_subtexture checks
There were several mistakes here.
Diffstat (limited to 'gdk')
-rw-r--r--gdk/gdkmemorytexture.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdk/gdkmemorytexture.c b/gdk/gdkmemorytexture.c
index 641386b786..85d9ba0a25 100644
--- a/gdk/gdkmemorytexture.c
+++ b/gdk/gdkmemorytexture.c
@@ -178,10 +178,10 @@ gdk_memory_texture_new_subtexture (GdkMemoryTexture *source,
GBytes *bytes;
g_return_val_if_fail (GDK_IS_MEMORY_TEXTURE (source), NULL);
- g_return_val_if_fail (x >= 0 || x < GDK_TEXTURE (source)->width, NULL);
- g_return_val_if_fail (y >= 0 || y < GDK_TEXTURE (source)->height, NULL);
- g_return_val_if_fail (width > 0 || x + width <= GDK_TEXTURE (source)->width, NULL);
- g_return_val_if_fail (height > 0 || y + height <= GDK_TEXTURE (source)->height, NULL);
+ g_return_val_if_fail (x >= 0 && x < GDK_TEXTURE (source)->width, NULL);
+ g_return_val_if_fail (y >= 0 && y < GDK_TEXTURE (source)->height, NULL);
+ g_return_val_if_fail (width > 0 && x + width <= GDK_TEXTURE (source)->width, NULL);
+ g_return_val_if_fail (height > 0 && y + height <= GDK_TEXTURE (source)->height, NULL);
texture = GDK_TEXTURE (source);
bpp = gdk_memory_format_bytes_per_pixel (texture->format);