mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-08-24 02:34:23 -05:00
UI: Set remux entry state before adding to queue
When adding to the queue, this triggers rowCountChanged which then calls canClearFinished, reading undefined memory for state if this is not set. The correct state is set immediately after by checkInputPath. Detected by UBSan.
This commit is contained in:
committed by
Ryan Foster
parent
7178124da9
commit
1f278bb18b
@@ -367,6 +367,7 @@ bool RemuxQueueModel::setData(const QModelIndex &index, const QVariant &value,
|
||||
for (QString path : pathList) {
|
||||
RemuxQueueEntry entry;
|
||||
entry.sourcePath = path;
|
||||
entry.state = RemuxEntryState::Empty;
|
||||
|
||||
queue.insert(row, entry);
|
||||
row++;
|
||||
@@ -386,6 +387,7 @@ bool RemuxQueueModel::setData(const QModelIndex &index, const QVariant &value,
|
||||
if (!path.isEmpty()) {
|
||||
RemuxQueueEntry entry;
|
||||
entry.sourcePath = path;
|
||||
entry.state = RemuxEntryState::Empty;
|
||||
|
||||
beginInsertRows(QModelIndex(), queue.length() + 1,
|
||||
queue.length() + 1);
|
||||
|
||||
Reference in New Issue
Block a user