From e4f40ba5262163efa5d7a88418d9e651fee7d733 Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Fri, 23 Apr 2021 01:19:21 +0200 Subject: [PATCH] mpegtspacketizer: handle "packetizing" already packetized data .. when the section didn't have a packetizer. This can happen as a result of building a new section from a copy of the original data of another section. Part-of: --- .../gst-plugins-bad/gst-libs/gst/mpegts/gstmpegtssection.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gstmpegtssection.c b/subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gstmpegtssection.c index 04e85bce45..6bc691c29e 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gstmpegtssection.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/mpegts/gstmpegtssection.c @@ -1296,7 +1296,6 @@ gst_mpegts_section_packetize (GstMpegtsSection * section, gsize * output_size) guint8 *crc; g_return_val_if_fail (section != NULL, NULL); g_return_val_if_fail (output_size != NULL, NULL); - g_return_val_if_fail (section->packetizer != NULL, NULL); /* Section data has already been packetized */ if (section->data) { @@ -1304,6 +1303,8 @@ gst_mpegts_section_packetize (GstMpegtsSection * section, gsize * output_size) return section->data; } + g_return_val_if_fail (section->packetizer != NULL, NULL); + if (!section->packetizer (section)) return NULL;