Skip to content

Commit

Permalink
Video: prevent unlikely crash during recording
Browse files Browse the repository at this point in the history
This can happen when user enables a telemetry fact and then that fact is
removed from codebase sometime later. SubtitleWriter will load NULL fact
from user configuration and then try to dereference.

Stumbled upon this while playing around with custom build. Don't think
this is an open issue yet in the normal build, hence "unlikely".
  • Loading branch information
or-rhssk authored and HTRamsey committed Dec 17, 2024
1 parent 75b01dd commit 112b708
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/VideoManager/SubtitleWriter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ void SubtitleWriter::startCapturingTelemetry(const QString& videoFile)
QmlObjectListModel* list = grid->columns()->value<QmlObjectListModel*>(colIndex);
for (int rowIndex = 0; rowIndex < list->count(); rowIndex++) {
InstrumentValueData* value = list->value<InstrumentValueData*>(rowIndex);
_facts += value->fact();
if (value->fact()) {
_facts += value->fact();
}
}
}
grid->deleteLater();
Expand Down

0 comments on commit 112b708

Please sign in to comment.