[Tremor] [Patch] Fix crash on large comments on low memory targets

Mike Giacomelli giac2000 at hotmail.com
Thu Jul 2 21:16:40 PDT 2009


> From: andy at slimdevices.com
> To: giac2000 at hotmail.com
> Subject: Re: [Tremor] [Patch] Fix crash on large comments on low memory targets
> Date: Fri, 3 Jul 2009 00:00:05 -0400
> 
> 
> On Jul 2, 2009, at 11:45 PM, Mike Giacomelli wrote:
> 
> >
> > > Hi, how does this patch handle the fact that the large comment is
> > > still fully buffered by the Ogg page code? When I fixed this issue
> > > [1] I had to use a much more complex method to avoid using all the
> > > extra memory in the Ogg page reading code. I don't see any of that  
> > in
> > > your patch, so I assume all the large pages containing comments will
> > > still be read into memory?
> > >
> > > [1] http://lists.xiph.org/pipermail/tremor/2009-January/001554.html
> >
> > You mean that it will still be copied from storage into memory  
> > during buffering?  This seems harmless enough to me given that it'll  
> > be promptly overwritten the next time the system rebuffers.
> >
> > Or do I misunderstand you?
> 
> Right, the Ogg page buffering code fully buffers the entire comment  
> (potentially up to 4GB!) into memory before it gets to the vorbis  
> comment code.
>

In rockbox this has not been an issue, since we run on mostly hard disk based players, and can only read the disk for a few seconds during each buffering period.  Therefore we buffer ahead however many MB of RAM we have in our system and decode until we run out of buffer.  Ogg files are then read out of our own buffering system and decoded by Tremor after the disk has already spun down.  If you make the codec not request bytes it doesnt need it makes little difference, since we have already loaded the memory and powered down our disk or flash memory.

My goal was to make the decoder not crash on files that exhausted our tiny malloc buffer.  But if you've got a fix that does this and helps people who haven't written their own buffering code, that would be nice too.  Why hasn't it been committed?

_________________________________________________________________
Windows Live™: Keep your life in sync. 
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_BR_life_in_synch_062009
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/tremor/attachments/20090702/7a8e6138/attachment.htm 


More information about the Tremor mailing list