Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Delannoy <anthony.2lannoy@gmail.com>2019-09-03 18:54:24 +0300
committerMarton Balint <cus@passwd.hu>2019-09-03 22:56:07 +0300
commit611eb9594376433683282d86c4c00d3dfb572366 (patch)
tree11469e090b4446987366281f7ed458195e1e87a9 /libavformat/mpegts.c
parent0f8e2a0b8644fee69cfebe55bbb38e69289beba6 (diff)
avformat/mpegts: Check if ready on SCTE reception
On some DVB stream SCTE-35 data packet are available before the end of MpegTSContext initialization. We have to check if it is the case to avoid a SEGFAULT. Signed-off-by: Marton Balint <cus@passwd.hu> (cherry picked from commit 39f129593756e3e270ed3881ca076627f30e1eb7)
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);