summaryrefslogtreecommitdiff
path: root/libavformat/mpegts.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/mpegts.c')
-rw-r--r--libavformat/mpegts.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 58902527c5..0415ceea02 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -1725,6 +1725,13 @@ static void scte_data_cb(MpegTSFilter *filter, const uint8_t *section,
if (idx < 0)
return;
+ /**
+ * In case we receive an SCTE-35 packet before mpegts context is fully
+ * initialized.
+ */
+ if (!ts->pkt)
+ return;
+
new_data_packet(section, section_len, ts->pkt);
ts->pkt->stream_index = idx;
prg = av_find_program_from_stream(ts->stream, NULL, idx);