From 5ac9df4db829e16c49538e048dc2d44d23340154 Mon Sep 17 00:00:00 2001 From: rocky Date: Fri, 8 Jul 2011 21:15:29 -0400 Subject: [PATCH] Reduce range of seek in paranoia_seek to be int32_t. CDDA's definitely live within this range. off_t is influenced by _FILE_OFFSET_BITS and can cause problems on a 32-bit system where _FILE_OFFSET_BITS is set to 64. See Bastiaan Timmer's posting to libcdio-help on July 7, 2011. --- include/cdio/paranoia.h | 8 ++++---- lib/paranoia/paranoia.c | 6 ++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/include/cdio/paranoia.h b/include/cdio/paranoia.h index 02b50002..73f3bc4f 100644 --- a/include/cdio/paranoia.h +++ b/include/cdio/paranoia.h @@ -1,7 +1,6 @@ /* - $Id: paranoia.h,v 1.15 2008/03/25 15:59:09 karl Exp $ - - Copyright (C) 2004, 2005, 2006, 2007, 2008 Rocky Bernstein + Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 + Rocky Bernstein Copyright (C) 1998 Monty xiphmont@mit.edu This program is free software: you can redistribute it and/or modify @@ -126,7 +125,8 @@ extern "C" { @param whence like corresponding parameter in libc's lseek, e.g. SEEK_SET or SEEK_END. */ - extern lsn_t cdio_paranoia_seek(cdrom_paranoia_t *p, off_t seek, int whence); + extern lsn_t cdio_paranoia_seek(cdrom_paranoia_t *p, int32_t seek, + int whence); /*! Reads the next sector of audio data and returns a pointer to a full diff --git a/lib/paranoia/paranoia.c b/lib/paranoia/paranoia.c index a6ce3054..56561b07 100644 --- a/lib/paranoia/paranoia.c +++ b/lib/paranoia/paranoia.c @@ -1,7 +1,5 @@ /* - $Id: paranoia.c,v 1.27 2008/04/17 17:39:48 karl Exp $ - - Copyright (C) 2004, 2005, 2006, 2008 Rocky Bernstein + Copyright (C) 2004, 2005, 2006, 2008, 2011 Rocky Bernstein Copyright (C) 1998 Monty xiphmont@mit.edu This program is free software: you can redistribute it and/or modify @@ -2472,7 +2470,7 @@ paranoia_modeset(cdrom_paranoia_t *p, int mode_flags) SEEK_SET or SEEK_END. */ lsn_t -paranoia_seek(cdrom_paranoia_t *p, off_t seek, int whence) +paranoia_seek(cdrom_paranoia_t *p, int32_t seek, int whence) { long sector; long ret;