This matches the other branch
Fixes out of array read
Fixes: 4d142ca76d39fe685effcf5017098723/asan_heap-oob_31ae824_8611_348fdb64f9009b63c8a8eae9a0e497c5.mkv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
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.
We're now running some of this code through valgrind for the first
time, and a few warnings showed up stemming from two problems.
1) The ASS code assumes the subtitle header is null terminated, but
it wasn't, and passing the size down doesn't look like fun, so I
added a terminator
2) The code wasn't freeing all of its state.
Signed-off-by: Philip Langdale <philipl@overt.org>