Fix for Ogg Vorbis playback in BS2 cutscenes
|Reported by:||eriktorbjorn||Owned by:||fingolfin|
|Game:||Broken Sword 2|
I've been having trouble with the Ogg Vorbis playback in the BS2 cutscenes. I finally sat down and tried to figure out what happened:
readBuffer() is called with 11024 being the desired number of samples.
On the first iteration, samples is 0 and _bufferEnd - _pos is 4096. Since this is less than 11024, len gets set to 4096.
On the second iteration, samples is 4096, and _bufferEnd - _pos is still 4096. Since 4096 + 4096 = 8192 is still less than 11024, len gets set to 8192.
At this stage, we have copied 4096 + 8192 = 12288 samples, which seems like a major whoops to me.
I don't know if this patch is correct (I'm still fighting off the onset of a cold, which doesn't help my thinking :-), but it does fix the crashing problem for me.
Ticket imported from: #878883. Ticket imported from: patches/417.
Change History (10)
comment:2 by , 16 years ago
|Summary:||Fix for Ogg Vorbis playback in BS2 cutscenes → Fix for Ogg Vorbis buffer overflow|
comment:4 by , 16 years ago
|Status:||new → closed|
|Summary:||Fix for Ogg Vorbis buffer overflow → Fix for Ogg Vorbis playback in BS2 cutscenes|