mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	stream: Fail on client submitting non-frame-aligned memblocks
If somebody tries to push a non-frame-aligned memblock onto the memblockq, then we should fail the write. Otherwise the daemon will crash, see https://bugs.freedesktop.org/show_bug.cgi?id=77595 Signed-off-by: David Henningsson <david.henningsson@canonical.com>
This commit is contained in:
		
							parent
							
								
									6434853b04
								
							
						
					
					
						commit
						150ace90f3
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		| 
						 | 
					@ -1487,6 +1487,8 @@ int pa_stream_write_ext_free(
 | 
				
			||||||
                      ((data >= s->write_data) &&
 | 
					                      ((data >= s->write_data) &&
 | 
				
			||||||
                       ((const char*) data + length <= (const char*) s->write_data + pa_memblock_get_length(s->write_memblock))),
 | 
					                       ((const char*) data + length <= (const char*) s->write_data + pa_memblock_get_length(s->write_memblock))),
 | 
				
			||||||
                      PA_ERR_INVALID);
 | 
					                      PA_ERR_INVALID);
 | 
				
			||||||
 | 
					    PA_CHECK_VALIDITY(s->context, offset % pa_frame_size(&s->sample_spec) == 0, PA_ERR_INVALID);
 | 
				
			||||||
 | 
					    PA_CHECK_VALIDITY(s->context, length % pa_frame_size(&s->sample_spec) == 0, PA_ERR_INVALID);
 | 
				
			||||||
    PA_CHECK_VALIDITY(s->context, !free_cb || !s->write_memblock, PA_ERR_INVALID);
 | 
					    PA_CHECK_VALIDITY(s->context, !free_cb || !s->write_memblock, PA_ERR_INVALID);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (s->write_memblock) {
 | 
					    if (s->write_memblock) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue