mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	Fix some possible-NULL pointer usage.
This commit is contained in:
		
							parent
							
								
									0a30eb6329
								
							
						
					
					
						commit
						86fd6a0d3e
					
				
					 3 changed files with 27 additions and 19 deletions
				
			
		| 
						 | 
				
			
			@ -2382,7 +2382,7 @@ jack_client_t * jack_client_open (const char *client_name,
 | 
			
		|||
 | 
			
		||||
	client = calloc(1, sizeof(struct client));
 | 
			
		||||
	if (client == NULL)
 | 
			
		||||
		goto init_failed;
 | 
			
		||||
		goto disabled;
 | 
			
		||||
 | 
			
		||||
	pw_log_debug(NAME" %p: open '%s' options:%d", client, client_name, options);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -738,11 +738,13 @@ static void session_event_info(void *object, const struct pw_session_info *info)
 | 
			
		|||
		i->version = PW_VERSION_SESSION_INFO;
 | 
			
		||||
		i->id = info->id;
 | 
			
		||||
        }
 | 
			
		||||
	i->change_mask = info->change_mask;
 | 
			
		||||
	if (info->change_mask & PW_SESSION_CHANGE_MASK_PROPS) {
 | 
			
		||||
		if (i->props)
 | 
			
		||||
			pw_properties_free ((struct pw_properties *)i->props);
 | 
			
		||||
		i->props = (struct spa_dict *) pw_properties_new_dict (info->props);
 | 
			
		||||
	if (info) {
 | 
			
		||||
		i->change_mask = info->change_mask;
 | 
			
		||||
		if (info->change_mask & PW_SESSION_CHANGE_MASK_PROPS) {
 | 
			
		||||
			if (i->props)
 | 
			
		||||
				pw_properties_free ((struct pw_properties *)i->props);
 | 
			
		||||
			i->props = (struct spa_dict *) pw_properties_new_dict (info->props);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	sess->obj.avail |= SM_SESSION_CHANGE_MASK_INFO;
 | 
			
		||||
| 
						 | 
				
			
			@ -813,16 +815,18 @@ static void endpoint_event_info(void *object, const struct pw_endpoint_info *inf
 | 
			
		|||
		i->direction = info->direction;
 | 
			
		||||
		i->flags = info->flags;
 | 
			
		||||
        }
 | 
			
		||||
	i->change_mask = info->change_mask;
 | 
			
		||||
	if (info->change_mask & PW_ENDPOINT_CHANGE_MASK_SESSION) {
 | 
			
		||||
		i->session_id = info->session_id;
 | 
			
		||||
	}
 | 
			
		||||
	if (info->change_mask & PW_ENDPOINT_CHANGE_MASK_PROPS) {
 | 
			
		||||
		if (i->props)
 | 
			
		||||
			pw_properties_free ((struct pw_properties *)i->props);
 | 
			
		||||
		i->props = (struct spa_dict *) pw_properties_new_dict (info->props);
 | 
			
		||||
		if ((str = spa_dict_lookup(i->props, PW_KEY_PRIORITY_SESSION)) != NULL)
 | 
			
		||||
			endpoint->priority = pw_properties_parse_int(str);
 | 
			
		||||
	if (info) {
 | 
			
		||||
		i->change_mask = info->change_mask;
 | 
			
		||||
		if (info->change_mask & PW_ENDPOINT_CHANGE_MASK_SESSION) {
 | 
			
		||||
			i->session_id = info->session_id;
 | 
			
		||||
		}
 | 
			
		||||
		if (info->change_mask & PW_ENDPOINT_CHANGE_MASK_PROPS) {
 | 
			
		||||
			if (i->props)
 | 
			
		||||
				pw_properties_free ((struct pw_properties *)i->props);
 | 
			
		||||
			i->props = (struct spa_dict *) pw_properties_new_dict (info->props);
 | 
			
		||||
			if ((str = spa_dict_lookup(i->props, PW_KEY_PRIORITY_SESSION)) != NULL)
 | 
			
		||||
				endpoint->priority = pw_properties_parse_int(str);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	endpoint->obj.avail |= SM_ENDPOINT_CHANGE_MASK_INFO;
 | 
			
		||||
| 
						 | 
				
			
			@ -907,7 +911,9 @@ static void endpoint_stream_event_info(void *object, const struct pw_endpoint_st
 | 
			
		|||
		stream->info->endpoint_id = info->endpoint_id;
 | 
			
		||||
		stream->info->name = info->name ? strdup(info->name) : NULL;
 | 
			
		||||
        }
 | 
			
		||||
	stream->info->change_mask = info->change_mask;
 | 
			
		||||
	if (info) {
 | 
			
		||||
		stream->info->change_mask = info->change_mask;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	stream->obj.avail |= SM_ENDPOINT_CHANGE_MASK_INFO;
 | 
			
		||||
	stream->obj.changed |= SM_ENDPOINT_CHANGE_MASK_INFO;
 | 
			
		||||
| 
						 | 
				
			
			@ -984,7 +990,9 @@ static void endpoint_link_event_info(void *object, const struct pw_endpoint_link
 | 
			
		|||
		link->info->input_endpoint_id = info->input_endpoint_id;
 | 
			
		||||
		link->info->input_stream_id = info->input_stream_id;
 | 
			
		||||
	}
 | 
			
		||||
	link->info->change_mask = info->change_mask;
 | 
			
		||||
	if (info) {
 | 
			
		||||
		link->info->change_mask = info->change_mask;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	link->obj.avail |= SM_ENDPOINT_LINK_CHANGE_MASK_INFO;
 | 
			
		||||
	link->obj.changed |= SM_ENDPOINT_LINK_CHANGE_MASK_INFO;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -387,7 +387,7 @@ handle_video_fields (ConvertData *d)
 | 
			
		|||
  }
 | 
			
		||||
  value = gst_structure_get_value (d->cs, "width");
 | 
			
		||||
  value2 = gst_structure_get_value (d->cs, "height");
 | 
			
		||||
  if (value || value2) {
 | 
			
		||||
  if (value && value2) {
 | 
			
		||||
    struct spa_rectangle v;
 | 
			
		||||
    for (i = 0; get_nth_rectangle (value, value2, i, &v); i++) {
 | 
			
		||||
      if (i == 0) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue