FS#2917 - FIX: retrieval of total sample count in get_vorbis_metadata

Attached to Project: Rockbox
Opened by Gerhard Dirschl (gdirschl) - Saturday, 14 January 2006, 15:12 GMT
Last edited by Björn Stenberg (zagor) - Friday, 24 March 2006, 14:23 GMT
Task Type Patches
Category Music playback
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Immediate
Reported Version Daily build (which?)
Due in Version Version 3.0
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


Repost as the attachment was missed/lost.

get_vorbis_metadata may return a too small sample count
(depending on the ogg file beeing analysed).
The reasons are:
- the last five bytes of a data chunk in buffer are
always discarded if no "OggS" mark was found in buffer
so far. Hence the beginning of a header in these five
bytes is lost sight of.
- Moving an OggS mark to start of buffer (after it was
found in the last 17 bytes of a data chunk) doesn't
work like expected (out of boundary read, buffer
- If a header was found in buffer it is not checked if
there are other ones. OK, as the buffer is very small
this is unlikely to happen.

A patch is hopefully attached this time.
This task depends upon

Closed by  Magnus Holmgren (learman)
Monday, 01 May 2006, 13:58 GMT
Reason for closing:  Accepted
Additional comments about closing:  Patch committed, thanks!
Comment by Brandon Low (lostlogic) - Friday, 24 March 2006, 15:47 GMT
Would this by chance lead to crashing on certain not quite right oggs?