mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	pipewire: rtsp-client: use offsetof()
				
					
				
			Use `offsetof()` instead of `sizeof()` to correctly determine the offset of the flexible array member.
This commit is contained in:
		
							parent
							
								
									11e0492f79
								
							
						
					
					
						commit
						08c7c7999b
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -576,7 +576,7 @@ int pw_rtsp_client_url_send(struct pw_rtsp_client *client, const char *url,
 | 
			
		|||
	if ((f = open_memstream((char**)&msg, &len)) == NULL)
 | 
			
		||||
		return -errno;
 | 
			
		||||
 | 
			
		||||
	fseek(f, sizeof(*msg), SEEK_SET);
 | 
			
		||||
	fseek(f, offsetof(struct message, data), SEEK_SET);
 | 
			
		||||
 | 
			
		||||
	cseq = ++client->cseq;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -598,7 +598,7 @@ int pw_rtsp_client_url_send(struct pw_rtsp_client *client, const char *url,
 | 
			
		|||
 | 
			
		||||
	fclose(f);
 | 
			
		||||
 | 
			
		||||
	msg->len = len - sizeof(*msg);
 | 
			
		||||
	msg->len = len - offsetof(struct message, data);
 | 
			
		||||
	msg->offset = 0;
 | 
			
		||||
	msg->reply = reply;
 | 
			
		||||
	msg->user_data = user_data;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue