linux/sound/synth/emux
Oswald Buddenhagen de67aab120 ALSA: emux: centralize & improve patch info validation
This does several closely related things:
- Move the code from the drivers into the SoundFont loader, which
  de-duplicates it.
- Sort of explain the weird "recalculate address offset" feature. Note
  that I don't think it actually makes any sense - the calling user
  space code should do that. The background is certainly that the source
  data (the SoundFont format) uses pointers into a single wave block
  (and the API allows doing the same for on-board ROM), but the API
  expects the wave data from user space to be pre-chopped into
  individual patches anyway.
- Make sure that the specified offsets actually lie within the supplied
  wave data. Note that we don't validate ROM offsets, so one can play
  back anything within the sound card's address space.
- In load_guspatch(), don't call the sample_new callback anymore when
  the patch size is zero, as was already the case in load_data(). The
  callbacks would instantly return in that case anyway; these checks are
  now removed.

Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Message-ID: <20240406064830.1029573-7-oswald.buddenhagen@gmx.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2024-04-07 08:35:47 +02:00
..
emux_effect.c ALSA: synth: Fix assignment in if condition 2021-06-09 17:30:35 +02:00
emux_hwdep.c ALSA: emux: prune unused parameter from snd_soundfont_load_guspatch() 2024-04-07 08:35:45 +02:00
emux_nrpn.c ALSA: emux: Avoid potential array out-of-bound in snd_emux_xg_control() 2023-02-07 14:32:33 +01:00
emux_oss.c ALSA: emux: prune unused parameter from snd_soundfont_load_guspatch() 2024-04-07 08:35:45 +02:00
emux_proc.c ALSA: emux: fix /proc teardown at module unload 2024-04-07 08:35:44 +02:00
emux_seq.c ALSA: emux: fix validation of snd_emux.num_ports 2024-04-07 08:35:46 +02:00
emux_synth.c ALSA: emu10k1: fix synthesizer pitch for E-MU cards at 44.1 kHz 2023-06-13 07:42:08 +02:00
emux_voice.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
emux.c ALSA: synth: Save a few bytes of memory when registering a 'snd_emux' 2024-01-22 13:04:22 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
soundfont.c ALSA: emux: centralize & improve patch info validation 2024-04-07 08:35:47 +02:00