FS#12878 - Zero-length embedded album art prevents mp3 playback

Attached to Project: Rockbox
Opened by Jack Whitham (jwhitham) - Tuesday, 09 July 2013, 21:12 GMT
Last edited by Thomas Martitz (kugel.) - Monday, 23 December 2013, 16:55 GMT
Task Type Bugs
Category ID3 / meta data
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Release 3.12
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


MP3 files with id3v2 APIC tags containing 0 bytes of "image/jpeg" data will not be played by Rockbox - both version 3.13 and the current GIT version.

The attached zip file contains an mp3 with a malformed tag. I zeroed all the data after the first 128kb, this is a store-bought file, the store was responsible for the malformed id3v2 tag. The mp3 file will play in all the other decoders that I tested - WMP, foobar, mpg123, mplayer.

Using rockbox, the zero size image data triggers erroneous behaviour in the bufopen function (buffering.c) where the following code is executed: "if (size == 0) size = filesize(fd);" This causes bufopen to print the error "bufopen(): failed to add handle". It returns ERR_BUFFER_FULL. Playback is prevented.

I'm also attaching a patch which fixes the issue. Tested in the UI simulator.
This task depends upon

Closed by  Thomas Martitz (kugel.)
Monday, 23 December 2013, 16:55 GMT
Reason for closing:  Fixed
Additional comments about closing:  ca423ed0e317645c8febb8dc604743f0fd47139a
Comment by Thomas Martitz (kugel.) - Wednesday, 10 July 2013, 09:15 GMT
Thank you. The fix seems like a nobrainer. However we accept patches through gerrit these days. Can you upload it there (
Comment by Jack Whitham (jwhitham) - Thursday, 11 July 2013, 00:13 GMT
The process for using that site looks a bit complex and I don't think I have time to learn how to do it properly. Maybe you would be willing to upload this small patch on my behalf? Thanks in advance.

btw. I have now successfully tested it on my Sansa Clip Zip.
Comment by Thomas Martitz (kugel.) - Thursday, 11 July 2013, 18:28 GMT has a quick start guide for gerrit. If you still cannot use it can you provide a 'git format-patch' with commit message?