[FFmpeg-devel] [PATCH 2/3] libavformat/demux.c: handle_new_packet() add null check

Scott Theisen scott.the.elm at gmail.com
Thu Nov 14 07:52:07 EET 2024


originally from:
https://github.com/MythTV/mythtv/commit/c94d503eaef122566e88af200d5079353faf856b
https://github.com/MythTV/mythtv/commit/3702a35152fc1e63c04fbc514b96dff21f8b3468
---
 libavformat/demux.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/demux.c b/libavformat/demux.c
index b4fa7f912d..de792ceb3f 100644
--- a/libavformat/demux.c
+++ b/libavformat/demux.c
@@ -588,6 +588,9 @@ static int handle_new_packet(AVFormatContext *s, AVPacket *pkt, int allow_passth
     st  = s->streams[pkt->stream_index];
     sti = ffstream(st);
 
+    if (!st)
+        return -1;
+
     update_timestamps(s, st, pkt);
 
     if (sti->request_probe <= 0 && allow_passthrough && !fci->raw_packet_buffer.head)
-- 
2.43.0



More information about the ffmpeg-devel mailing list