| 4c4cbe66 | 06-Apr-2024 |
Oswald Buddenhagen <[email protected]> |
ALSA: emux: simplify snd_sf_list.callback handling
Both drivers provide both sample_new and sample_free, and it makes no sense to pretend that they could not. In fact, load_data() would already cras
ALSA: emux: simplify snd_sf_list.callback handling
Both drivers provide both sample_new and sample_free, and it makes no sense to pretend that they could not. In fact, load_data() would already crash if sample_new was null. So remove the remaining null checks.
Contrary to that, the emu10k1 driver actually has a null sample_reset, though I'm not convinced that this inconsistency is justified.
Signed-off-by: Oswald Buddenhagen <[email protected]> Message-ID: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
show more ...
|
| 89b32ccb | 06-Apr-2024 |
Oswald Buddenhagen <[email protected]> |
ALSA: emux: improve patch ioctl data validation
In load_data(), make the validation of and skipping over the main info block match that in load_guspatch().
In load_guspatch(), add checking that the
ALSA: emux: improve patch ioctl data validation
In load_data(), make the validation of and skipping over the main info block match that in load_guspatch().
In load_guspatch(), add checking that the specified patch length matches the actually supplied data, like load_data() already did.
Signed-off-by: Oswald Buddenhagen <[email protected]> Message-ID: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
show more ...
|
| de67aab1 | 06-Apr-2024 |
Oswald Buddenhagen <[email protected]> |
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 expla
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 <[email protected]> Message-ID: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
show more ...
|
| 877d1e81 | 06-Apr-2024 |
Oswald Buddenhagen <[email protected]> |
ALSA: emux: fix init of patch_info.truesize in load_data()
The field is explicitly documented to be initialized by the driver (which it actually is). Also, using patch_info.size would be actually wr
ALSA: emux: fix init of patch_info.truesize in load_data()
The field is explicitly documented to be initialized by the driver (which it actually is). Also, using patch_info.size would be actually wrong for 16-bit data, as one field counts samples, while the other counts bytes.
load_guspatch() already did it right.
Signed-off-by: Oswald Buddenhagen <[email protected]> Message-ID: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
show more ...
|
| 3f3e0dfc | 06-Apr-2024 |
Oswald Buddenhagen <[email protected]> |
ALSA: emux: prune unused parameter from snd_soundfont_load_guspatch()
The `client` parameter was not used, so eliminate it from the call chain.
Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen
ALSA: emux: prune unused parameter from snd_soundfont_load_guspatch()
The `client` parameter was not used, so eliminate it from the call chain.
Signed-off-by: Oswald Buddenhagen <[email protected]> Message-ID: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
show more ...
|