From e74f095fe184fe11c1fc8e07181a0a21146738ce Mon Sep 17 00:00:00 2001 From: Dmitry Smirnov Date: Fri, 5 Jul 2013 17:50:02 +1000 Subject: [PATCH] fix handling of cuesheets with 99 tracks (Debian #658818) There's an off-by-one error in cd.c which causes cueprint to wrongly reject cuesheets with 99 tracks. Its actual limit is 98 tracks, and yet as the source code notes, the Red Book audio standard permits 99 tracks per disc (and 99 indices per track). . When I looked into this, I saw that: . 1) not only will the same error occur with index numbers, but 2) the wrong preprocessor symbol is being expanded when checking the index number Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=658818 From: Branden Robinson Author: Dmitry Smirnov --- src/lib/cd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/cd.c b/src/lib/cd.c index 2d52fa3..516af09 100644 --- a/src/lib/cd.c +++ b/src/lib/cd.c @@ -126,7 +126,7 @@ Cdtext *cd_get_cdtext(Cd *cd) Track *cd_add_track(Cd *cd) { - if (MAXTRACK - 1 > cd->ntrack) { + if (MAXTRACK > cd->ntrack) { cd->ntrack++; } else { fprintf(stderr, "too many tracks\n"); @@ -266,7 +266,7 @@ Cdtext *track_get_cdtext(Track *track) void track_add_index(Track *track, long index) { - if (MAXTRACK - 1 > track->nindex) { + if (MAXINDEX > track->nindex) { track->nindex++; } else { fprintf(stderr, "too many indexes\n");