1
mirror of https://code.videolan.org/videolan/vlc synced 2024-10-03 01:31:53 +02:00

qt: fix out of bound in MLListcache during remove operations

the removed data are after the m_partialIndex in the old model so the partial
index should not be placed after.

fix: #26848
This commit is contained in:
Pierre Lamot 2022-04-21 17:16:49 +02:00 committed by Jean-Baptiste Kempf
parent 0cf698e118
commit 3ee0fd64f0

View File

@ -354,11 +354,10 @@ void MLListCache::partialUpdate()
break;
case VLC_DIFFUTIL_OP_REMOVE:
m_partialX = op.op.remove.x;
m_partialIndex = op.op.remove.index + op.count - 1;
m_partialIndex = op.op.remove.index;
emit beginRemoveRows(op.op.remove.index, op.op.remove.index + op.count - 1);
m_partialLoadedCount -= op.count;
m_partialX += op.count;
m_partialIndex = op.op.remove.index + 1;
partialTotalCount -= op.count;
emit endRemoveRows();
emit localSizeChanged(partialTotalCount);