Commit e843f457 authored by Michael Pyne's avatar Michael Pyne

playlist: Fix crasher with playlists using reserved columns.

I introduced this bug in commit a800c1b3 trying to fix a different
memory mis-using bug. Sigh.

In this case playlists that reserve additional columns would get a valid
memory assignment but would be copied into the memory block incorrectly.
This needed a back_inserter as well.

Thanks to Markus for pointing out the regression, then opening a bug,
then leaving a comment to point out both of these, and then drafting a
patch that fixes the bug.

I can confirm it works in my testing, it also seems to address a bug
relating to playback stopping abrupting at the end of a track instead of
skipping to the next track, but who knows at this point.

BUG:420718
FIXED-IN:20.04.1
parent a97dc4e8
......@@ -1226,7 +1226,7 @@ void Playlist::slotInitialize(int numColumnsToReserve)
QStringList allColHeaders;
allColHeaders.reserve(numColumnsToReserve + standardColHeaders.size());
std::fill_n(allColHeaders.begin(), numColumnsToReserve, i18n("JuK"));
std::fill_n(std::back_inserter(allColHeaders), numColumnsToReserve, i18n("JuK"));
std::copy (standardColHeaders.cbegin(), standardColHeaders.cend(),
std::back_inserter(allColHeaders));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment