From a716292bd64763accd2462b9af63990b5a60c042 Mon Sep 17 00:00:00 2001 From: rocky Date: Sat, 6 Mar 2004 01:24:29 +0000 Subject: [PATCH] The logic in _cdio_read_mode2_sector seems a bit wrong and convoluted to me, but passes the regression tests. (Perhaps it is why we get valgrind errors in vcdxrip). Leave it the way it was for now. Review this sector 2336 stuff later. --- lib/image/bincue.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/image/bincue.c b/lib/image/bincue.c index 476e8bcd..bd2cdc9e 100644 --- a/lib/image/bincue.c +++ b/lib/image/bincue.c @@ -1,5 +1,5 @@ /* - $Id: bincue.c,v 1.1 2004/03/05 12:32:45 rocky Exp $ + $Id: bincue.c,v 1.2 2004/03/06 01:24:29 rocky Exp $ Copyright (C) 2001 Herbert Valerio Riedel Copyright (C) 2002, 2003, 2004 Rocky Bernstein @@ -24,7 +24,7 @@ (*.cue). */ -static const char _rcsid[] = "$Id: bincue.c,v 1.1 2004/03/05 12:32:45 rocky Exp $"; +static const char _rcsid[] = "$Id: bincue.c,v 1.2 2004/03/06 01:24:29 rocky Exp $"; #include "cdio_assert.h" #include "cdio_private.h" @@ -586,8 +586,11 @@ _cdio_read_mode2_sector (void *env, void *data, lsn_t lsn, blocksize, 1); if (ret==0) return ret; - memcpy (data, buf + CDIO_CD_XA_SYNC_HEADER, - mode2_form2 ? M2RAW_SECTOR_SIZE : CDIO_CD_FRAMESIZE); + if (mode2_form2) + memcpy (data, buf + CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE, + M2RAW_SECTOR_SIZE); + else + memcpy (data, buf + CDIO_CD_XA_SYNC_HEADER, CDIO_CD_FRAMESIZE); return 0; }