Ignore:
Timestamp:
Apr 19, 2025, 8:08:37 PM (6 months ago)
Author:
David Azarewicz
Message:

Merge in changes from 6.6-LTS branch.
Fixed additional 25+ problems.

Location:
GPL/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk

  • GPL/trunk/alsa-kernel/synth/emux/emux.c

    r717 r772  
    133133int snd_emux_free(struct snd_emux *emu)
    134134{
    135         unsigned long flags;
    136 
    137135        if (! emu)
    138136                return -EINVAL;
    139137
    140         spin_lock_irqsave(&emu->voice_lock, flags);
    141         if (emu->timer_active)
    142                 del_timer(&emu->tlist);
    143         spin_unlock_irqrestore(&emu->voice_lock, flags);
     138        timer_shutdown_sync(&emu->tlist);
    144139
    145140        snd_emux_proc_free(emu);
  • GPL/trunk/alsa-kernel/synth/emux/emux_nrpn.c

    r703 r772  
    350350                    int param)
    351351{
     352        if (param >= ARRAY_SIZE(chan->control))
     353                return -EINVAL;
     354
    352355        return send_converted_effect(xg_effects, ARRAY_SIZE(xg_effects),
    353356                                     port, chan, param,
  • GPL/trunk/alsa-kernel/synth/emux/emux_synth.c

    r679 r772  
    849849        /* 0xe000: root pitch */
    850850        offset += 0xe000 + vp->reg.rate_offset;
    851         offset += vp->emu->pitch_shift;
     851        if (vp->emu->ops.get_pitch_shift)
     852                offset += vp->emu->ops.get_pitch_shift(vp->emu);
    852853        LIMITVALUE(offset, 0, 0xffff);
    853854        if (offset == vp->apitch)
  • GPL/trunk/alsa-kernel/synth/emux/soundfont.c

    r703 r772  
    704704        struct soundfont_sample_info sample_info;
    705705        struct snd_sf_sample *sp;
    706         long off;
    707706
    708707        /* patch must be opened */
     
    714713                return -EINVAL;
    715714
     715        if (count < (long)sizeof(sample_info)) {
     716                return -EINVAL;
     717        }
    716718        if (copy_from_user(&sample_info, data, sizeof(sample_info)))
    717719                return -EFAULT;
    718 
    719         off = sizeof(sample_info);
    720 
    721         if (sample_info.size != (count-off)/2)
     720        data += sizeof(sample_info);
     721        count -= sizeof(sample_info);
     722
     723        // SoundFont uses S16LE samples.
     724        if (sample_info.size * 2 != count)
    722725                return -EINVAL;
    723726
     
    747750                rc = sflist->callback.sample_new
    748751                        (sflist->callback.private_data, sp, sflist->memhdr,
    749                          data + off, count - off);
     752                         data, count);
    750753                if (rc < 0) {
    751754                        sf_sample_delete(sflist, sf, sp);
     
    960963        if (copy_from_user(&patch, data, sizeof(patch)))
    961964                return -EFAULT;
    962        
    963965        count -= sizeof(patch);
    964966        data += sizeof(patch);
     967
     968        if ((patch.len << (patch.mode & WAVE_16_BITS ? 1 : 0)) != count)
     969                return -EINVAL;
    965970
    966971        sf = newsf(sflist, SNDRV_SFNT_PAT_TYPE_GUS|SNDRV_SFNT_PAT_SHARED, NULL);
Note: See TracChangeset for help on using the changeset viewer.