mirror of
				https://gitlab.freedesktop.org/wayland/wayland.git
				synced 2025-11-03 09:01:42 -05:00 
			
		
		
		
	shm: wl_shm_buffer_get_data() requires a valid pool.
There's no situation where a shm buffer without a pool makes sense, so we enforce the pool's existence a little more rigidly. Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
This commit is contained in:
		
							parent
							
								
									2aee2069a0
								
							
						
					
					
						commit
						8bc42fbf7b
					
				
					 1 changed files with 6 additions and 4 deletions
				
			
		| 
						 | 
					@ -353,10 +353,12 @@ wl_shm_buffer_get_stride(struct wl_shm_buffer *buffer)
 | 
				
			||||||
WL_EXPORT void *
 | 
					WL_EXPORT void *
 | 
				
			||||||
wl_shm_buffer_get_data(struct wl_shm_buffer *buffer)
 | 
					wl_shm_buffer_get_data(struct wl_shm_buffer *buffer)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	if (buffer->pool)
 | 
						assert(buffer->pool);
 | 
				
			||||||
		return buffer->pool->data + buffer->offset;
 | 
					
 | 
				
			||||||
	else
 | 
						if (!buffer->pool)
 | 
				
			||||||
		return buffer + 1;
 | 
							return NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return buffer->pool->data + buffer->offset;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
WL_EXPORT uint32_t
 | 
					WL_EXPORT uint32_t
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue