Bug 384678

Summary: K3b fails reading cue files with title larger than 80 bytes
Product: [Applications] k3b Reporter: Mayeul C. <oss+kde+bugzilla>
Component: Image FormatsAssignee: k3b developers <k3b>
Status: RESOLVED FIXED    
Severity: normal CC: michalm, simonandric5, trueg
Priority: NOR    
Version: 17.08.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Failing cue file
Passing cue file

Description Mayeul C. 2017-09-13 21:38:04 UTC
Hello there,

I was batch-converting some music files with k3b, ripped with cue files, and it looks like k3b fails to parse the cue file if the TITLE section is larger than 80 bytes.

For now, I ran

`LANG=C sed -i 's/TITLE\s\+"\(.\{80\}\).\+"/TITLE "\1"/' *.cue`

on my files, but this is less than ideal.

Tested with k3b 17.08.1 on Arch linux (this version doesn't appear on the bug tracker page).

k3b fails with:

(K3b::CueFileParser) unknown Cue line: ' "TITLE \"This is a title wider than 80 bytes**********************************************\"" '


What's nice is that the bug is EXTREMELY EASY to reproduce: just create a file with the following line and a .cue extension.

TITLE "This is a title wider than 80 bytes*********************************************"

Remove a star, and you instead get:
(K3b::CueFileParser) successfully parsed cue file.

I would like to see the following happening:
- Support for titles longer than 80 bytes, with unicode if possible
- If too complicated, cut the title to 80 bytes and warn the user
- If this can't be implemented because of manpower constraints, at least provide a decent error message.

I could try to do it myself, but I suspect that it will take no time to fix for someone familiar with the codebase.

Thanks for maintaining k3b,

Mayeul
Comment 1 Mayeul C. 2017-09-13 21:40:23 UTC
Created attachment 107841 [details]
Failing cue file
Comment 2 Mayeul C. 2017-09-13 21:40:48 UTC
Created attachment 107842 [details]
Passing cue file
Comment 3 Mayeul C. 2017-09-13 21:42:49 UTC
Comment on attachment 107842 [details]
Passing cue file

Note that this isn't a useful cue file, and k3b will still output an error, but not the same as the other file.
Comment 4 Leslie Zhai 2017-09-14 02:27:08 UTC
Git commit c84ad1e9666ffff97622b8e96557fbe6061fd5a7 by Leslie Zhai.
Committed on 14/09/2017 at 02:25.
Pushed by lesliezhai into branch 'master'.

Hi Mayeul,

Please test it for me what will happen if cue title is larger than
 80 bytes, thanks!

M  +2    -1    libk3b/projects/k3bcuefileparser.cpp

https://commits.kde.org/k3b/c84ad1e9666ffff97622b8e96557fbe6061fd5a7
Comment 5 Leslie Zhai 2017-09-25 03:04:11 UTC
Git commit faaa4299083f23a39352602c4e69053845ce81c2 by Leslie Zhai.
Committed on 25/09/2017 at 03:02.
Pushed by lesliezhai into branch 'master'.

Revert parseLine for CueFileParser owing to no responese for the testplan.

M  +1    -2    libk3b/projects/k3bcuefileparser.cpp

https://commits.kde.org/k3b/faaa4299083f23a39352602c4e69053845ce81c2