mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-27 01:28:34 +00:00
rtph264pay: Protect against use of reserved NAL types
Don't allow external encoder to use one of the reserved NAL type implicated in NAL aggreation. These out-of-spec NAL types, if passed from the outside world will lead to an invalid RTP payload being created.
This commit is contained in:
parent
7aebe60809
commit
13278fbcf5
1 changed files with 14 additions and 0 deletions
|
@ -806,6 +806,20 @@ gst_rtp_h264_pay_payload_nal (GstRTPBasePayload * basepayload,
|
||||||
gst_buffer_extract (paybuf, 0, &nalHeader, 1);
|
gst_buffer_extract (paybuf, 0, &nalHeader, 1);
|
||||||
nalType = nalHeader & 0x1f;
|
nalType = nalHeader & 0x1f;
|
||||||
|
|
||||||
|
/* These payload type are reserved for STAP-A, STAP-B, MTAP16, and MTAP24
|
||||||
|
* as internally used NAL types */
|
||||||
|
switch (nalType) {
|
||||||
|
case 24:
|
||||||
|
case 25:
|
||||||
|
case 26:
|
||||||
|
case 27:
|
||||||
|
GST_WARNING_OBJECT (rtph264pay, "Ignoring reserved NAL TYPE=%d", nalType);
|
||||||
|
gst_buffer_unref (paybuf);
|
||||||
|
return GST_FLOW_OK;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (rtph264pay, "Processing Buffer with NAL TYPE=%d", nalType);
|
GST_DEBUG_OBJECT (rtph264pay, "Processing Buffer with NAL TYPE=%d", nalType);
|
||||||
|
|
||||||
/* should set src caps before pushing stuff,
|
/* should set src caps before pushing stuff,
|
||||||
|
|
Loading…
Reference in a new issue