From 41be2b32d03b643d46a50c7e0bf925d2d1f8a36c Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Thu, 27 Mar 2008 15:26:38 +0000 Subject: [PATCH] gst/gdp/gstgdpdepay.c: Check the body CRC (if set) when depayloading. Original commit message from CVS: * gst/gdp/gstgdpdepay.c: (gst_gdp_depay_chain): Check the body CRC (if set) when depayloading. Fixes #522401. --- gst/gdp/gstgdpdepay.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gst/gdp/gstgdpdepay.c b/gst/gdp/gstgdpdepay.c index 16f6a76a91..1341b37792 100644 --- a/gst/gdp/gstgdpdepay.c +++ b/gst/gdp/gstgdpdepay.c @@ -287,6 +287,12 @@ gst_gdp_depay_chain (GstPad * pad, GstBuffer * buffer) } else { goto wrong_type; } + + if (!gst_dp_validate_payload (GST_DP_HEADER_LENGTH, this->header, + gst_adapter_peek (this->adapter, this->payload_length))) { + goto payload_validate_error; + } + break; } case GST_GDP_DEPAY_STATE_BUFFER: @@ -392,6 +398,13 @@ header_validate_error: ret = GST_FLOW_ERROR; goto done; } +payload_validate_error: + { + GST_ELEMENT_ERROR (this, STREAM, DECODE, (NULL), + ("GDP packet payload does not validate")); + ret = GST_FLOW_ERROR; + goto done; + } wrong_type: { GST_ELEMENT_ERROR (this, STREAM, DECODE, (NULL), -- 2.34.1