[FFmpeg-cvslog] ffmpeg: do not pass possibly undefined subtitles to sub2video_update

Marton Balint git at videolan.org
Sat Nov 30 05:14:02 CET 2013


ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Sat Nov 23 17:25:46 2013 +0100| [3e396ca8eda473d619ce5ffc1e01950c978194e8] | committer: Marton Balint

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 at passwd.hu>
Reviewed-by: Nicolas George <george at nsup.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3e396ca8eda473d619ce5ffc1e01950c978194e8
---

 ffmpeg.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 62a5487..bbd3019 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++) {



More information about the ffmpeg-cvslog mailing list