summaryrefslogtreecommitdiffstats
path: root/libass
Commit message (Collapse)AuthorAgeFilesLines
* string2timecode: don't truncate to intOleg Oshmyan2015-06-091-1/+1
| | | | | | | | | 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.
* Remove several dead storesGrigori Goronzy2015-06-072-7/+4
| | | | Reported by clang scan-build static analysis.
* Check possible NULL dereferenceGrigori Goronzy2015-06-071-1/+1
| | | | | | 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.
* Fix minor memory leak in ass_read_stylesGrigori Goronzy2015-06-071-1/+2
| | | | | Reported by clang scan-build static analysis. Also fix incorrect return value in case of error.
* Strictly clip non-dialog events against the video rectanglewm42015-05-251-0/+13
| | | | | | Only normal dialog lines are allowed to appear outside. Fixes #177.
* Simplify change_alpha and change_colorOleg Oshmyan2015-05-251-6/+4
|
* Apply fade only when the fade alpha is positive (like VSFilter)Oleg Oshmyan2015-05-253-6/+8
|
* parse_tag: split \[1-4][ac]Oleg Oshmyan2015-05-251-47/+49
|
* Parse and animate all colors and alpha values like VSFilterOleg Oshmyan2015-05-255-61/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* shaper: purge outdated commentGrigori Goronzy2015-05-241-2/+2
| | | | | HarfBuzz has been able to disable fallback kerning since commit 038c98f6. Add some more useful docstrings instead.
* Fix a wrong commentOleg Oshmyan2015-05-231-1/+1
|
* Fix memory leak with drawingswm42015-05-101-1/+6
| | | | | | What. Closes #175.
* Remove RenderContext.drawingwm42015-05-102-20/+19
| | | | | This really didn't make a lot of sense. This is a simplification, and should not affect actual program behavior.
* Release 0.12.20.12.2wm42015-05-072-2/+2
|
* Don't use margins for events that should not be overriddenwm42015-03-162-0/+14
| | | | | | | 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.
* Reorder functionswm42015-03-161-12/+12
| | | | Just move the *_pos ones about the variants without this postfix.
* Fix range in rot_keyRodger Combs2015-03-121-1/+1
| | | | Oops, trig is hard. We output from -pi to +pi now.
* Fix degrees/radians cache confusion; avoid a fixed-point overflowRodger Combs2015-03-122-5/+5
| | | | Also fix an incorrect comment
* Ignore extra coordinates in drawingswm42015-03-091-0/+7
| | | | | | | | | | | 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}
* Fix BorderStyle=3 with zero Outline and ShadowDr.Smile2015-03-061-1/+5
|
* Make timestamp parsing more lenientwm42015-03-061-1/+1
| | | | | | | 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).
* Prevent selective style overrides with scrollingwm42015-03-061-2/+3
| | | | Similar to xy-VSFilter.
* Refine list of tags that prevent selective style overrideswm42015-03-063-6/+9
| | | | | | | 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)
* Allow more fine grained control over style overrideswm42015-02-264-46/+143
| | | | | | | | 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.
* Change what fields are overridden with style overridewm42015-02-261-1/+1
| | | | | | | | "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).
* Always use the new style with \r and style overrideswm42015-02-261-6/+6
| | | | | | 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.
* Define _GNU_SOURCERodger Combs2015-02-171-1/+1
| | | | Fixes #161
* Skip memset() when using internal rasterizerDr.Smile2015-02-096-31/+36
|
* Fix incorrect memsetDr.Smile2015-01-291-1/+1
|
* Remove unused function is_skip_symbolRodger Combs2015-01-291-4/+0
|
* Clean up bitmap combiningDr.Smile2015-01-287-418/+292
| | | | | | | | | | 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.
* Fix bug in ASS_Outline intrastructureDr.Smile2015-01-221-34/+19
|
* Add extern "C" guard to public headerOleg Oshmyan2015-01-161-0/+8
| | | | | | 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.
* Fix rare edge-case bug in rasterizerDr.Smile2015-01-151-1/+4
|
* Update version and changelog0.12.1wm42015-01-071-1/+1
|
* Destroy harfbuzz faces before freetype facesBehdad Esfahbod2014-12-281-2/+2
| | | | | 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
* Replace FT_Outline with ASS_OutlineDr.Smile2014-11-2312-142/+335
|
* Flip coordinate system in rasterizerDr.Smile2014-11-235-161/+153
|
* Fix incorrect closing of last drawing contourDr.Smile2014-11-231-7/+6
|
* Leave spline evaluation to rasterizerDr.Smile2014-11-231-82/+30
|
* Fix broken memory leak check in legacy APIwm42014-11-221-0/+1
| | | | | | | | | | 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.
* More malloc checkingwm42014-11-202-12/+35
| | | | | | | | 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.
* More malloc checkingwm42014-11-181-12/+27
| | | | In both cases, fallback to doing nothing if alloc fails.
* More malloc checkingwm42014-11-174-11/+10
| | | | | | | | | | 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.
* Provide a strndup() fallbackwm42014-11-172-0/+21
| | | | | This standard function is not available everywhere, so we detect it and provide a fallback if missing.
* Fix some of the recently added checkswm42014-11-171-2/+2
|
* Some more overflow checkswm42014-11-161-4/+15
|
* Deal with code-duplication bullshitwm42014-11-161-1/+1
| | | | | | Much of outline_to_bitmap() is duplicated. What? Add the overflow check to duplicated code too.
* Check the overflow check for overflowswm42014-11-161-1/+1
| | | | | | Seriously... Checking for negative values might not be needed, but do it anyway.
* Check bitmap allocation for overflowswm42014-11-162-1/+6
| | | | | | | | 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.
* Print debug message when loading a memory fontwm42014-11-151-0/+2
|
* Split some parts of ass_render_event into functionswm42014-11-151-276/+332
| | | | | The split doesn't necessarily follow any logic; for the most part it just moves each processing loop into its own function.
* Check some allocations in strike-through codewm42014-11-141-5/+10
|
* Add another helper-macro for array allocationwm42014-11-142-0/+32
|
* Fix recently introduced overflow check (again)wm42014-11-141-6/+2
|
* Fix the bugwm42014-11-141-2/+2
| | | | | | 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.
* Simplify ass_utils.c codeYouka2014-11-131-48/+22
| | | | Mainly cosmetic, but maybe some optimizations the compiler misses.
* Use stdbool.h in another placewm42014-11-131-8/+8
| | | | Also fix that ass_synth_init() could deref NULL.
* Check for another overflow in blur codewm42014-11-131-18/+20
|
* Move apply_blur() to ass_bitmap.cwm42014-11-134-89/+100
| | | | Put all code into one place, which makes it easier to follow.
* Check against some overflows and allocation failures on blurwm42014-11-112-8/+17
| | | | This still doesn't catch all cases.
* Add ass_realloc_array()wm42014-11-112-0/+20
| | | | Helps with overflow and allocation failure checking.
* Check more mallocswm42014-11-096-16/+84
| | | | This is just a start and gets most easy ones.
* Provide SIZE_MAX fallbackwm42014-11-091-0/+4
| | | | | 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.
* Check more allocationsRodger Combs2014-11-082-1/+23
| | | | Part of #146
* Fix UB at left shifts of negative integersDr.Smile2014-11-073-14/+14
|
* Fix subpixel shadow shiftDr.Smile2014-11-062-49/+27
|
* Only use the subpixel value when shifting bitmaps. Fixes #142Rodger Combs2014-11-051-2/+4
|
* Load embedded fonts from memory correctlywm42014-11-041-10/+3
|
* Update version and changelog0.12.0Grigori Goronzy2014-10-232-3/+3
|
* Provide slightly more fine-grained control over style overrideswm42014-10-174-13/+46
|
* Silence compilation warningwm42014-10-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | 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) \ ^
* Fix caching of combined bitmaps after complex shapingOleg Oshmyan2014-09-053-10/+20
|
* Check FT_Outline_New return valuewm42014-08-311-1/+6
| | | | | Makes #131 not crash. The function likely fails because the number of points exceeds SHRT_MAX.
* Correctly close last contour in case of overflowDr.Smile2014-08-261-1/+4
|
* Check for 0-point contours in rasterizer_set_outline()Dr.Smile2014-08-261-0/+3
| | | | Fixes libass#129.
* Fix \fade(7-argument version) parseMaks Naumov2014-08-231-2/+2
|
* Fix integer overflow in FT_OutlineDr.Smile2014-07-181-0/+4
|
* ass_parse: remove 2 unused variableswm42014-06-091-2/+0
| | | | Fallout from the previous commits.
* Simplify drawing text assignmentOleg Oshmyan2014-06-064-34/+10
|
* Use ass_drawing_add_chars for vector drawingsOleg Oshmyan2014-06-061-28/+20
| | | | | | 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.
* parse_tag: remove unnecessary mallocOleg Oshmyan2014-06-063-13/+9
|
* Require closing '}' for override tagsOleg Oshmyan2014-06-063-28/+20
| | | | | | | | 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.
* Introduce ass_drawing_add_chars for adding a whole string at onceOleg Oshmyan