SpeexDSP issueshttps://gitlab.xiph.org/xiph/speexdsp/-/issues2023-08-14T16:32:27Zhttps://gitlab.xiph.org/xiph/speexdsp/-/issues/12Remove unnecessary null pointer checks2023-08-14T16:32:27ZMarkus ElfringRemove unnecessary null pointer checks:eyes: [A few extra null pointer checks are not needed](https://stackoverflow.com/questions/18775608/free-a-null-pointer-anyway-or-check-first "Free a null pointer anyway or check first?") in [the function “spx_drft_clear”](https://gitla...:eyes: [A few extra null pointer checks are not needed](https://stackoverflow.com/questions/18775608/free-a-null-pointer-anyway-or-check-first "Free a null pointer anyway or check first?") in [the function “spx_drft_clear”](https://gitlab.xiph.org/xiph/speexdsp/-/blob/738e17905e1ca2a1fa932ddd9c2a85d089f4e845/libspeexdsp/smallft.c#L1252 "Update candidate").https://gitlab.xiph.org/xiph/speexdsp/-/issues/11Completion of error handling2023-08-14T07:04:23ZMarkus ElfringCompletion of error handlingWould you like to [add more error handling](https://gitlab.xiph.org/xiph/speexdsp/-/blob/738e17905e1ca2a1fa932ddd9c2a85d089f4e845/libspeexdsp/fftwrap.c#L231 "Update candidate: spx_fft_init()") for return values from functions like [speex...Would you like to [add more error handling](https://gitlab.xiph.org/xiph/speexdsp/-/blob/738e17905e1ca2a1fa932ddd9c2a85d089f4e845/libspeexdsp/fftwrap.c#L231 "Update candidate: spx_fft_init()") for return values from functions like [speex_alloc()](https://gitlab.xiph.org/xiph/speexdsp/-/blob/738e17905e1ca2a1fa932ddd9c2a85d089f4e845/libspeexdsp/os_support.h#L48 "Memory allocation")?https://gitlab.xiph.org/xiph/speexdsp/-/issues/10reserved identifier violation2023-08-14T06:24:58ZMarkus Elfringreserved identifier violation:eyes: I would like to point out that identifiers like “[`__SPEEX_TYPES_H__`](https://gitlab.xiph.org/xiph/speexdsp/-/blob/738e17905e1ca2a1fa932ddd9c2a85d089f4e845/include/speex/speexdsp_config_types.h.in#L1 "Update candidate")” and “[`_...:eyes: I would like to point out that identifiers like “[`__SPEEX_TYPES_H__`](https://gitlab.xiph.org/xiph/speexdsp/-/blob/738e17905e1ca2a1fa932ddd9c2a85d089f4e845/include/speex/speexdsp_config_types.h.in#L1 "Update candidate")” and “[`_JitterBufferPacket`](https://gitlab.xiph.org/xiph/speexdsp/-/blob/738e17905e1ca2a1fa932ddd9c2a85d089f4e845/include/speex/speex_jitter.h#L56 "Another update candidate")” [do not fit](https://wiki.sei.cmu.edu/confluence/display/cplusplus/DCL51-CPP.+Do+not+declare+or+define+a+reserved+identifier "Do not declare an identifier which is reserved for the compiler implementation.") to the expected naming convention of the C++ language standard.
:thought_balloon: Would you like to adjust your selection for unique names?https://gitlab.xiph.org/xiph/speexdsp/-/issues/8Does not compile with ARM in THUMB mode2022-08-06T00:35:32ZRosen PenevDoes not compile with ARM in THUMB mode```
/tmp/cc6D2D3Y.s: Assembler messages:
/tmp/cc6D2D3Y.s:157: Error: selected FPU does not support instruction -- `vcvt.s32.f32 d0,d0,#15'
/tmp/cc6D2D3Y.s:158: Error: selected processor does not support `vqrshrn.s32 d0,q0,#15' in Thumb m...```
/tmp/cc6D2D3Y.s: Assembler messages:
/tmp/cc6D2D3Y.s:157: Error: selected FPU does not support instruction -- `vcvt.s32.f32 d0,d0,#15'
/tmp/cc6D2D3Y.s:158: Error: selected processor does not support `vqrshrn.s32 d0,q0,#15' in Thumb mode
/tmp/cc6D2D3Y.s:159: Error: selected FPU does not support instruction -- `vmov.s16 r3,d0[0]'
/tmp/cc6D2D3Y.s:244: Error: selected FPU does not support instruction -- `vmul.f32 q0,q4,q8'
/tmp/cc6D2D3Y.s:252: Error: selected FPU does not support instruction -- `vmul.f32 q0,q4,q8'
/tmp/cc6D2D3Y.s:253: Error: selected FPU does not support instruction -- `vmul.f32 q1,q5,q9'
/tmp/cc6D2D3Y.s:254: Error: selected FPU does not support instruction -- `vmul.f32 q2,q6,q10'
/tmp/cc6D2D3Y.s:255: Error: selected FPU does not support instruction -- `vmul.f32 q3,q7,q11'
/tmp/cc6D2D3Y.s:262: Error: selected FPU does not support instruction -- `vmla.f32 q0,q4,q8'
/tmp/cc6D2D3Y.s:263: Error: selected FPU does not support instruction -- `vmla.f32 q1,q5,q9'
/tmp/cc6D2D3Y.s:264: Error: selected FPU does not support instruction -- `vmla.f32 q2,q6,q10'
/tmp/cc6D2D3Y.s:265: Error: selected FPU does not support instruction -- `vmla.f32 q3,q7,q11'
/tmp/cc6D2D3Y.s:267: Error: selected FPU does not support instruction -- `vadd.f32 q4,q0,q1'
/tmp/cc6D2D3Y.s:268: Error: selected FPU does not support instruction -- `vadd.f32 q5,q2,q3'
/tmp/cc6D2D3Y.s:270: Error: selected FPU does not support instruction -- `vadd.f32 q0,q4,q5'
/tmp/cc6D2D3Y.s:275: Error: selected FPU does not support instruction -- `vmla.f32 q0,q6,q10'
/tmp/cc6D2D3Y.s:277: Error: selected FPU does not support instruction -- `vadd.f32 d0,d0,d1'
/tmp/cc6D2D3Y.s:278: Error: selected processor does not support `vpadd.f32 d0,d0,d0' in Thumb mode
```https://gitlab.xiph.org/xiph/speexdsp/-/issues/6libspeexdsp.def is missing definitions2022-03-01T12:38:06ZPierre Ferranlibspeexdsp.def is missing definitionslibspeexdsp.def is missing definitions, particularly jitter_buffer_ctl and jitter_buffer_remaining_span, cause the build to not contain all necessary functions on Win32. This issue does not occur on _nix.
See https://github.com/microsof...libspeexdsp.def is missing definitions, particularly jitter_buffer_ctl and jitter_buffer_remaining_span, cause the build to not contain all necessary functions on Win32. This issue does not occur on _nix.
See https://github.com/microsoft/vcpkg/pull/23296https://gitlab.xiph.org/xiph/speexdsp/-/issues/5Memory leak in JitterBuffer2022-05-09T16:32:40ZRobert AdamMemory leak in JitterBufferI'm referring to the code path at
https://gitlab.xiph.org/xiph/speexdsp/-/blob/master/libspeexdsp/jitter.c#L591-595
which is taken, if the user has registered a custom destroy/free callback (via `JITTER_BUFFER_SET_DESTROY_CALLBACK`). How...I'm referring to the code path at
https://gitlab.xiph.org/xiph/speexdsp/-/blob/master/libspeexdsp/jitter.c#L591-595
which is taken, if the user has registered a custom destroy/free callback (via `JITTER_BUFFER_SET_DESTROY_CALLBACK`). However, contrary to the path that is taken, if no such callback has been registered, the packet's data doesn't seem to get destroyed (by invoking the user-registered callback). At the end of the `else`-block, for this if-statement, `speex_free` is used to that purpose, but as I said: the code path for the custom destroy callback seems to be missing out on this.
If I understand the logic correctly, the packet isn't immediately freed, as in this case, the used data pointer is returned as-is instead of copying the data out of the buffer. Therefore, freeing the data here, would cause the using application to perform a use-after-free when accessing the returned data.
However, the problem seems to be that `jitter->packets[i].data` is set to `NULL`. Therefore, any subsequent logic to check whether a given package has been released already (which appears to be done by checking if `data == NULL`) (e.g. at https://gitlab.xiph.org/xiph/speexdsp/-/blob/master/libspeexdsp/jitter.c#L378), will assume that the data has been freed, where in fact it hasn't (the pointer has only been overwritten with `NULL` without actually freeing the data).https://gitlab.xiph.org/xiph/speexdsp/-/issues/4Compiler warnings with comparing singed and unsigned ints2022-01-23T06:22:59ZAnders JenboCompiler warnings with comparing singed and unsigned intsThese are now the only compiler warnings left when building DevilutionX, would be great if we can handle them so we can start checking for compiler warnings in the CI :)
```
In file included from speex_resampler/resample.c:100:
speex_re...These are now the only compiler warnings left when building DevilutionX, would be great if we can handle them so we can start checking for compiler warnings in the CI :)
```
In file included from speex_resampler/resample.c:100:
speex_resampler/resample_sse.h:45:14: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
for (i=0;i<len;i+=8)
~^~~~
speex_resampler/resample_sse.h:62:12: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
for(i=0;i<len;i+=2)
~^~~~
speex_resampler/resample_sse.h:84:14: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
for (i=0;i<len;i+=8)
~^~~~
speex_resampler/resample_sse.h:110:12: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
for(i=0;i<len;i+=2)
~^~~~
speex_resampler/resample.c:674:20: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
for (j=0;j<st->filt_len;j++)
~^~~~~~~~~~~~~
speex_resampler/resample.c:946:21: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
for(j=0;j<ichunk;++j)
~^~~~~~~
speex_resampler/resample.c:949:20: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
for(j=0;j<ichunk;++j)
~^~~~~~~
speex_resampler/resample.c:1001:19: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
for(j=0;j<ichunk;++j)
~^~~~~~~
speex_resampler/resample.c:1008:19: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
for(j=0;j<ichunk;++j)
~^~~~~~~
speex_resampler/resample.c:1018:16: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
for (j=0;j<ochunk+omagic;++j)
~^~~~~~~~~~~~~~
```