Skip to content

Commit

Permalink
Fix bug where Taiga crashes on playing random anime
Browse files Browse the repository at this point in the history
  • Loading branch information
erengy committed Nov 21, 2014
1 parent 129dd66 commit 85236c5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/library/anime_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,12 @@ bool PlayRandomAnime() {
valid_ids.push_back(anime_item.GetId());
}

foreach_ (id, valid_ids) {
srand(static_cast<unsigned int>(GetTickCount()));
size_t max_value = valid_ids.size();
size_t index = rand() % max_value + 1;
size_t max_value = valid_ids.size();

srand(static_cast<unsigned int>(GetTickCount()));

foreach_(id, valid_ids) {
size_t index = rand() % max_value;
int anime_id = valid_ids.at(index);
if (PlayNextEpisode(anime_id))
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/ui/dlg/dlg_about.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ BOOL AboutDialog::OnInitDialog() {
L"\\b Author:\\b0\\line "
L"Eren 'erengy' Okka\\line\\line "
L"\\b Committers and other contributors:\\b0\\line "
L"saka, Diablofan, slevir, LordGravewish, cassist, rr-\\line\\line "
L"saka, Diablofan, slevir, LordGravewish, cassist, rr-, sunjayc\\line\\line "
L"\\b Third-party stuff that is used by Taiga:\\b0\\line "
L"- Fugue Icons 3.4.5, Copyright (c) 2012, Yusuke Kamiyamane\\line "
L"- JsonCpp 0.6.0, Copyright (c) 2007-2010, Baptiste Lepilleur\\line "
Expand Down

0 comments on commit 85236c5

Please sign in to comment.