[FFmpeg-devel] [PATCH] ffplay: do not segfault on stream_open internal error

Peter Ross pross at xvid.org
Fri Apr 17 15:36:56 EEST 2020


is->ic is assigned by read_thread, but this may not have happened yet
when stream_open fails.
---
 fftools/ffplay.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fftools/ffplay.c b/fftools/ffplay.c
index 1beec54293..5530d2a396 100644
--- a/fftools/ffplay.c
+++ b/fftools/ffplay.c
@@ -1210,7 +1210,7 @@ static void stream_component_close(VideoState *is, int stream_index)
     AVFormatContext *ic = is->ic;
     AVCodecParameters *codecpar;
 
-    if (stream_index < 0 || stream_index >= ic->nb_streams)
+    if (!ic || stream_index < 0 || stream_index >= ic->nb_streams)
         return;
     codecpar = ic->streams[stream_index]->codecpar;
 
-- 
2.20.1

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20200417/539ea607/attachment.sig>


More information about the ffmpeg-devel mailing list