summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/cuesheet.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/cuesheet.c b/apps/cuesheet.c
index afe9531ce7..935af60898 100644
--- a/apps/cuesheet.c
+++ b/apps/cuesheet.c
@@ -362,9 +362,12 @@ void cue_draw_markers(struct screen *screen, struct cuesheet *cue,
362 int x, int y, int w, int h) 362 int x, int y, int w, int h)
363{ 363{
364 int i,xi; 364 int i,xi;
365 unsigned long tracklen_seconds = tracklen/1000; /* duration in seconds */
366
365 for (i=1; i < cue->track_count; i++) 367 for (i=1; i < cue->track_count; i++)
366 { 368 {
367 xi = x + (w * (long long)cue->tracks[i].offset)/tracklen; 369 /* Convert seconds prior to multiplication to avoid overflow. */
370 xi = x + (w * (cue->tracks[i].offset/1000)) / tracklen_seconds;
368 draw_veritcal_line_mark(screen, xi, y, h); 371 draw_veritcal_line_mark(screen, xi, y, h);
369 } 372 }
370} 373}