aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2012-12-30 06:53:48 +0100
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2013-01-01 18:27:28 +0100
commit20940780c72605207783880dfd1d3c2741151abf (patch)
tree17c4f661186853d53aa25d4a2ee7ba349da0e80f /libavcodec
parent3ed505863b067e73eee837a9e9f76efdbc692142 (diff)
downloadffmpeg-20940780c72605207783880dfd1d3c2741151abf.tar.gz
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)
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/ass_split.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/ass_split.c b/libavcodec/ass_split.c
index 2a3b76445e..33c1c2714f 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))) {