Browse Source

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 <branden@debian.org>
Author: Dmitry Smirnov <onlyjob@member.fsf.org>
master
Dmitry Smirnov 10 years ago
parent
commit
e74f095fe1
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/lib/cd.c

+ 2
- 2
src/lib/cd.c View File

@@ -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");


Loading…
Cancel
Save