From 43324194a81f1f33150fefac6336285ab95eb14f Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Date: Mon, 11 Jun 2018 01:44:24 +0200
Subject: [PATCH] ffplay: Don't crash if stream_cycle_channel() is called
before initialization.
SDL may send a keydown event before stream (and window) initialization is finished.
Fixes ticket #7252.
---
fftools/ffplay.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
@@ -3106,7 +3106,11 @@ static void stream_cycle_channel(VideoState *is, int codec_type)
int old_index;
AVStream *st;
AVProgram *p = NULL;
- int nb_streams = is->ic->nb_streams;
+ int nb_streams;
+
+ if (!is->ic)
+ return;
+ nb_streams = is->ic->nb_streams;
if (codec_type == AVMEDIA_TYPE_VIDEO) {
start_index = is->last_video_stream;
--
1.7.10.4