From c16fed2ad9da18d3173fbb56cd1dfc8e259d1dbb Mon Sep 17 00:00:00 2001 From: Pascal Buhler Date: Fri, 11 Jun 2010 08:36:33 +0200 Subject: [PATCH] rtph264depay: Exclude NALu size from payload length on truncated packets. https://bugzilla.gnome.org/show_bug.cgi?id=667846 --- gst/rtp/gstrtph264depay.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gst/rtp/gstrtph264depay.c b/gst/rtp/gstrtph264depay.c index 27b5d4b9f0..efe1725933 100644 --- a/gst/rtp/gstrtph264depay.c +++ b/gst/rtp/gstrtph264depay.c @@ -735,8 +735,9 @@ gst_rtp_h264_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf) */ nalu_size = (payload[0] << 8) | payload[1]; - if (nalu_size > payload_len) - nalu_size = payload_len; + /* dont include nalu_size */ + if (nalu_size > (payload_len - 2)) + nalu_size = payload_len - 2; outsize = nalu_size + sizeof (sync_bytes); outbuf = gst_buffer_new_and_alloc (outsize);