src/audio


Log

Author Commit Date CI Message
Micha? Janiszewski 91820998 2018-10-28T21:36:48 Add and update include guards Include guards in most changed files were missing, I added them keeping the same style as other SDL files. In some cases I moved the include guards around to be the first thing the header has to take advantage of any possible improvements compiler may have for inclusion guards.
Ryan C. Gordon 4a50a042 2018-10-21T22:40:17 wasapi/win32: Sort initial device lists by device GUID. This makes an unchanged set of hardware always report devices in the same order on each run.
Ryan C. Gordon 04cbf132 2018-10-10T15:20:56 audio: All device names reported by SDL must be unique. This means that if you have two devices named "Soundblaster Pro" in your machine, one will be reported as "Soundblaster Pro" and the other as "Soundblaster Pro (2)". This makes it so you can't into a position where one of your devices can't be opened because another is sitting on the same name.
Ryan C. Gordon 0378529e 2018-10-10T14:55:24 audio: clean_out_device_list() already sets this flag to false for us.
Sam Lantinga f5a21ebf 2018-10-09T20:12:43 Added support for surround sound and float audio on Android
Sam Lantinga b2518761 2018-10-01T09:47:10 commit c6b28f46b8116552ec2b38d1d3c8535df28ba7a1 Author: Anthony Pesch <inolen@gmail.com> Date: Fri May 4 20:21:21 2018 -0400 Added SDL_AUDIO_ALLOW_SAMPLES_CHANGE flag enabling users of SDL_OpenAudioDevice to get the sample size of the actual hardware buffer vs having a stream created to handle the delta
Ryan C. Gordon 56ec349d 2018-09-29T16:48:15 audio: disable NEON converters for now. To be revisited after 2.0.9 ships! (doesn't fix Bugzilla #4186, but stops the regression for the time being.)
Ethan Lee 7f9854b9 2018-09-25T01:45:12 WinRT: Wait until audio device activation is complete and PrepDevice during OpenAudio
Sam Lantinga 5febdfce 2018-09-24T11:49:25 Fixed whitespace
Ryan C. Gordon 623a6def 2018-08-07T16:49:18 alsa: optionally run entire pipeline non-blocking.
Ryan C. Gordon 56f44cfa 2018-08-07T13:04:15 audio: Deal with device shutdown more carefully. This would cause problems in various ways, but specifically triggers an assert when you close a WASAPI capture device in an app running over RDP. Related to (but not the actual bug) in Bugzilla #3924.
Wohlstand ff8c62f2 2018-07-02T03:53:57 Fixed bug 4210 - SSE2-based converter makes junk result of S32 -> Float At the HG state abdd17144682, 64-bit assemblies are using SSE2-based resampler, produces junk sound when converting the S32 -> Float32 -> S16 chain. The `NEED_SCALAR_CONVERTER_FALLBACKS` thing works perfectly. If I will find a reason that caused this mistake, I'll send a patch by myself.
Ryan C. Gordon 4773690d 2018-06-25T12:55:23 Deal with possible malloc(0) calls, as pointed out by static analysis.
Sam Lantinga 1d25135b 2018-06-01T19:43:53 Fixed bug 4184 - jack audio driver fails in presence of midi ports Martin ?irokov Launching an SDL application with SDL_AUDIODRIVER=jack, and then calling SDL_OpenAudioDevice() with whatever parameters fails with an error like this one: SDL_OpenAudioDevice: Couldn't connect JACK ports: SDL:sdl_jack_output_0 => system:midi_playback_1 This happens because JACK_OpenDevice in src/audio/jack/SDL_jackaudio.c blindly tries to connect to all input ports without checking whether they are for audio or midi. The fix is to check port types and ignore all non audio ports. Also I removed devports field from struct SDL_PrivateAudioData, because it's never really used and removing unused ports from it would be PITA.
Sam Lantinga 8325df25 2018-05-24T07:30:24 Fixed bug 4169 - Crash due to audio session observer race condition Jona The following explains why this bug was happening: This crash was caused because the audio session was being set as active [session setActive:YES error:&err] when the audio device was actually being CLOSED. Certain cases the audio session being set to active would fail and the method would return right away. Because of the way the error was handled we never removed the SDLInterruptionListener thus leaking it. Later when an interruption was received the THIS_ object would contain a pointer to an already released device causing the crash. The fix: When only one device remained open and it was being closed we needed to set the audio session as NOT active and completely ignore the returned error to successfully release the SDLInterruptionListener. I think the user assumed that the open_playback_devices and open_capture_devices would equal 0 when all of them where closed but the truth is that at the end of the closing process that the open devices count is decremented.
Ryan C. Gordon 101544d6 2018-05-21T12:05:17 audio: Needed to fix two more instances for Visual Studio.
Ryan C. Gordon 49881861 2018-05-21T11:54:09 audio: Patched to compile on Visual Studio. (It gets upset at the -2147483648, thinking this should be an unsigned value because 2147483648 is too large for an int32, so the negative sign upsets the compiler.)
Ryan C. Gordon b7e88aaa 2018-05-16T02:03:06 audio: Added ARM NEON versions of audio converters. These are _much_ faster than the scalar equivalents on the Raspberry Pi that I tested on. Often 3x to 4x as fast!
Ryan C. Gordon cb0e614f 2018-05-15T02:29:35 audio: SSE2 float-to-int converters should clamp input. The scalar versions already do this.
Ryan C. Gordon a07e5815 2018-05-15T01:40:05 audio: Fix range on float-to-int data clamping. I can't tell if there was a good reason for this or it was just me getting numbers wrong due to exhaustion.
Ryan C. Gordon 7832cb65 2018-05-15T01:35:53 audio: float to int converters should clamp inclusively. If we have to test if a sample is > 1.0f anyhow, we might as well use this to avoid the unnecessary multiplication when it's == 1.0f, too. (etc).
Ryan C. Gordon e2ec1eb1 2018-05-15T01:04:11 audio: converting int32 to/from float shouldn't use doubles. The concern is that a massive int sample, like 0x7FFFFFFF, won't fit in a float32, which doesn't have enough bits to hold a whole number this large, just to divide it to get a value between 0 and 1. Previously we would convert to double, to get more bits, do the division, and cast back to a float, but this is expensive. Casting to double is more accurate, but it's 2x to 3x slower. Shifting out the least significant byte of an int32, so it'll definitely fit in a float, and dividing by 0x7FFFFF is still accurate to about 5 decimal places, and the difference doesn't appear to be perceptable.
Anthony Pesch c5914295 2018-05-04T21:21:32 alsa: avoid hardware parameters with an excessive number of periods. The previous code attempted to use set_buffer_size / set_period_size discretely, favoring the parameters which generated a buffer size that was exactly 2x the requested buffer size. This solution ultimately prioritizes only the buffer size, which comes at a large performance cost on some machines where this results in an excessive number of periods. In my case, for a 4096 sample buffer, this configured the device to use 37 periods with a period size of 221 samples and a buffer size of 8192 samples. With 37 periods, the SDL Audio thread was consuming 25% of the CPU. This code has been refactored to use set_period_size and set_buffer_size together. set_period_size is called first to attempt to set the period to exactly match the requested buffer size, and set_buffer_size is called second to further refine the parameters to attempt to use only 2 periods. The fundamental change here is that the period size / count won't go to extreme values if the buffer size can't be exactly matched, the buffer size should instead just increase to the next closest multiple of the target period size that is supported. After changing this, for a 4096 sample buffer, the device is configured to use 3 periods with a period size of 4096 samples and a buffer size of 12288 samples. With only 3 periods, the SDL Audio thread doesn't even show up when profiling. Fixes Bugzilla #4156.
Sam Lantinga f521b22e 2018-04-23T22:07:56 Added SDL_THREAD_PRIORITY_TIME_CRITICAL
Ryan C. Gordon dc8b55e5 2018-04-16T02:11:09 coreaudio: Use the standard SDL audio thread instead of spinning a new one. Fixes corner cases, like the audio callback not firing if the device is disconnected, etc.
Sam Lantinga 99a0c0f0 2018-02-24T08:23:44 Fixed MinGW-w64 build
Ryan C. Gordon 7e1fa0ce 2018-02-21T21:34:35 wasapi: fixed typo in an assert message.
Ryan C. Gordon c7e43665 2018-02-21T21:34:06 wasapi: let Windows do the resampling for us if possible.
Ryan C. Gordon 97494f53 2018-02-17T18:30:21 pulseaudio: Just read/dump captured data in FlushCapture. Apparently pa_stream_flush() doesn't work as expected: https://lists.freedesktop.org/archives/pulseaudio-discuss/2012-April/013328.html Fixes Bugzilla #4087.
sezero 40b27fd5 2018-02-12T17:00:00 revert the recent typecast assignment changes (see bug #4079) also change the void* typedefs for the two vulkan function pointers added in vulkan_internal.h into generic function pointer typedefs.
sezero ba0ecc67 2018-02-12T10:47:00 fix building SDL_audiotypecvt.c with gcc < 4.0
Sam Lantinga 90e72bf4 2018-01-30T18:08:34 Fixed ISO C99 compatibility SDL now builds with gcc 7.2 with the following command line options: -Wall -pedantic-errors -Wno-deprecated-declarations -Wno-overlength-strings --std=c99
Ryan C. Gordon 48882401 2018-01-22T09:36:40 wasapi: Fixed some compiler warnings.
Sam Lantinga e3cc5b2c 2018-01-03T10:03:25 Updated copyright for 2018
Ryan C. Gordon 77bb49b7 2017-12-31T03:34:16 wasapi: Patched to compile on non-UWP WinRT builds.
Ryan C. Gordon ab4695f4 2017-12-13T14:35:55 wasapi: switched to event-driven interface. This reduces latency and improves battery life.
Ryan C. Gordon 351d6d47 2017-12-06T12:24:32 audio: Port WASAPI to WinRT, remove XAudio2 backend. XAudio2 doesn't have capture support, so WASAPI was to replace it; the holdout was WinRT, which still needed it as its primary audio target until the WASAPI code code be made to work. The support matrix now looks like: WinXP: directsound by default, winmm as a fallback for buggy drivers. Vista+: WASAPI (directsound and winmm as fallbacks for debugging). WinRT: WASAPI
Sam Lantinga e830ef34 2017-10-20T16:53:42 Fixed typo converting 4 channel audio to 2 channel
Sam Lantinga 9a291c1e 2017-10-20T14:51:22 Added a note about adjusting channel weights when converting to fewer channels
Ryan C. Gordon 72932906 2017-10-19T18:05:42 audio: Added SDL_AudioStreamFlush().
Ryan C. Gordon e98920f5 2017-10-18T23:49:46 Check correct variable for malloc() results.
Sam Lantinga afefcbfe 2017-10-18T19:30:47 Fixed bug 3876 - Resampling of certain sounds adds heavy distortion Simon Hug Patch that adds [-1, 1] clamping to the scalar audio type conversions. This may come from the SDL_Convert_F32_to_X_Scalar functions. They don't clamp the float value to [-1, 1] and when they cast it to the target integer it may be too large or too small for the type and get truncated, causing horrible noise. The attached patch throws clamping in, but I don't know if that's the preferred way to fix this. For x86 (without SSE) the compiler (I tested MSVC) seems to throw a horrible amount of x87 code in it. It's a bit better with SSE, but probably still quite the performance hit. And SSE2 uses a branchless approach with maxss and minss.
Sam Lantinga 653ab5d9 2017-10-18T19:26:36 Added a staging buffer to the audio stream so that we can accumulate small amounts of data if needed when resampling
Sam Lantinga 80f8464d 2017-10-18T15:54:05 Added audio stream conversion functions: SDL_NewAudioStream SDL_AudioStreamPut SDL_AudioStreamGet SDL_AudioStreamAvailable SDL_AudioStreamClear SDL_FreeAudioStream
Ryan C. Gordon fa156741 2017-10-13T01:15:29 coreaudio: changed device close procedure to prevent long hangs in some cases. The audioqueue thread needs to keep running, and processing the CFRunLoop until the AudioQueue is disposed of, otherwise CoreAudio will hang waiting for final data to feed the device. At least, I think this is how it all works. It definitely fixes the bug here! Since AudioQueueDispose() calls AudioQueueStop() internally, there's no need for our thread to handle this, either, which is good because the AudioQueue would be disposed by this point. So now the AudioQueue is disposed first, and then our thread is joined, and everything works out okay. Just in case, we mark the device "paused" before setting everything in motion, so any further callbacks from CoreAudio will write silence and not fire the app's audio callback again. Fixes Bugzilla #3868.
Sam Lantinga ba10d2b6 2017-10-12T13:55:35 Fixed compiler warning
Ryan C. Gordon 5e5f2290 2017-10-11T12:07:43 audio: Turns out the accumulation errors sound better. :/ Moving to double fixed the overflows, but using "time = i * incr" instead of "time += incr" causes clicks in the output.
Ryan C. Gordon 9bd2c6b4 2017-10-11T11:51:14 audio: Moved the resampler state up to double precision. Fixes more buffer overflows.
Ryan C. Gordon b2f5123b 2017-10-11T11:43:35 audio: calculate resampling time directly, don't increment (thanks, Eric!). Fixes buffer overruns as floating point errors accumulate. Partially fixes Bugzilla #3848.
Ryan C. Gordon 763c3871 2017-10-11T02:33:55 audio: clamp resampler interpolation values to prevent buffer overflow. Partially fixes Bugzilla #3848.
Ryan C. Gordon 0085f917 2017-10-11T02:31:58 audio: Moved unchanging variable out of loop.
Ryan C. Gordon cb8bf6bb 2017-10-11T02:03:05 audio: Make sure audio stream resampling doesn't overflow buffers.
Ryan C. Gordon 459e2b0b 2017-10-11T01:37:11 audio: Fixed check for minimum audio stream put size.
Ryan C. Gordon 903ff641 2017-10-10T22:31:02 audio: SDL_ResampleCVT() should use memmove instead of memcpy. This copy can overlap. Fixes Bugzilla #3849.
Ryan C. Gordon 42fff7ce 2017-10-10T22:18:46 audio: Don't stack-allocate resampler padding. (I thought padding size ranged from 5 frames to ~30 frames (based around RESAMPLER_ZERO_CROSSINGS, which is 5), but it's actually between 512 and several thousands (based on RESAMPLER_SAMPLES_PER_ZERO_CROSSING)). It gets big fast when downsampling.
Ryan C. Gordon 37d89aa1 2017-10-10T16:12:56 audio: reworked audio streams to have right-hand resampling padding available. Fixes Bugzilla #3851.
Ryan C. Gordon 099ae43e 2017-09-22T22:28:21 audio: Fixed compiler warning on Visual Studio.
Sam Lantinga fe6b8f1c 2017-09-22T11:25:52 Fixed Mac OS X build
Sam Lantinga 407e1693 2017-09-22T11:15:14 Fixed audio being silent on older iOS devices Tested on an iPod running iOS 6.1
Sam Lantinga d74c00e6 2017-09-22T08:51:45 Fixed memory leak when HAVE_ALLOCA isn't defined
Ryan C. Gordon 6d206a7b 2017-09-22T07:42:24 audio: Stream resampling now saves some samples from previous run for padding. Previously, the padding was silence, which was a problem when streaming since you would sample a little bit of this silence between each buffer. We still need a means to get padding data for the right hand side, but this patch makes the resampler output more correct.
Sam Lantinga 8b660c50 2017-09-21T00:55:29 Added some missing "extern" declarations
Ryan C. Gordon 1a3b95a1 2017-09-21T02:51:14 audio: Replaced the resampler. Again. This time it's using real math from a real whitepaper instead of my previous amateur, fast-but-low-quality attempt. The new resampler does "bandlimited interpolation," as described here: https://ccrma.stanford.edu/~jos/resample/ The output appears to sound cleaner, especially at high frequencies, and of course works with non-power-of-two rate conversions. There are some obvious optimizations to be done to this still, and there is other fallout: this doesn't resample a buffer in-place, the 2-channels-Sint16 fast path is gone because this resampler does a _lot_ of floating point math. There is a nasty hack to make it work with SDL_AudioCVT. It's possible these issues are solvable, but they aren't solved as of yet. Still, I hope this effort is slouching in the right direction.
Ryan C. Gordon f40bd5ee 2017-09-21T02:06:53 audio: removed my perl experiment script.
Sam Lantinga c08a7a74 2017-09-15T17:27:32 Added a hint SDL_HINT_AUDIO_CATEGORY to control the audio category, determining whether the phone mute switch affects the audio
Ryan C. Gordon 93583d46 2017-09-09T21:17:46 alsa: removed snd_pcm_wait() call before writing to playback device. This would cause playback problems in certain situations, such as on the Raspberry Pi. The device that the wait was added for seems to not benefit from it in modern times, and standard desktop Linux seems to do the right thing when a USB device is unplugged now, without this patch. Fixes Bugzilla #3599.
Ryan C. Gordon ca15c7d6 2017-09-07T10:56:08 wave: SDL_LoadWAV now supports 24-bit audio.
Ryan C. Gordon 3267398d 2017-09-02T16:41:14 sndio: Patched to compile if SIO_DEVANY isn't defined. (It isn't in whatever Raspbian is currently shipping.)
Sam Lantinga d619d885 2017-08-28T21:42:39 Fixed bug 3662 - Error message when using the audio conversion setup without an initialized audio subsystem is a bit vague Simon Hug This issue actually raises the question if this API change (requirement of initialized audio subsystem) is breaking backwards compatibility. I don't see the documentation saying it is needed in 2.0.5.
Ryan C. Gordon b128e880 2017-08-29T00:41:45 audio: A whole bunch of improvements to audio conversion (thanks, Solra!). "Major changes, roughly in order of appearance: - Use float math everywhere, instead of promoting to double and casting back all the time. - Conserve sound energy when downmixing any channel into two other channels. - Add a QuadToStereo filter. (The previous technique of reusing StereoToMono never worked, since it assumed an incorrect channel layout for 4.0.) - Add a 71to51 filter. This removes just under half of the cases the previous code would silently break in. - Add a QuadTo51 filter. More silent breakage fixed. - Add a 51to71 filter, removing another almost-half of the silently broken cases. - Add 8 to the list of values SDL_SupportedChannelCount will accept. - Change SDL_BuildAudioCVT's channel-related logic to handle every case, and to actually fail if it fails instead of silently corrupting sound data and/or crashing down the road." (Note that SDL doesn't otherwise support 7.1 audio yet, but hopefully it will soon and the 7.1 converters are an important piece of that. --ryan.) Fixes Bugzilla #3727.
Ryan C. Gordon a0cd7d6b 2017-08-29T00:02:04 audio: Converting audio samples from int to float was using wrong equation. Fixes Bugzilla #3775.
Sam Lantinga 6dd3f55d 2017-08-28T01:59:53 Fixed WinRT build after changing the header guard preprocessor symbol
Sam Lantinga 0d011ec6 2017-08-28T00:22:23 Renaming of guard header names to quiet -Wreserved-id-macro
Sam Lantinga 8e7998e1 2017-08-27T19:10:30 Fixed bug 3710 - SDL_OpenAudio(desired, obtained) doesn't update desired's size when obtained is NULL David Ludwig I've created a new set of patches. I am happy to create more, if it would help. One version only copies 'size'. A second version copies both 'size' and 'silence'. When looking over the documentation for SDL_OpenAudio in SDL_audio.h, it mentioned that both 'size' and 'silence' were things that SDL_OpenAudio would calculate. Regarding *both* patches, I did notice that SDL 1.2 appears to have always modified desired's size and silence fields. The SDL wiki, at https://wiki.libsdl.org/SDL_OpenAudio#Remarks , does note:
Sam Lantinga bcf0e071 2017-08-18T17:29:44 Added WASAPI audio target to autoconf build process
Ryan C. Gordon e3e6b4fd 2017-08-18T16:52:19 audio: better docs on conversion APIs, error if not init'd (thanks, Simon!). Fixes Bugzilla #3662.
Sam Lantinga fb835f9e 2017-08-14T20:22:19 Fixed bug 2330 - Debian bug report: SDL2 X11 driver buffer overflow with large X11 file descriptor manuel.montezelo Original bug report (note that it was against 2.0.0, it might have been fixed in between): http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=733015 -------------------------------------------------------- Package: libsdl2-2.0-0 Version: 2.0.0+dfsg1-3 Severity: normal Tags: patch I have occasional crashes here caused by the X11 backend of SDL2. It seems to be caused by the X11_Pending function trying to add a high number (> 1024) file descriptor to a fd_set before doing a select on it to avoid busy waiting on X11 events. This causes a buffer overflow because the file descriptor is larger (or equal) than the limit FD_SETSIZE. Attached is a possible workaround patch. Please also keep in mind that fd_set are also used in following files which may have similar problems. src/audio/bsd/SDL_bsdaudio.c src/audio/paudio/SDL_paudio.c src/audio/qsa/SDL_qsa_audio.c src/audio/sun/SDL_sunaudio.c src/joystick/linux/SDL_sysjoystick.c -------------------------------------------------------- On Tuesday 24 December 2013 00:43:13 Sven Eckelmann wrote: > I have occasional crashes here caused by the X11 backend of SDL2. It seems > to be caused by the X11_Pending function trying to add a high number (> > 1024) file descriptor to a fd_set before doing a select on it to avoid busy > waiting on X11 events. This causes a buffer overflow because the file > descriptor is larger (or equal) than the limit FD_SETSIZE. I personally experienced this problem while hacking on the python bindings package for SDL2 [1] (while doing make runtest). But it easier to reproduce in a smaller, synthetic testcase.
Sam Lantinga 96305832 2017-08-11T10:21:19 Fixed bug 3702 - Clear error messages of SDL_LoadObject for optional libraries Simon Hug Some code in SDL loads libraries with SDL_LoadObject to get more information or use newer APIs. SDL_LoadObject may fail, set an error message and SDL will continue with some fallback code. Since SDL will overwrite the error or exit the function with a return value that indicates success, the error form SDL_LoadObject for the optional stuff might as well be cleared right away.
Ryan C. Gordon 9dde37ea 2017-08-07T00:25:18 sndio: Fix for some platforms (Linux, for example) that don't define INFTIM. Fixes Bugzilla #3712.
Ryan C. Gordon a09efc73 2017-08-04T16:18:34 psp: Force audio channels to stereo if > 2 channels requested (thanks, Solra!). Fixes Bugzilla #3726.
Philipp Wiesemann 68ca9d9e 2017-07-29T23:00:45 qnx: Fixed error message.
Philipp Wiesemann cea33bf5 2017-07-29T23:00:34 aix: Removed unused local variable. Found by Cppcheck.
Sam Lantinga 77ca0f27 2017-07-27T22:55:18 Fixed crash if the WASAPI audio device couldn't be recovered
Sam Lantinga 4a734209 2017-07-27T22:52:19 Fixed infinite recursion if the WASAPI audio device couldn't be recovered
Sam Lantinga f033ce61 2017-07-27T02:41:58 Fixed typo in WASAPI shutdown code
Ryan C. Gordon 03eaddca 2017-07-23T19:25:16 Fixed compiler warnings on QNX.
Ryan C. Gordon 8ac17a2a 2017-07-20T20:40:17 sndio: fixed poll() call (thanks, kdrakehp!). Fixes Bugzilla #3705.
Ryan C. Gordon ee9cc324 2017-07-20T18:16:02 sndio: More improvements to the OpenBSD audio target (thanks, kdrakehp!). Fixes Bugzilla #3705.
Sam Lantinga 2cc68064 2017-07-20T10:39:47 Fixed bug 3705 - Add capture support to the sndio backend kdrakehp The attached patch adds capture support to the sndio backend. The patch also allows the `OpenDevice' function to accept arbitrary device names.
Philipp Wiesemann fb9c2939 2017-07-07T23:00:10 qnx: Fixed setting a field twice.
Ryan C. Gordon 1683a0c1 2017-07-05T12:04:37 audio: trying to pacify static analysis.
Philipp Wiesemann 9f99b3d7 2017-07-02T22:46:49 aix: Fixed audio debug output. DEBUG_AUDIO is checked with #ifdef not #if.
Philipp Wiesemann 4366721b 2017-07-02T22:46:00 qnx: Removed unused bootstrap declaration. QNX_bootstrap is the VideoBootStrap. QSAAUDIO_bootstrap is still there.
Ryan C. Gordon 22241ed0 2017-07-01T17:50:47 Support for QNX 7.0 (thanks, Elad!). Fixes Bugzilla #3686.
Philipp Wiesemann 380e0693 2017-07-01T23:01:49 aix: Fixed compile error.
Philipp Wiesemann 4c190ce5 2017-07-01T23:00:07 netbsd: Fixed comment.
Philipp Wiesemann 4c48260c 2017-06-29T23:00:18 netbsd: Removed unused field.
Philipp Wiesemann 7bb6b402 2017-06-29T23:00:09 netbsd: Fixed compile error.
Ryan C. Gordon a509719f 2017-06-12T21:35:24 audio: Converter now checks a strict list of channels and formats we support.
Sam Lantinga 553b3286 2017-06-12T16:39:15 Fixed bug 3668 - Overflow of SDL_AudioCVT.filters with some downmixes Simon Hug There's a chance that an audio conversion from many channels to a few can use more than 9 audio filters. SDL_AudioCVT has 10 SDL_AudioFilter pointers of which one has to be the terminating NULL pointer. The SDL code has no checks for this limit. If it overflows there can be stack or heap corruption or a call to 0xa. Attached patch adds a function that checks for this limit and throws an error if it is reached. Also adds some documentation. Test parameters that trigger this issue: AUDIO_U16MSB with 224 channels at 46359 Hz V AUDIO_S16MSB with 6 channels at 27463 Hz The fuzzer program I uploaded in bug 3667 has more of them.