| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
The timecode is a long long, but it is computed as a product whose
all multiplicands are (unsigned) ints and so effectively has the value
of an (unsigned) int. Fix this, and use the full long long range,
by explicitly making one of the first two multiplicands a long long.
Found by Coverity Scan.
|
|
|
|
| |
Reported by clang scan-build static analysis.
|
|
|
|
|
|
| |
Reported by clang scan-build static analysis. This cannot happen with
the current code, but the check might make this more robust in case
anything changes.
|
|
|
|
|
| |
Reported by clang scan-build static analysis. Also fix incorrect
return value in case of error.
|
|
|
|
|
|
| |
Only normal dialog lines are allowed to appear outside.
Fixes #177.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Allow exactly one of these prefixes in header values:
0x, 0X, &h, &H. Note that "0x0xFFFFFF" is a correct value,
as the first 0x is consumed by the parser and the second by
the string-to-number conversion following strtol semantics.
* Allow arbitrary numbers of leading & and H
(and not h) in any order in override tag values.
* Reduce header values modulo 2**32 instead
of saturating them to LLONG_MIN/MAX.
* Saturate override tag values to INT32_MIN/MAX
rather than to LLONG_MIN/MAX.
* Don't fiddle with bytes in alpha override tag values.
(They can be outside of the 0..255 range.)
Also change the byte swapping code to be more sensible.
Fixes #80.
Fixes #145.
Fixes #178.
Also fixes our behavior in the case described in
https://code.google.com/p/xy-vsfilter/issues/detail?id=80.
|
|
|
|
|
| |
HarfBuzz has been able to disable fallback kerning since commit
038c98f6. Add some more useful docstrings instead.
|
| |
|
|
|
|
|
|
| |
What.
Closes #175.
|
|
|
|
|
| |
This really didn't make a lot of sense. This is a simplification, and
should not affect actual program behavior.
|
| |
|
|
|
|
|
|
|
| |
libass already does not use the margins for events using \pos. This is
not quite complete: there are other tags that we consider as "not
dialogue", and which should not be overridden. These tags do not use
EVENT_POSITIONED, and thus use the margins, which can mess up rendering.
|
|
|
|
| |
Just move the *_pos ones about the variants without this postfix.
|
|
|
|
| |
Oops, trig is hard. We output from -pi to +pi now.
|
|
|
|
| |
Also fix an incorrect comment
|
|
|
|
|
|
|
|
|
|
|
| |
If there's an odd number of values, ignore the extra value, instead
of shifting all values after the next command. While such drawings are
boken strictly speaking, VSFilter handles them gracefully, and what
libass did before this commit made no sense anyway.
Test case:
{\an7\pos(0.01,0.7)\c&H5A493D&\p1\iclip(11,m 857379 -744112 l 517759 -744112 517759 -942768 857379 -942768 m 851235 -422238 l 689105 -422238 689105 -620546 851235 -620546 m 679889 -421552 l 517411 -421552 517411 -620894 679889 -620894 -55984 m 860113 425634 l 519459 425634 519459 226640 860113 226640 m 868305 992080 l 465361 992080 465361 793936 868305 793936 m 841343 1317200 l 520145 1317200 520145 1118206 841343 1118206 m 411662 -245762 b 411662 -242373 408918 -239618 405518 -239618 l 342931 -239618 b 339532 -239618 336787 -242373 336787 -245762 l 336787 -308226 b 336787 -311626 339532 -314370 342931 -314370 l 405518 -314370 b 408918 -314370 411662 -311626 411662 -308226 m 414929 -907440 b 414929 -904051 412174 -901296 408785 -901296 l 346198 -901296 b 342798 -901296 340054 -904051 340054 -907440 l 340054 -969904 b 340054 -973294 342798 -976048 346198 -976048 l 408785 -976048 b 412174 -976048 414929 -973294 414929 -969904 m 414417 -585904 b 414417 -582515 411652 -579760 408252 -579760 l 345450 -579760 b 342041 -579760 339286 -582515 339286 -585904 l 339286 -648368 b 339286 -651758 342041 -654512 345450 -654512 l 408252 -654512 b 411652 -654512 414417 -651758 414417 -648368 m 414929 -44997 b 414929 -41597 412174 -38832 408785 -38832 l 346198 -38832 b 342798 -38832 340054 -41597 340054 -44997 l 340054 -107676 b 340054 -111075 342798 -113840 346198 -113840 l 408785 -113840 b 412174 -113840 414929 -111075 414929 -107676 m 415932 261456 b 415932 264845 413178 267600 409788 267600 l 347191 267600 b 343802 267600 341047 264845 341047 261456 l 341047 198992 b 341047 195602 343802 192848 347191 192848 l 409788 192848 b 413178 192848 415932 195602 415932 198992 m 414929 564048 b 414929 567437 412174 570192 408785 570192 l 346198 570192 b 342798 570192 340054 567437 340054 564048 l 340054 501584 b 340054 498194 342798 495440 346198 495440 l 408785 495440 b 412174 495440 414929 498194 414929 501584 m 414929 781136 b 414929 784525 412174 787280 408785 787280 l 346198 787280 b 342798 787280 340054 784525 340054 781136 l 340054 718672 b 340054 715282 342798 712528 346198 712528 l 408785 712528 b 412174 712528 414929 715282 414929 718672 m 414929 1133525 b 414929 1136914 412174 1139669 408785 1139669 l 346198 1139669 b 342798 1139669 340054 1136914 340054 1133525 l 340054 1071061 b 340054 1067661 342798 1064917 346198 1064917 l 408785 1064917 b 412174 1064917 414929 1067661 414929 1071061)}m 0 0 l 1280 0 1280 720 0 720 0 0{\p0}
|
| |
|
|
|
|
|
|
|
| |
Fixes "[ARR] Musashi no Ken - 01 [AVC][5697986B].ssa", which has
timestamps like "00:02:30.85". It starts with 2 zeros instead of one,
which probably means it's an invalid file, but it's accepted by various
other parsers (VSFilter, MPlayer, vlc, ffmpeg).
|
|
|
|
| |
Similar to xy-VSFilter.
|
|
|
|
|
|
|
| |
Somewhat stolen from:
https://github.com/Cyberbeing/xy-VSFilter/blob/xy_sub_filter_rc3/src/subtitles/RTS.cpp#L2004
(xy-VSFilter started work on this in commit 014da6d9766417d7886eb867c9f2c14038f2a226)
|
|
|
|
|
|
|
|
| |
Add tons of ASS_OVERRIDE_ flags, which control whether certain ASS_Style
fields are copied when doing selective style overrides with
ass_set_selective_style_override_enabled().
This comes with some cleanup. It should be fully backwards-compatible.
|
|
|
|
|
|
|
|
| |
"Bold" should obviously be taken from the script's style, like it's done
with StrikeOut and Underline.
treat_fontname_as_pattern is specific to the font, and thus should be
taken from the same style as the font (the override style).
|
|
|
|
|
|
| |
I don't know why it was done this way, but some fields were always taken
from the event's style, instead of the (possibly different) \r style.
Undo this, as it seems like an unnecessary complication.
|
|
|
|
| |
Fixes #161
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Now pre- and post-combining operations are clearly separated,
many parameters in cache keys are no longer necessary due to that.
Also an ambiguous (in case of multiple fonts) text string is replaced
with a list of direct bitmap references in composite cache key.
Fixes #153.
Fixes #82.
|
| |
|
|
|
|
|
|
| |
Our public headers can be #included from C++. Hence, ass.h needs
an extern "C" guard to declare the correct linkage for functions.
ass_types.h only defines types, so it does not need a guard.
|
| |
|
| |
|
|
|
|
|
| |
HarfBuzz faces reference the FreeType faces. Destroying FT faces first can cause crash in HB destruction code:
https://bugs.freedesktop.org/show_bug.cgi?id=86300
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This was a check for the realloc() call, but the result was never
used in the success case - which makes no sense.
Doesn't really matter, because it's the legacy charset code which
hopefully is not used by anyone.
Found by Coverity.
|
|
|
|
|
|
|
|
| |
Don't crash if running out of memory when allocating per-glyph data
during shaping. Also some fixes to initialization.
The caller of ass_fontconfig.c/match_fullname() actually handles a NULL
return value correctly.
|
|
|
|
| |
In both cases, fallback to doing nothing if alloc fails.
|
|
|
|
|
|
|
|
|
|
| |
Use strndup() instead of malloc+copy.
Make all code deal with the possibility that ASS_Drawing.text can be
NULL (which can happen on allocation failure).
Skip fix_collisions() on malloc failure - the lines will overlap, but at
least libass won't crash.
|
|
|
|
|
| |
This standard function is not available everywhere, so we detect it and
provide a fallback if missing.
|
| |
|
| |
|
|
|
|
|
|
| |
Much of outline_to_bitmap() is duplicated. What?
Add the overflow check to duplicated code too.
|
|
|
|
|
|
| |
Seriously...
Checking for negative values might not be needed, but do it anyway.
|
|
|
|
|
|
|
|
| |
This actually fixes #146.
The overflow check itself is obvious. Also, make ass_align() return an
unaligned value if aligning it would overflow. This is probably better,
as it for example makes the overflow check in the caller simpler.
|
| |
|
|
|
|
|
| |
The split doesn't necessarily follow any logic; for the most part
it just moves each processing loop into its own function.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Commit 8536eaa was slightly broken: for some incomprehensible reason,
(w + 1) memory instead of w is needed. The missing space could lead to
memory corruption and crashes.
|
|
|
|
| |
Mainly cosmetic, but maybe some optimizations the compiler misses.
|
|
|
|
| |
Also fix that ass_synth_init() could deref NULL.
|
| |
|
|
|
|
| |
Put all code into one place, which makes it easier to follow.
|
|
|
|
| |
This still doesn't catch all cases.
|
|
|
|
| |
Helps with overflow and allocation failure checking.
|
|
|
|
| |
This is just a start and gets most easy ones.
|
|
|
|
|
| |
SIZE_MAX is in C99, but not in C89. It is in <stdint.h>, and is always a
macro, so this fallback should be pretty portable and cause no issues.
|
|
|
|
| |
Part of #146
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes the following warnings:
In file included from ass_cache.c:34:0:
ass_cache_template.h:52:0: warning: "BINSTRING" redefined
#define BINSTRING(member) \
^
In file included from ass_cache.h:59:0,
from ass_font.h:58,
from ass_cache.c:28:
ass_cache_template.h:9:0: note: this is the location of the previous definition
#define BINSTRING(member) \
^
In file included from ass_cache.c:36:0:
ass_cache_template.h:30:0: warning: "BINSTRING" redefined
#define BINSTRING(member) \
^
In file included from ass_cache.c:34:0:
ass_cache_template.h:52:0: note: this is the location of the previous definition
#define BINSTRING(member) \
^
|
| |
|
|
|
|
|
| |
Makes #131 not crash. The function likely fails because the number of
points exceeds SHRT_MAX.
|
| |
|
|
|
|
| |
Fixes libass#129.
|
| |
|
| |
|
|
|
|
| |
Fallout from the previous commits.
|
| |
|
|
|
|
|
|
| |
This not only provides a performance improvement but also
conveniently fixes the following issue: we used to interpret
backslash-escapes in vector drawings, but we shouldn't.
|
| |
|
|
|
|
|
|
|
|
| |
Like VSFilter. '{' without a following '}' is just text, though
in vector drawing mode it still delimits individual drawings.
This also lets us nicely avoid '\0' hacks
in the \t override tag handler in parse_tag.
|