[vorbis] ov_clear(&vorbis) segfaults?

Alexander Markley alex at milent.com
Mon Sep 15 18:42:30 PDT 2003



 > Of course.

:) I figured as much, I'm just too lazy to check for myself. :-P

 > you're allocating half as much as you need to: ... times number of 
channels (you didn't do this).

audio_test.c: 69: length = length * info->channels; //Isn't that what 
this does? ;)

 >This last bit is made more complex by the existence of chained streams

Yes, I noticed that.

 >you never, ever, want to allocate a single buffer for an entire file

I agree that for general purpose vorbis decoding, decoding the whole 
file into memory would be both stupid and dangerous. However, the 
application that I am currently writing requires me to do so.** (The 
vorbis files that are being decoded are tightly controlled, and should 
not pose a serious problem.)

** - If there was a way to quickly branch off the OggVorbis_File into 
multiple structures that could be decoded seperately potentially at the 
same time, then I could cut down on the RAM usage.

Thanks for the comments, you're keepin' me on my toes. :)

I will test the new libvorbis code to see if that really does fix the 
previous problem.

--Alex

Michael Smith wrote:
> On Monday 15 September 2003 23:40, you wrote:
> 
>>If it doesn't crash on your system with newer code, that is good, but
>>I'd like to test it myself.
>>
>>Is this newer libvorbisfile in CVS or something somewhere so I can try
>>it myself?
> 
> 
> Of course.
> 
> 
>>Also, did you take a peek at my code to see if I was doing anything
>>retarded?
>>
> 
> 
> Not before, I just did then. The only bit that looks wrong is where you 
> allocate your decode buffer. This is stupid for two reasons: you never, ever, 
> want to allocate a single buffer for an entire file, and you're allocating 
> half as much as you need to: number of samples (ok), times number of bytes 
> per sample (ok), times number of channels (you didn't do this). This last bit 
> is made more complex by the existence of chained streams: the number of 
> channels (and other parameters not used here, like sample rate) can change in 
> the middle of a file.
> 
> Mike
> 

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis mailing list