Fix crash occuring when searching backward in an empty list
This commit is contained in:
1
NEWS
1
NEWS
@@ -2,6 +2,7 @@ ncmpcpp-0.7.5 (????-??-??)
|
||||
* Action chains can be now used for seeking.
|
||||
* Fixed fetching artist info from last.fm.
|
||||
* Default value of regular_expressions was changed from 'basic' to 'perl' to work around boost issue (#12222).
|
||||
* Fixed crash occuring when searching backward in an empty list.
|
||||
|
||||
ncmpcpp 0.7.4 (2016-04-17)
|
||||
* Fetching lyrics from lyricwiki.org was fixed.
|
||||
|
||||
@@ -35,6 +35,11 @@ template <typename Iterator, typename PredicateT>
|
||||
Iterator wrappedSearch(Iterator begin, Iterator current, Iterator end,
|
||||
const PredicateT &pred, bool wrap, bool skip_current)
|
||||
{
|
||||
if (begin == end)
|
||||
{
|
||||
assert(current == end);
|
||||
return begin;
|
||||
}
|
||||
if (skip_current)
|
||||
++current;
|
||||
auto it = std::find_if(current, end, pred);
|
||||
|
||||
Reference in New Issue
Block a user