qtdemux: exit when protection caps are not defined during PIFF parsing

Reproduction testcase (uses PlayReady):
https://developers.canal-plus.com/rx-player/upc/?appTileLocation=[object%20Object]

In test streams we are using PIFF box, but caps did not had
present GST_PROTECTION_SYSTEM_ID_CAPS_FIELD. In consequence, invalid
system_id was returned which caused SIGSEGV crash.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3549>
This commit is contained in:
Jacek Skiba 2022-12-07 09:47:49 +01:00 committed by GStreamer Marge Bot
parent c44ed8af36
commit bd39e259e2

View file

@ -2790,8 +2790,13 @@ qtdemux_parse_piff (GstQTDemux * qtdemux, const guint8 * buffer, gint length,
return;
}
gst_structure_get (structure, GST_PROTECTION_SYSTEM_ID_CAPS_FIELD,
G_TYPE_STRING, &system_id, NULL);
if (!gst_structure_get (structure, GST_PROTECTION_SYSTEM_ID_CAPS_FIELD,
G_TYPE_STRING, &system_id, NULL)) {
GST_WARNING_OBJECT (qtdemux, "%s field not present in caps",
GST_PROTECTION_SYSTEM_ID_CAPS_FIELD);
return;
}
gst_qtdemux_append_protection_system_id (qtdemux, system_id);
stream->protected = TRUE;