Commit a303639c authored by Max Kellermann's avatar Max Kellermann

decoder/{gme,sidplay}: fix off-by-one bug in container_scan()

Broken by commit 0abee77e
parent c5133f60
...@@ -125,7 +125,7 @@ gme_container_scan(Path path_fs) ...@@ -125,7 +125,7 @@ gme_container_scan(Path path_fs)
const char *subtune_suffix = uri_get_suffix(path_fs.c_str()); const char *subtune_suffix = uri_get_suffix(path_fs.c_str());
auto tail = list.before_begin(); auto tail = list.before_begin();
for (unsigned i = 1; i < num_songs; ++i) { for (unsigned i = 1; i <= num_songs; ++i) {
char track_name[64]; char track_name[64];
snprintf(track_name, sizeof(track_name), snprintf(track_name, sizeof(track_name),
SUBTUNE_PREFIX "%03u.%s", i, subtune_suffix); SUBTUNE_PREFIX "%03u.%s", i, subtune_suffix);
......
...@@ -499,7 +499,7 @@ sidplay_container_scan(Path path_fs) ...@@ -499,7 +499,7 @@ sidplay_container_scan(Path path_fs)
return list; return list;
auto tail = list.before_begin(); auto tail = list.before_begin();
for (unsigned i = 1; i < n_tracks; ++i) { for (unsigned i = 1; i <= n_tracks; ++i) {
char track_name[32]; char track_name[32];
/* Construct container/tune path names, eg. /* Construct container/tune path names, eg.
Delta.sid/tune_001.sid */ Delta.sid/tune_001.sid */
......
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