aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-12-16 20:55:19 +0100
committerMax Kellermann <max@duempel.org>2009-12-16 20:55:19 +0100
commit5649f223229222f88ae4b278d5d6530079a18fa2 (patch)
tree32f33ec8a41e003120d4b0ade33f2103154fb178
parentb89281411f237c6644e666cb439bde68ea901a52 (diff)
downloadmpd-5649f223229222f88ae4b278d5d6530079a18fa2.tar.gz
mpd-5649f223229222f88ae4b278d5d6530079a18fa2.tar.xz
mpd-5649f223229222f88ae4b278d5d6530079a18fa2.zip
cue_tag: check cd_get_track()!=NULL
Diffstat (limited to '')
-rw-r--r--src/cue/cue_tag.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/cue/cue_tag.c b/src/cue/cue_tag.c
index 94797bd46..3f8fc327e 100644
--- a/src/cue/cue_tag.c
+++ b/src/cue/cue_tag.c
@@ -175,18 +175,20 @@ struct tag *
cue_tag(struct Cd *cd, unsigned tnum)
{
struct tag *cd_tag, *track_tag;
+ struct Track *track;
assert(cd != NULL);
- if (tnum > 256)
+ track = cd_get_track(cd, tnum);
+ if (track == NULL)
return NULL;
/* tag from CDtext info */
cd_tag = cue_tag_cd(cd_get_cdtext(cd), cd_get_rem(cd));
/* tag from TRACKtext info */
- track_tag = cue_tag_track(track_get_cdtext(cd_get_track(cd, tnum)),
- track_get_rem(cd_get_track(cd, tnum)));
+ track_tag = cue_tag_track(track_get_cdtext(track),
+ track_get_rem(track));
return cue_tag_merge(cd_tag, track_tag);
}