[Openal-devel] Two patches for Sample OpenAL implementation (serios bug fix in _alFloatMul and minor bug fix in _alApplyFilters)

Ivan Dubrov wfragg at gmail.com
Sun Aug 27 02:33:14 PDT 2006


Hello,

Attached two patches that fix two bugs in the Sample OpenAL 
implemenation. They both should apply to the 0.0.8 version of the 
implementation.

The first patch (openal-0.0.8-floatmul.patch) fixes serious bug in the 
_alFloatMul implementation. The MMX code simply does not work if the 
sample length is too small and it is not properly aligned. In that case 
the samples_pre is greater than len, the samples_main becomes negative 
(in fact, big positive, since it is unsigned).

I've quickly looked to the SVN and it seems like the SSE2 code is 
affected by this bug too. Also, other MMX/SSE2 code could be affected as 
well, I haven't looked at it yet.


The second patch fixes very minor bug in the reallocation code. The code 
  checks the "f_buffers.len" against the "len/sizeof(ALshort)", but you 
do not need to divide the "len" by ALshort! The "f_buffers.len" is in 
bytes (because "newlen" is in bytes - it is passed to "realloc" - and 
"newlen" is assigned then to "f_buffers.len"). The "len" is in bytes too 
- you can see it from the code. Actually, the bug only could result in 
extra memory (re-)allocation.



The both patches are attached. Also they are hosted here
http://wfrag.org/files/openal-0.0.8-floatmul.patch and here 
http://wfrag.org/files/openal-0.0.8-realloc_fix.patch


-- 
WBR,
Ivan S. Dubrov
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openal-0.0.8-floatmul.patch
Type: text/x-patch
Size: 443 bytes
Desc: not available
Url : http://opensource.creative.com/pipermail/openal-devel/attachments/20060827/2054e438/openal-0.0.8-floatmul.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openal-0.0.8-realloc_fix.patch
Type: text/x-patch
Size: 488 bytes
Desc: not available
Url : http://opensource.creative.com/pipermail/openal-devel/attachments/20060827/2054e438/openal-0.0.8-realloc_fix.bin


More information about the Openal-devel mailing list