mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-24 12:41:16 +00:00
testsuite: Fix an asan error
asan complains that some of the memorytexture tests read past limits. Avoid that.
This commit is contained in:
parent
e376d638fb
commit
8e73d007f5
@ -41,6 +41,7 @@ RUN dnf -y install \
|
||||
itstool \
|
||||
json-glib-devel \
|
||||
lcov \
|
||||
libasan \
|
||||
libattr-devel \
|
||||
libepoxy-devel \
|
||||
libffi-devel \
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user