Andreas Rheinhardt
636631d9db
Remove unnecessary libavutil/(avutil|common|internal).h inclusions
...
Some of these were made possible by moving several common macros to
libavutil/macros.h.
While just at it, also improve the other headers a bit.
Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 years ago
Andreas Rheinhardt
5ad436fcb9
avcodec/ass_split: Rename ff_ass_split_dialog2->ff_ass_split_dialog
...
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 years ago
Andreas Rheinhardt
7f1edcb4ef
avcodec/ass_split: Remove unused ff_ass_split_dialogue()
...
Unused since 1f63665ca5
.
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 years ago
Andreas Rheinhardt
25c8507818
Remove/replace some unnecessary avcodec.h inclusions
...
Also remove other unnecessary headers and include headers directly while
at it.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
3 years ago
Andreas Rheinhardt
f38f791a23
avcodec/ass_split: Don't presume strlen to be >= 2
...
Fixes potential heap-buffer-overflow.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years ago
John Stebbins
a52eef68d4
lavc/ass_split: fix parsing utf8 scripts
...
The [Script Info] section was skipped if starts with UTF8 BOM
Signed-off-by: Philip Langdale <philipl@overt.org>
5 years ago
Fan Gang
c6e1966c1a
avcodec/ass_split: fix a memory leak defect when realloc fails
...
Fixes #7019 .
6 years ago
Michael Niedermayer
ae514b1254
avcodec/ass_split: Change order of operations in ass_split_section()
...
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>
8 years ago
Rodger Combs
dca03ec5f4
ass_split: reindent
8 years ago
Rodger Combs
3b32e1313c
ass_split: fix handling of streams with no [Events] or Format: line
8 years ago
Clément Bœsch
2941282124
lavc: allow subtitle text format to be ASS without timing
9 years ago
Michael Niedermayer
158f0545d8
avcodec/ass_split: Fix null pointer dereference in ff_ass_style_get()
...
Fixes: 55d71971da50365d542ed14b65565fe1/signal_sigsegv_4765a4_8499_f146af090a94f591d6254515c7700ef5.mkv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Clément Bœsch
324cf0645d
avcodec/ass_split: check ASSSplitContext alloc
10 years ago
Michael Niedermayer
aefb99f2c0
avcodec/ass_split: use *alloc_array()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Clément Bœsch
462f2876ce
avcodec/ass_split: realign after addition of new fields
10 years ago
Clément Bœsch
3e86ead383
avcodec/ass_split: assume default order when "Format:" line is not found
...
Fixes the decoding of the ASS stream in a mkv from a fansub release from
Coalgirls.
10 years ago
Clément Bœsch
d9f272fe33
avcodec/ass_split: extend recognized fields in ASS splitter
...
This simplifies the logic for the fix in the next commit.
10 years ago
Michael Niedermayer
8b47058c61
ass_split: fix out of array access in ass_split()
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
97b1ba696b
ass_split: fix out of array access
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Clément Bœsch
c83002a4f8
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.
12 years ago
Michael Niedermayer
6ca2465556
ass_split_section: dont overread array
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Clément Bœsch
d214e5cfb4
lavc/ass_split: add ff_ prefix to ass_style_get().
12 years ago
Philip Langdale
50b4dbf65a
ass subtitles: Fix valgrind warnings.
...
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>
12 years ago
Nicolas George
c088b7f389
ass_split: accept files with only \n and no \r.
...
The +1 is there to skip the ','.
With \r\n, the +1 skips the \r but that is ok.
With only \n, the +1 skips it and all hell breaks loose.
13 years ago
Aurelien Jacobs
8e43b6fed9
add SubRip encoder
...
Signed-off-by: Aurelien Jacobs <aurel@gnuage.org>
14 years ago