From 3e396ca8eda473d619ce5ffc1e01950c978194e8 Mon Sep 17 00:00:00 2001
From: Marton Balint <cus@passwd.hu>
Date: Sat, 23 Nov 2013 17:25:46 +0100
Subject: [PATCH] ffmpeg: do not pass possibly undefined subtitles to
 sub2video_update

It should not matter for real-life usage, it is just cleaner this way.

Signed-off-by: Marton Balint <cus@passwd.hu>
Reviewed-by: Nicolas George <george@nsup.org>
---
 ffmpeg.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 62a548761cf..bbd30190cbd 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1822,9 +1822,12 @@ static int transcode_subtitles(InputStream *ist, AVPacket *pkt, int *got_output)
         FFSWAP(AVSubtitle, subtitle,    ist->prev_sub.subtitle);
     }
 
+    if (!*got_output)
+        return ret;
+
     sub2video_update(ist, &subtitle);
 
-    if (!*got_output || !subtitle.num_rects)
+    if (!subtitle.num_rects)
         return ret;
 
     for (i = 0; i < nb_output_streams; i++) {
-- 
GitLab