diff options
author | Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> | 2014-05-02 15:09:35 +0100 |
---|---|---|
committer | Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> | 2014-05-02 15:10:07 +0100 |
commit | db8460cbd8e6c64a7683af754929966ca2091f98 (patch) | |
tree | b93f56a134f0be361f4cfaf581e2e0ed603c4af0 /gst-libs/gst/rtp | |
parent | 5ac9476b40b45b2191716f47a15ae2123eab6107 (diff) |
rtpbuffer: avoid underflow in size calculation
Diffstat (limited to 'gst-libs/gst/rtp')
-rw-r--r-- | gst-libs/gst/rtp/gstrtpbuffer.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gst-libs/gst/rtp/gstrtpbuffer.c b/gst-libs/gst/rtp/gstrtpbuffer.c index f3fd4f4b8..6ff9256ab 100644 --- a/gst-libs/gst/rtp/gstrtpbuffer.c +++ b/gst-libs/gst/rtp/gstrtpbuffer.c @@ -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; } |