Skip to content

Commit

Permalink
SongPage: fix assert() checking the "tag" range
Browse files Browse the repository at this point in the history
AppendTag() is called with a mpd_tag_type, and therefore it should be
in that range.  The assert() has always been wrong, but that had no
effect until commit f64f116

Closes #149
  • Loading branch information
MaxKellermann committed Sep 23, 2024
1 parent 36a14eb commit d189a09
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ ncmpc 0.51 - not yet released
* repaint main area after terminal was resized
* pressing Enter while in "jump mode" activates selected item
* fix crash in new text input dialog
* fix crash on song info page

ncmpc 0.50 - (2024-09-12)
* build: require Meson 0.60
Expand Down
2 changes: 1 addition & 1 deletion src/SongPage.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ SongPage::AppendTag(const struct mpd_song *song,
unsigned i = 0;
const char *value;

assert((unsigned)tag < std::size(tag_labels));
assert(tag < MPD_TAG_COUNT);
assert(label != nullptr);

while ((value = mpd_song_get_tag(song, tag, i++)) != nullptr)
Expand Down

0 comments on commit d189a09

Please sign in to comment.