summaryrefslogtreecommitdiff
path: root/gst/rtpvp8
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd@luon.net>2011-01-23 17:02:38 +0000
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2011-01-30 14:52:00 +0000
commit216189ea36d0c477ed771d229eb548e93acb0cc3 (patch)
treebbaa063811efc67126bfa064df88f8dfee4cb3f0 /gst/rtpvp8
parent0bee149c74a22ad9a08f46eebe25b5a88b7fb204 (diff)
rtpvp8depay: Accept packets with only one byte of data
When fragmenting partions it can happen that an RTP packet only caries 1 byte of RTP data.
Diffstat (limited to 'gst/rtpvp8')
-rw-r--r--gst/rtpvp8/gstrtpvp8depay.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gst/rtpvp8/gstrtpvp8depay.c b/gst/rtpvp8/gstrtpvp8depay.c
index 79eee5327..d9d222654 100644
--- a/gst/rtpvp8/gstrtpvp8depay.c
+++ b/gst/rtpvp8/gstrtpvp8depay.c
@@ -121,6 +121,7 @@ gst_rtp_vp8_depay_process (GstBaseRTPDepayload * depay, GstBuffer * buf)
self->started = FALSE;
}
+ /* At least one header and one vp8 byte */
if (G_UNLIKELY (size < 2))
goto too_small;
@@ -140,13 +141,13 @@ gst_rtp_vp8_depay_process (GstBaseRTPDepayload * depay, GstBuffer * buf)
for (; (data[offset] & 0x80) != 0; offset++) {
/* should be at least one more pictureID byte and at least one byte in
* the vp8 payload */
- if (offset + 2 >= size)
+ if (G_UNLIKELY (offset + 2 >= size))
goto too_small;
}
offset++;
}
- if (offset + 1 >= size)
+ if (G_UNLIKELY (offset >= size))
goto too_small;
payload = gst_rtp_buffer_get_payload_subbuffer (buf, offset, -1);