mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	stream: handle against zero length payload
Don't send empty payloads in pinospay
This commit is contained in:
		
							parent
							
								
									2d392c7410
								
							
						
					
					
						commit
						ccb93c9652
					
				
					 2 changed files with 15 additions and 11 deletions
				
			
		| 
						 | 
					@ -858,13 +858,15 @@ on_socket_condition (GSocket      *socket,
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      priv->buffer.size = need;
 | 
					      priv->buffer.size = need;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      /* read data */
 | 
					      if (hdr->length > 0) {
 | 
				
			||||||
      len = g_socket_receive (socket,
 | 
					        /* read data */
 | 
				
			||||||
                              (gchar *)priv->buffer.data + sizeof (PinosStackHeader),
 | 
					        len = g_socket_receive (socket,
 | 
				
			||||||
                              hdr->length,
 | 
					                                (gchar *)priv->buffer.data + sizeof (PinosStackHeader),
 | 
				
			||||||
                              NULL,
 | 
					                                hdr->length,
 | 
				
			||||||
                              &error);
 | 
					                                NULL,
 | 
				
			||||||
      g_assert (len == hdr->length);
 | 
					                                &error);
 | 
				
			||||||
 | 
					        g_assert (len == hdr->length);
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      /* handle control messages */
 | 
					      /* handle control messages */
 | 
				
			||||||
      for (i = 0; i < num_messages; i++) {
 | 
					      for (i = 0; i < num_messages; i++) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -375,10 +375,12 @@ gst_pinos_pay_chain_pinos (GstPinosPay *pay, GstBuffer * buffer)
 | 
				
			||||||
  gst_buffer_unmap (buffer, &info);
 | 
					  gst_buffer_unmap (buffer, &info);
 | 
				
			||||||
  pinos_buffer_clear (&pbuf);
 | 
					  pinos_buffer_clear (&pbuf);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  gst_mini_object_set_qdata (GST_MINI_OBJECT_CAST (buffer),
 | 
					  if (fdids->len > 0) {
 | 
				
			||||||
      fdids_quark, fdids, NULL);
 | 
					    gst_mini_object_set_qdata (GST_MINI_OBJECT_CAST (buffer),
 | 
				
			||||||
  gst_mini_object_weak_ref (GST_MINI_OBJECT_CAST (buffer),
 | 
					        fdids_quark, fdids, NULL);
 | 
				
			||||||
      (GstMiniObjectNotify) release_fds, pay);
 | 
					    gst_mini_object_weak_ref (GST_MINI_OBJECT_CAST (buffer),
 | 
				
			||||||
 | 
					        (GstMiniObjectNotify) release_fds, pay);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return gst_pad_push (pay->srcpad, buffer);
 | 
					  return gst_pad_push (pay->srcpad, buffer);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue