[Vorbis-dev] buffer overruns for small files

Steve Russell srussell at innernet.net
Sat Nov 5 08:27:38 PST 2005


I wonder if anyone would have a comment on an experiment I have pretty much completed in my MFC/C++ project.  With my simple libvorbis implementation, ogg decoding works just fine for files that are 10kb or larger.  For anything smaller (actually, I don't have a 9kb file, so <= 8), it seems that I get an inaccurate value for ov_pcm_total.  Though ov_read returns zero, I overflow the buffer and crash on ov_clear.  These are my TRACE statements:

>= 10kb:

Opening Audio File 'no_0.ogg'
vi->channels = '2'
vi->rate = '44100'
pcmTotal = '15341'
pcmTotal * vi->channels * 2 = '61364'
BufferSize = '61364'
dwBufferLength = '61364'
BufferSize = '61364'
dwBufferLength - BufferSize = '0'
------------
< 10kb:

Opening Audio File 'Steel guitar_4.ogg'
vi->channels = '2'
vi->rate = '44100'
pcmTotal = '9876'
pcmTotal * vi->channels * 2 = '39504'
BufferSize = '39504'
dwBufferLength = '43264'
BufferSize = '39504'
dwBufferLength - BufferSize = '3760'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/vorbis-dev/attachments/20051105/8ff0d858/attachment.html


More information about the Vorbis-dev mailing list