From 8007d1233131315b17d534e73fe9f11f32fb2a1a Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 9 May 2012 17:31:14 +0400 Subject: [PATCH] zapit/src/bouquets.cpp: fix invalid iterator advance in moveService/Bouquet --- src/zapit/src/bouquets.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/zapit/src/bouquets.cpp b/src/zapit/src/bouquets.cpp index 3da8edcbf..3cf214bb3 100644 --- a/src/zapit/src/bouquets.cpp +++ b/src/zapit/src/bouquets.cpp @@ -152,7 +152,8 @@ void CZapitBouquet::moveService(const unsigned int oldPosition, const unsigned i CZapitChannel* tmp = *it; channels->erase(it); - advance(it, newPosition - oldPosition); + it = channels->begin(); + advance(it, newPosition); channels->insert(it, tmp); } } @@ -604,7 +605,8 @@ void CBouquetManager::moveBouquet(const unsigned int oldId, const unsigned int n CZapitBouquet* tmp = *it; Bouquets.erase(it); - advance(it, newId - oldId); + it = Bouquets.begin(); + advance(it, newId); Bouquets.insert(it, tmp); } }