Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
3c166d67
Commit
3c166d67
authored
Nov 24, 2015
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
freetype/darwin: fix error path when font lookup fails
parent
2506d446
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
9 deletions
+25
-9
modules/text_renderer/freetype/fonts/darwin.c
modules/text_renderer/freetype/fonts/darwin.c
+25
-9
No files found.
modules/text_renderer/freetype/fonts/darwin.c
View file @
3c166d67
...
...
@@ -72,6 +72,8 @@ void addNewFontToFamily(filter_t *p_filter, CTFontDescriptorRef iter, char *path
#ifndef NDEBUG
msg_Dbg
(
p_filter
,
"New font: bold %i italic %i path '%s'"
,
b_bold
,
b_italic
,
path
);
#else
VLC_UNUSED
(
p_filter
);
#endif
NewFont
(
path
,
0
,
b_bold
,
b_italic
,
p_family
);
...
...
@@ -98,11 +100,8 @@ const vlc_family_t *CoreText_GetFamily(filter_t *p_filter, const char *psz_famil
return
p_family
;
}
/* create a new family object */
p_family
=
NewFamily
(
p_filter
,
psz_lc
,
&
p_sys
->
p_families
,
&
p_sys
->
family_map
,
psz_lc
);
if
(
unlikely
(
!
p_family
))
{
return
NULL
;
}
CTFontCollectionRef
coreTextFontCollection
=
NULL
;
CFArrayRef
matchedFontDescriptions
=
NULL
;
/* we search for family name, display name and name to find them all */
const
size_t
numberOfAttributes
=
3
;
...
...
@@ -131,14 +130,26 @@ const vlc_family_t *CoreText_GetFamily(filter_t *p_filter, const char *psz_famil
(
const
void
**
)
&
coreTextFontDescriptors
,
numberOfAttributes
,
NULL
);
CTFontCollectionRef
coreTextFontCollection
=
CTFontCollectionCreateWithFontDescriptors
(
coreTextFontDescriptorsArray
,
0
);
coreTextFontCollection
=
CTFontCollectionCreateWithFontDescriptors
(
coreTextFontDescriptorsArray
,
0
);
if
(
coreTextFontCollection
==
NULL
)
{
goto
end
;
}
CFArrayRef
matchedFontDescriptions
=
CTFontCollectionCreateMatchingFontDescriptors
(
coreTextFontCollection
);
matchedFontDescriptions
=
CTFontCollectionCreateMatchingFontDescriptors
(
coreTextFontCollection
);
if
(
matchedFontDescriptions
==
NULL
)
{
goto
end
;
}
CFIndex
numberOfFoundFontDescriptions
=
CFArrayGetCount
(
matchedFontDescriptions
);
char
*
path
=
NULL
;
/* create a new family object */
p_family
=
NewFamily
(
p_filter
,
psz_lc
,
&
p_sys
->
p_families
,
&
p_sys
->
family_map
,
psz_lc
);
if
(
unlikely
(
!
p_family
))
{
goto
end
;
}
for
(
CFIndex
i
=
0
;
i
<
numberOfFoundFontDescriptions
;
i
++
)
{
CTFontDescriptorRef
iter
=
CFArrayGetValueAtIndex
(
matchedFontDescriptions
,
i
);
path
=
getPathForFontDescription
(
iter
);
...
...
@@ -154,8 +165,13 @@ const vlc_family_t *CoreText_GetFamily(filter_t *p_filter, const char *psz_famil
addNewFontToFamily
(
p_filter
,
iter
,
path
,
p_family
);
}
end:
if
(
matchedFontDescriptions
!=
NULL
)
{
CFRelease
(
matchedFontDescriptions
);
}
if
(
coreTextFontCollection
!=
NULL
)
{
CFRelease
(
coreTextFontCollection
);
}
for
(
size_t
x
=
0
;
x
<
numberOfAttributes
;
x
++
)
{
CFRelease
(
coreTextAttributes
[
x
]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment