Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion tf2/src/buffer_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,13 @@ CompactFrameID BufferCore::validateFrameId(
return 0;
}

// Only check that a frame is non-existent once a frame was found
static bool init_state = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A static variable here is not correct. It will not correctly interact with potentially multiple BufferCore instances and doesn't deal with resetting the core.

CompactFrameID id = lookupFrameNumber(frame_id);
if (id == 0) {
if (id != 0) {
init_state = false;
}
if (!init_state && id == 0) {
fillOrWarnMessageForInvalidFrame(
function_name_arg, frame_id, error_msg, "frame does not exist");
}
Expand Down