diff mbox series

[FFmpeg-devel,07/10] fftools/ffmpeg: do not assume input streams exist

Message ID 20221117101640.6789-7-anton@khirnov.net
State Accepted
Commit 005f4e1caf9c0f20a50ccf58fbcd4b6b26853c9f
Headers show
Series [FFmpeg-devel,01/10] fftools/ffmpeg: move freeing an input stream into a separate function | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Anton Khirnov Nov. 17, 2022, 10:16 a.m. UTC
There can be zero input streams, with input provided by lavfi complex
filtergraphs.
---
 fftools/ffmpeg.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 0944f56b80..c43c3ca3bc 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -3401,7 +3401,11 @@  static int check_keyboard_interaction(int64_t cur_time)
     if (key == 'd' || key == 'D'){
         int debug=0;
         if(key == 'D') {
-            debug = ist_iter(NULL)->dec_ctx->debug << 1;
+            InputStream *ist = ist_iter(NULL);
+
+            if (ist)
+                debug = ist->dec_ctx->debug << 1;
+
             if(!debug) debug = 1;
             while (debug & FF_DEBUG_DCT_COEFF) //unsupported, would just crash
                 debug += debug;