Skip to content

Commit

Permalink
vogleditor: add nested operations check
Browse files Browse the repository at this point in the history
A check is added at the "glEnd" entrypoint to ensure it doesn't get
moved past the parent frame in the case of an unpaired glEnd(). This
can inadvertently occur in a program and will cause a crash. (Similar
defect in apitrace)

Signed-off-by: Lawrence L Love <lawrencex.l.love@intel.com>
  • Loading branch information
lawlove committed Apr 24, 2014
1 parent 5a00dc5 commit 7ea354d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/vogleditor/vogleditor_qapicalltreemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,15 +247,17 @@ void vogleditor_QApiCallTreeModel::setupModelData(vogl_trace_file_reader* pTrace
else if (entrypoint_id == VOGL_ENTRYPOINT_glEnd)
{
// move the parent back one level of the hierarchy, to its own parent
pCurParent = pCurParent->parent();
// (but not past Frame parent [e.g., unpaired "glEnd" operation])
if (pCurParent->parent() != parent)
pCurParent = pCurParent->parent();
}
}

if (pTrace_reader->get_packet_type() == cTSPTEOF)
{
//found_eof_packet = true;
vogl_printf("Found trace file EOF packet on swap %" PRIu64 "\n", total_swaps);
break;
//found_eof_packet = true;
vogl_printf("Found trace file EOF packet on swap %" PRIu64 "\n", total_swaps);
break;
}
}
}
Expand Down

0 comments on commit 7ea354d

Please sign in to comment.