diff options
author | rcombs <rcombs@rcombs.me> | 2022-08-13 22:47:59 -0500 |
---|---|---|
committer | Oleg Oshmyan <chortos@inbox.lv> | 2022-08-14 15:17:01 +0300 |
commit | eda437d45d629b46083c7d78b4b5eda4859f6531 (patch) | |
tree | 1cbb51be37a8650cb67445740f8488c9001a108b | |
parent | 1472ccf73bc8ba8d4bdd37364b52771c4bfa8a8f (diff) | |
download | libass-eda437d45d629b46083c7d78b4b5eda4859f6531.tar.bz2 libass-eda437d45d629b46083c7d78b4b5eda4859f6531.tar.xz |
ass_parse: fix premature truncation on \t(\Xa)
This caused animations to out-of-range alpha values to be clipped to the
uint8_t range _before_ performing the lerp, rather than only after.
VSFilter only truncates after. Using e.g. `\1a0\t(\1a1FF)` should run through
the entire 0-FF range _twice_.
-rw-r--r-- | libass/ass_parse.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libass/ass_parse.c b/libass/ass_parse.c index 9dc59f3..8a0fc57 100644 --- a/libass/ass_parse.c +++ b/libass/ass_parse.c @@ -165,7 +165,7 @@ static void change_color(uint32_t *var, uint32_t new, double pwr) // like change_color, but for alpha component only inline void change_alpha(uint32_t *var, int32_t new, double pwr) { - *var = (*var & 0xFFFFFF00) | (uint8_t)calc_anim_int32(_a(new), _a(*var), pwr); + *var = (*var & 0xFFFFFF00) | (uint8_t)calc_anim_int32(new, _a(*var), pwr); } /** |