mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-12 16:10:54 +00:00
libsysprof-gtk: skip out of bounds data
This commit is contained in:
@ -91,14 +91,18 @@ sysprof_column_layer_snapshot (GtkWidget *widget,
|
|||||||
|
|
||||||
for (guint i = 0; i < n_values; i++)
|
for (guint i = 0; i < n_values; i++)
|
||||||
{
|
{
|
||||||
int line_height = ceilf (y_values[i] * height);
|
if (x_values[i] < .0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (x_values[i] > 1.)
|
||||||
|
break;
|
||||||
|
|
||||||
gtk_snapshot_append_color (snapshot,
|
gtk_snapshot_append_color (snapshot,
|
||||||
color,
|
color,
|
||||||
&GRAPHENE_RECT_INIT (x_values[i] * width,
|
&GRAPHENE_RECT_INIT (x_values[i] * width,
|
||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
line_height));
|
ceilf (y_values[i] * height)));
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_snapshot_restore (snapshot);
|
gtk_snapshot_restore (snapshot);
|
||||||
|
|||||||
Reference in New Issue
Block a user