mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-08 09:40:10 +00:00
gpu: Don't crash when there's no ops
In the rare situation (read: I triggered it with obscure hacks) where no ops are emitted, we could end up pointing into invalid memory and crashing. Don't do that.
This commit is contained in:
parent
9690c87736
commit
e35670a014
@ -74,6 +74,7 @@ gsk_gpu_frame_default_cleanup (GskGpuFrame *self)
|
||||
}
|
||||
gsk_gpu_ops_set_size (&priv->ops, 0);
|
||||
|
||||
priv->first_op = NULL;
|
||||
priv->last_op = NULL;
|
||||
}
|
||||
|
||||
@ -283,6 +284,9 @@ gsk_gpu_frame_seal_ops (GskGpuFrame *self)
|
||||
GskGpuOp *last, *op;
|
||||
gsize i;
|
||||
|
||||
if (gsk_gpu_ops_get_size (&priv->ops) == 0)
|
||||
return;
|
||||
|
||||
priv->first_op = (GskGpuOp *) gsk_gpu_ops_index (&priv->ops, 0);
|
||||
|
||||
last = priv->first_op;
|
||||
|
Loading…
Reference in New Issue
Block a user