lkml.org 
[lkml]   [1999]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] 2.2.11 ide-cd.c CDROMREADAUDIO bug

On Sun, 15 Aug 1999, Jens Axboe wrote:

> The fix isn't that easy. If you look at the SCSI CD-ROM you'll
> see the exact same code as in ide-cd.c. The toc isn't always
> that precise and most drives will complain violently when
> trying to read capacity+75 (even just capacity).

I see what you mean.

It appears that on many CDs the starting sector of the lead out
area is exactly toc->capacity + 1. That's why cdparanoia wants to read
beyond toc->capacity. So what about this patch? I think this is pretty
safe:

--- linux/drivers/block/ide-cd.c.orig Mon Aug 9 21:04:38 1999
+++ linux/drivers/block/ide-cd.c Mon Aug 16 00:51:26 1999
@@ -2188,7 +2188,8 @@
else
return -EINVAL;

- if (lba < 0 || lba >= toc->capacity)
+ if (lba < 0 || (lba >= toc->capacity &&
+ lba >= toc->ent[toc->hdr.last_track - toc->hdr.first_track + 1].addr.lba))
return -EINVAL;

buf = (char *) kmalloc (CDROM_NBLOCKS_BUFFER*CD_FRAMESIZE_RAW,

Eric

--
Eric Lammerts <eric@scintilla.utwente.nl>




-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:53    [W:0.040 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site