mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 01:45:33 +00:00
rtmp2: guard against calling gst_amf_node_get_type() with NULL
gst_amf_node_get_type() raises a CRITICAL if called with a NULL node. All callers were checking for this except those. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7103>
This commit is contained in:
parent
84b3a0950d
commit
037d36f28d
1 changed files with 3 additions and 3 deletions
|
@ -903,7 +903,7 @@ gst_amf_node_parse (const guint8 * data, gsize size, guint8 ** endptr)
|
|||
GST_TRACE ("Starting parse with %" G_GSIZE_FORMAT " bytes", parser.size);
|
||||
|
||||
node = parse_value (&parser);
|
||||
if (gst_amf_node_get_type (node) == GST_AMF_TYPE_INVALID) {
|
||||
if (!node || gst_amf_node_get_type (node) == GST_AMF_TYPE_INVALID) {
|
||||
GST_ERROR ("invalid value");
|
||||
goto out;
|
||||
}
|
||||
|
@ -946,13 +946,13 @@ gst_amf_parse_command (const guint8 * data, gsize size,
|
|||
GST_TRACE ("Starting parse with %" G_GSIZE_FORMAT " bytes", parser.size);
|
||||
|
||||
node1 = parse_value (&parser);
|
||||
if (gst_amf_node_get_type (node1) != GST_AMF_TYPE_STRING) {
|
||||
if (!node1 || gst_amf_node_get_type (node1) != GST_AMF_TYPE_STRING) {
|
||||
GST_ERROR ("no command name");
|
||||
goto out;
|
||||
}
|
||||
|
||||
node2 = parse_value (&parser);
|
||||
if (gst_amf_node_get_type (node2) != GST_AMF_TYPE_NUMBER) {
|
||||
if (!node2 || gst_amf_node_get_type (node2) != GST_AMF_TYPE_NUMBER) {
|
||||
GST_ERROR ("no transaction ID");
|
||||
goto out;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue