Messages in this thread Patch in this message | | | Date | Mon, 16 Aug 1999 01:27:51 +0200 (CEST) | From | Eric Lammerts <> | Subject | Re: [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/
| |