diff options
author | Alexey Yakovenko <waker@users.sourceforge.net> | 2014-06-24 09:20:30 +0200 |
---|---|---|
committer | Alexey Yakovenko <waker@users.sourceforge.net> | 2014-06-24 09:20:30 +0200 |
commit | 7c1364b0e5c24cad204b69b1ceb2fc2758548d17 (patch) | |
tree | b0307bd8ea91eaa06cc7776605e0a44cf6fcde83 | |
parent | a0d3c07df36f17a0ce22cc81ce9770dc9ab6549e (diff) |
flac: fixed cuesheet validation
-rw-r--r-- | plugins/flac/flac.c | 4 |
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; } |