libsysprof-ui: check for valid frame type before incrementing

This commit is contained in:
Christian Hergert
2020-02-13 14:31:22 -08:00
parent a8c6038679
commit aca1a6a765

View File

@ -725,7 +725,8 @@ sysprof_display_scan_worker (GTask *task,
while (sysprof_capture_reader_peek_frame (reader, &frame))
{
st.frame_count[frame.type]++;
if (frame.type < G_N_ELEMENTS (st.frame_count))
st.frame_count[frame.type]++;
if (frame.type == SYSPROF_CAPTURE_FRAME_METADATA)
{