mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-03-03 19:18:01 +00:00
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 c83002a4f8
)
This commit is contained in:
parent
e28814e0e1
commit
80b8dc30dc
@ -366,7 +366,7 @@ int ff_ass_split_override_codes(const ASSCodesCallbacks *callbacks, void *priv,
|
|||||||
char new_line[2];
|
char new_line[2];
|
||||||
int text_len = 0;
|
int text_len = 0;
|
||||||
|
|
||||||
while (*buf) {
|
while (buf && *buf) {
|
||||||
if (text && callbacks->text &&
|
if (text && callbacks->text &&
|
||||||
(sscanf(buf, "\\%1[nN]", new_line) == 1 ||
|
(sscanf(buf, "\\%1[nN]", new_line) == 1 ||
|
||||||
!strncmp(buf, "{\\", 2))) {
|
!strncmp(buf, "{\\", 2))) {
|
||||||
|
Loading…
Reference in New Issue
Block a user