[FFmpeg-cvslog] lavc/ass_split: check for NULL pointer in ff_ass_split_override_codes().

Clément Bœsch git at videolan.org
Tue Jan 1 18:34:46 CET 2013


ffmpeg | branch: release/0.10 | Clément Bœsch <ubitux at gmail.com> | Sun Dec 30 06:53:48 2012 +0100| [c3d7c805bc9c1ed584e92649cd8fa8cbb7010967] | committer: Carl Eugen Hoyos

lavc/ass_split: check for NULL pointer in ff_ass_split_override_codes().

This is consistent with the other ff_ass_split_* functions.

It also fixes a crash when trying to split a dialog with text=NULL
(which seems to happen when the text of the dialog is empty); basically,
this commit fixes crashes when trying to encode an empty text subtitle
dialog (see subrip and mov_text encoders).

Fixes Ticket2048.
(cherry picked from commit c83002a4f8042ccfa0688a9a18e8fa0369c1fda8)

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

 libavcodec/ass_split.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/ass_split.c b/libavcodec/ass_split.c
index 2a3b764..33c1c27 100644
--- a/libavcodec/ass_split.c
+++ b/libavcodec/ass_split.c
@@ -366,7 +366,7 @@ int ff_ass_split_override_codes(const ASSCodesCallbacks *callbacks, void *priv,
     char new_line[2];
     int text_len = 0;
 
-    while (*buf) {
+    while (buf && *buf) {
         if (text && callbacks->text &&
             (sscanf(buf, "\\%1[nN]", new_line) == 1 ||
              !strncmp(buf, "{\\", 2))) {



More information about the ffmpeg-cvslog mailing list