[Debburn-devel] PATCH: Icedax locking up on CD with CD-EXTRA

Martin Thierer thierer at web.de
Wed Jul 22 08:42:51 UTC 2009


Hi,

I have an audio CD that cdda2wav (alias icedax) locks up on before giving 
any output.

I tried to debug this and found that the culprit is function 
Read_CD_Extra_File in icedax/cd_extra.c lines 70ff:

    while (p+33 < Extra_buf + CD_FRAMESIZE_RAW) {
      int namelength;

      namelength = p[32];
      if (namelength == 10 &&
          !memcmp(p+33, "INFO.CDP;1", 10)) break;

      p += p[0];
    }

It tries to find the file "INFO.CDP;1" which doesn't exist on said CD, so 
it loops forever.

I don't know anything about audio CD format and cd-extra in particular and 
what the correct fix would be:

The cd _does_ contain a file "INFO.CDP" (without the ";1"). Is that a legal 
alternative?

I checked with a different CD that has cd-extra and this CD indeed contains 
a file named "INFO.CDP;1". Note however, that with this CD 
Read_CD_Extra_File normally doesn't get called, because Read_CD_Extra_Info 
already returns after the check 

    /* check for cd extra */
    if (Extra_buffer[0] == 'C' && Extra_buffer[1] == 'D')
	return sector+offsets[i];

in line 128 of cd_extra.c.

The comment following this code suggests that the format of the other CD 
might just be broken, but IMHO cdda2wav shouldn't lock up anyway.

The attached patch fixes the lock-up for me, but as I don't understand the 
whole problem it might well be not the appropriate solution. BTW: If you 
consider it the right solution, the same modification should probably be 
made to the code searching for the "CDPLUS" directory in lines 44ff.

Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cdrkit-1.1.9-cd_extra.patch
Type: text/x-diff
Size: 410 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/debburn-devel/attachments/20090722/d7a9a020/attachment.patch>


More information about the Debburn-devel mailing list