mirror of
https://github.com/AuxXxilium/eudev.git
synced 2025-03-05 03:33:23 +07:00
cdrom_id: fix recognition of blank media
Thanks to David!
This commit is contained in:
parent
2c0644c1c2
commit
9bbdf6eb3c
@ -470,9 +470,13 @@ static int cd_media_toc(int fd)
|
||||
info("READ TOC: len: %d\n", len);
|
||||
if (len > sizeof(toc))
|
||||
return -1;
|
||||
if (len < 8)
|
||||
if (len < 2)
|
||||
return -1;
|
||||
|
||||
/* empty media has no tracks */
|
||||
if (len < 8)
|
||||
return 0;
|
||||
|
||||
scsi_cmd_set(&sc, 0, 0x43);
|
||||
scsi_cmd_set(&sc, 6, header[2]); /* First Track/Session Number */
|
||||
scsi_cmd_set(&sc, 7, len >> 8);
|
||||
|
Loading…
Reference in New Issue
Block a user