rtpbuffer: avoid underflow in size calculation

This commit is contained in:
Vincent Penquerc'h 2014-05-02 15:09:35 +01:00
parent 5ac9476b40
commit db8460cbd8

View file

@ -294,6 +294,10 @@ gst_rtp_buffer_calc_payload_len (guint packet_len, guint8 pad_len,
{
g_return_val_if_fail (csrc_count <= 15, 0);
if (packet_len <
GST_RTP_HEADER_LEN + (csrc_count * sizeof (guint32)) + pad_len)
return 0;
return packet_len - GST_RTP_HEADER_LEN - (csrc_count * sizeof (guint32))
- pad_len;
}