|
| 1 | +From bdff780fe9733b520f48ff7642afdf877a3a0b26 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Xabier Rodriguez Calvar < [email protected]> |
| 3 | +Date: Mon, 8 May 2023 16:55:26 +0200 |
| 4 | +Subject: [PATCH] qtdemux: Fix critical message on cenc sample grouping parsing |
| 5 | + |
| 6 | +Inside qtdemux_parse_sbgp there is already a check to ensure the fragment group |
| 7 | +properties are not null but it is being hit in some examples and it is better to |
| 8 | +directly avoid the critical. |
| 9 | + |
| 10 | +Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4576> |
| 11 | +--- |
| 12 | + .../gst-plugins-good/gst/isomp4/qtdemux.c | 27 ++++++++++--------- |
| 13 | + 1 file changed, 15 insertions(+), 12 deletions(-) |
| 14 | + |
| 15 | +diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c |
| 16 | +index 8da64c9c8c..d42d37d703 100644 |
| 17 | +--- a/gst/isomp4/qtdemux.c |
| 18 | ++++ b/gst/isomp4/qtdemux.c |
| 19 | +@@ -4444,8 +4444,8 @@ qtdemux_parse_moof (GstQTDemux * qtdemux, const guint8 * buffer, guint length, |
| 20 | + && (stream->protection_scheme_type == FOURCC_cenc |
| 21 | + || stream->protection_scheme_type == FOURCC_cbcs)) { |
| 22 | + QtDemuxCencSampleSetInfo *info = stream->protection_scheme_info; |
| 23 | +- GNode *sbgp_node, *sgpd_node; |
| 24 | +- GstByteReader sgpd_data, sbgp_data; |
| 25 | ++ GNode *sgpd_node; |
| 26 | ++ GstByteReader sgpd_data; |
| 27 | + |
| 28 | + if (info->fragment_group_properties) { |
| 29 | + g_ptr_array_free (info->fragment_group_properties, TRUE); |
| 30 | +@@ -4471,17 +4471,20 @@ qtdemux_parse_moof (GstQTDemux * qtdemux, const guint8 * buffer, guint length, |
| 31 | + FOURCC_sgpd, &sgpd_data); |
| 32 | + } |
| 33 | + |
| 34 | +- sbgp_node = qtdemux_tree_get_child_by_type_full (traf_node, FOURCC_sbgp, |
| 35 | +- &sbgp_data); |
| 36 | +- while (sbgp_node) { |
| 37 | +- if (qtdemux_parse_sbgp (qtdemux, stream, &sbgp_data, FOURCC_seig, |
| 38 | +- &info->sample_to_group_map, info->default_properties, |
| 39 | +- info->track_group_properties, |
| 40 | +- info->fragment_group_properties)) { |
| 41 | +- break; |
| 42 | ++ if (info->fragment_group_properties) { |
| 43 | ++ GstByteReader sbgp_data; |
| 44 | ++ GNode *sbgp_node = qtdemux_tree_get_child_by_type_full (traf_node, |
| 45 | ++ FOURCC_sbgp, &sbgp_data); |
| 46 | ++ while (sbgp_node) { |
| 47 | ++ if (qtdemux_parse_sbgp (qtdemux, stream, &sbgp_data, FOURCC_seig, |
| 48 | ++ &info->sample_to_group_map, info->default_properties, |
| 49 | ++ info->track_group_properties, |
| 50 | ++ info->fragment_group_properties)) { |
| 51 | ++ break; |
| 52 | ++ } |
| 53 | ++ sbgp_node = qtdemux_tree_get_sibling_by_type_full (sbgp_node, |
| 54 | ++ FOURCC_sgpd, &sbgp_data); |
| 55 | + } |
| 56 | +- sbgp_node = qtdemux_tree_get_sibling_by_type_full (sbgp_node, |
| 57 | +- FOURCC_sgpd, &sbgp_data); |
| 58 | + } |
| 59 | + } |
| 60 | + |
| 61 | +-- |
| 62 | +2.39.2 |
| 63 | + |
0 commit comments