mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	rawmidi_virt: fix hang on invalid MIDI data
When writing invalid MIDI data to a virtual rawmidi port, snd_rawmidi_virtual_write() would forget to remove that data from the input buffer before continuing, resulting in an infinite loop.
This commit is contained in:
		
							parent
							
								
									8003e03b50
								
							
						
					
					
						commit
						e3f57ccc90
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -206,11 +206,11 @@ static ssize_t snd_rawmidi_virtual_write(snd_rawmidi_t *rmidi, const void *buffe
 | 
			
		|||
		size1 = snd_midi_event_encode(virt->midi_event, buffer, size, &virt->out_event);
 | 
			
		||||
		if (size1 <= 0)
 | 
			
		||||
			break;
 | 
			
		||||
		if (virt->out_event.type == SND_SEQ_EVENT_NONE)
 | 
			
		||||
			continue;
 | 
			
		||||
		size -= size1;
 | 
			
		||||
		result += size1;
 | 
			
		||||
		buffer += size1;
 | 
			
		||||
		if (virt->out_event.type == SND_SEQ_EVENT_NONE)
 | 
			
		||||
			continue;
 | 
			
		||||
		snd_seq_ev_set_subs(&virt->out_event);
 | 
			
		||||
		snd_seq_ev_set_source(&virt->out_event, virt->port);
 | 
			
		||||
		snd_seq_ev_set_direct(&virt->out_event);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue