summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-07-08 15:04:12 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-07-08 15:09:08 -0400
commit8e73d007f574181f85b5642b0f0d8773968d4ec6 (patch)
treec70fa982f8e0ce6731babc2b38e1db4752736207 /testsuite
parente376d638fb51e09c57f6358ee82f410a5ebdefb2 (diff)
downloadgtk+-8e73d007f574181f85b5642b0f0d8773968d4ec6.tar.gz
testsuite: Fix an asan error
asan complains that some of the memorytexture tests read past limits. Avoid that.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/gdk/memorytexture.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/testsuite/gdk/memorytexture.c b/testsuite/gdk/memorytexture.c
index b43281e6b2..3f941cdb29 100644
--- a/testsuite/gdk/memorytexture.c
+++ b/testsuite/gdk/memorytexture.c
@@ -93,7 +93,7 @@ create_texture (GdkMemoryFormat format,
guchar *data;
int x, y;
- data = g_malloc (height * stride);
+ data = g_malloc (height * MAX (stride, tests[format].bytes_per_pixel));
for (y = 0; y < height; y++)
for (x = 0; x < width; x++)
{
@@ -102,7 +102,7 @@ create_texture (GdkMemoryFormat format,
tests[format].bytes_per_pixel);
}
- bytes = g_bytes_new_static (data, height * stride);
+ bytes = g_bytes_new_static (data, height * MAX (stride, tests[format].bytes_per_pixel));
texture = gdk_memory_texture_new (width, height,
format,
bytes,