If token is not found in svg template, psz_template is
freed. Yet it is used in svg_GetDocument as
psz_file_template and incorectly being double freed in
Destroy().
Since the only use of psz_file_template is in svg_GetDocument
and it is performed after a null-check, setting psz_template
to null after freed should fix the issue.
Fixes: #29370 (Coverity 1398436)
(cherry picked from commit 03e511aea8) (rebased)
rebased:
- Replacement of tab with space
Either when the video is in portrait mode or when the subtitles
are shown in the black bars and the video area is in portrait mode,
the text can become very large just because we apply a percentage base on
the output height.
We switch mode when the height becomes bigger than the width
so there's a continuity in the ratio when growing/shrinking the
video in one direction or the other.
(cherry picked from commit e25ec4e25b)
wcscat_s is part of msvcrt.dll so should be in Windows XP.
(cherry picked from commit ab501d6a93) (edited)
edited:
- 3.0 was already using a long constant
Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
lfFaceName is a WCHAR table.
(cherry picked from commit f4d040e050) (edited)
edited:
- 3.0 uses the tchar API
Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
The `psz_lcname` is lowercase, so we need to use `strcasecmp`
instead.
(cherry picked from commit c52066f204)
Signed-off-by: Marvin Scholz <epirat07@gmail.com>
In macOS/iOS/tvOS, font collection file contains multiple fonts.
The 0 index should not be used by default, but the corresponding
index should be used. This will fix some font rendering bugs and
fallback font bugs.
(manual cherry picked from commit 2e3c0fb6bc)
Signed-off-by: Marvin Scholz <epirat07@gmail.com>
Typos found and reworked from codespell.
(cherry picked from commit 6b7a57f984) (edited)
edited:
* some files don't exist in 3.0
* some 3.0 code around changes is different (vlc_tick_t)
Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
This fixes subtitle texts are not shown correctly on OS/2.
Freetype module expects UCS-4 string. However, OS/2 iconv() does not
support UCS-4 encoding, so UCS-2 encoding is used on OS/2. Because of
this mis-match, subtitle texts on OS/2 are mis-interpreted. As a result,
subtitle texts are not shown correctly.
(cherry picked from commit 89b561eaa2)
Conflicts:
modules/text_renderer/freetype/freetype.c
modules/text_renderer/freetype/text_layout.c
That's what is expected by InterlockedIncrement/InterlockedDecrement and how
it's done elsewhere.
(cherry picked from commit 2daf3cbf71)
Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
FT_Glyph_Stroke is more tolerant of font files that do not follow
contour orientation conventions, like Helvetica Neue.
It also creates unfilled outline glyphs that can be more efficiently
blended.
Fixes#21043
(cherry picked from commit 074b4f3c4a)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
FT_Fixed is defined as a signed long and most operation in freetype are
historically using FT_Long. Fix a truncation warning.
(cherry picked from commit d761abd891)
Currently double free is only prevented by
FT_Set_Pixel_Sizes error on pure bitmaps.
FT_LOAD_NO_BITMAP does not exclude bitmap only fonts
and FT_Glyph_To_Bitmap is no-op for bitmap fonts,
shadow glyph pointer can then end pointing to same
glyph as main glyph.
(cherry picked from commit d088e548b2)
-luuid is needed as we use IID_IUnknown
Add missing $(AM_LIBADD) messing up the order of libraries
(cherry picked from commit dfa61b58d5)
Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
AM_LDFLAGS needs to be removed as this is already added to the
standard LINK flags (and adding those flags twice is not allowed).
(cherry picked from commit ed600b3efd)
Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
Overrides relative size inconditionally,
and this conflicts with HiDPI fixes where we need only
to compute relative font size.
Fixes closed caption incorrect font size regression.
Update functions deprecated in version 1.0 when building with release 1.0 and
above.
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
(cherry picked from commit 26e2d39066)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
Some fonts like Sakkal Majalla have a large max_advance_width, apparently due to some glyphs that are rarely if ever used. This was causing "Invalid max width" errors for text that did fit the available width.
So the calculation of max advance has been modified to take into account only the glyphs we are actually rendering.
Fixes#20102
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
(cherry picked from commit c47d0c4df2)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
The old getCStringCopyForCFStringRef function had a flaw that would
cause a heap-buffer overflow if the CFString easy obtaining of the
pointer fails and the string contains characters that need more than
one byte.
To fix this, remove the old getCStringCopyForCFStringRef and use the
recently added CFStringCopyUTF8CString instead, and generalized it to
work with any encoding. Additionally add a check for the malloc
result to prevent passing NULL to CFStringGetCString.
Fix#20721
(cherry picked from commit e89663939f)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
Usually, the per-target _LINK variable is autogenerated, taking
into account used languages based on file extension, and also
per-target _LDFLAGS. Due to #17827, _LINK for this module is
explicitly overridden, and therefore the per-target _LDFLAGS are not
respected, which leads to compilation failure.
This is a quick fix to make macOS compile again. The problem
affects all platforms however, and a better solution shall be found
later.
(cherry picked from commit ad1e9416b0)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>