summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/flac/flac.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/flac/flac.c b/plugins/flac/flac.c
index 0332ecc3..fc7bbe5b 100644
--- a/plugins/flac/flac.c
+++ b/plugins/flac/flac.c
@@ -622,8 +622,8 @@ cflac_insert_with_embedded_cue (ddb_playlist_t *plt, DB_playItem_t *after, DB_pl
DB_playItem_t *ins = after;
// first check if cuesheet is matching the data
- for (int i = 0; i < cuesheet->num_tracks-1; i++) {
- if (cuesheet->tracks[i].offset + cuesheet->tracks[i+1].offset-1 > totalsamples) {
+ for (int i = 0; i < cuesheet->num_tracks; i++) {
+ if (cuesheet->tracks[i].offset >= totalsamples) {
fprintf (stderr, "The flac %s has invalid embedded cuesheet. You should remove it using metaflac.\n", deadbeef->pl_find_meta_raw (origin, ":URI"));
return NULL;
}