From 7c1364b0e5c24cad204b69b1ceb2fc2758548d17 Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Tue, 24 Jun 2014 09:20:30 +0200 Subject: flac: fixed cuesheet validation --- plugins/flac/flac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins') 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; } -- cgit v1.2.3