mirror of
https://github.com/brl/mutter.git
synced 2024-11-24 17:10:40 -05:00
cogl: Don't allow creating sized textures with 0 pixels
A texture with no pixels isn't a useful thing to have, and breaks
assumptions elsewhere. For example, CoglFramebuffer assumes that after
a texture has been allocated, it will have width and height both greater
than 0.
In particular, this works around a crash when gnome-shell tries to blur a
background that hasn't yet had any space allocated for it - which it seems
is really an actor layout bug, but more robustness seems good to have.
Workaround for <https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2538>.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1172
Signed-off-by: Simon McVittie <smcv@debian.org>
(cherry picked from commit 37eda498f2
)
This commit is contained in:
parent
6f094bd399
commit
e3b2b90c72
@ -121,6 +121,9 @@ cogl_texture_2d_new_with_size (CoglContext *ctx,
|
||||
{
|
||||
CoglTextureLoader *loader;
|
||||
|
||||
g_return_val_if_fail (width >= 1, NULL);
|
||||
g_return_val_if_fail (height >= 1, NULL);
|
||||
|
||||
loader = _cogl_texture_create_loader ();
|
||||
loader->src_type = COGL_TEXTURE_SOURCE_TYPE_SIZED;
|
||||
loader->src.sized.width = width;
|
||||
|
Loading…
Reference in New Issue
Block a user