Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
5b07cfc1
Commit
5b07cfc1
authored
Apr 20, 2017
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 20, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Handle allocation failure when duplicating reference key.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6f667d1c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
13 deletions
+22
-13
font.c
dlls/dwrite/font.c
+22
-13
No files found.
dlls/dwrite/font.c
View file @
5b07cfc1
...
...
@@ -2,7 +2,7 @@
* Font and collections
*
* Copyright 2011 Huw Davies
* Copyright 2012, 2014-201
6
Nikolay Sivov for CodeWeavers
* Copyright 2012, 2014-201
7
Nikolay Sivov for CodeWeavers
* Copyright 2014 Aric Stewart for CodeWeavers
*
* This library is free software; you can redistribute it and/or
...
...
@@ -4212,23 +4212,32 @@ static const IDWriteFontFileVtbl dwritefontfilevtbl = {
dwritefontfile_Analyze
,
};
HRESULT
create_font_file
(
IDWriteFontFileLoader
*
loader
,
const
void
*
reference_key
,
UINT32
key_size
,
IDWriteFontFile
**
font_file
)
HRESULT
create_font_file
(
IDWriteFontFileLoader
*
loader
,
const
void
*
reference_key
,
UINT32
key_size
,
IDWriteFontFile
**
ret
)
{
struct
dwrite_fontfile
*
This
;
struct
dwrite_fontfile
*
file
;
void
*
key
;
This
=
heap_alloc
(
sizeof
(
struct
dwrite_fontfile
));
if
(
!
This
)
return
E_OUTOFMEMORY
;
*
ret
=
NULL
;
This
->
IDWriteFontFile_iface
.
lpVtbl
=
&
dwritefontfilevtbl
;
This
->
ref
=
1
;
file
=
heap_alloc
(
sizeof
(
*
file
));
key
=
heap_alloc
(
key_size
);
if
(
!
file
||
!
key
)
{
heap_free
(
file
);
heap_free
(
key
);
return
E_OUTOFMEMORY
;
}
file
->
IDWriteFontFile_iface
.
lpVtbl
=
&
dwritefontfilevtbl
;
file
->
ref
=
1
;
IDWriteFontFileLoader_AddRef
(
loader
);
This
->
loader
=
loader
;
This
->
stream
=
NULL
;
This
->
reference_key
=
heap_alloc
(
key_size
)
;
memcpy
(
This
->
reference_key
,
reference_key
,
key_size
);
This
->
key_size
=
key_size
;
file
->
loader
=
loader
;
file
->
stream
=
NULL
;
file
->
reference_key
=
key
;
memcpy
(
file
->
reference_key
,
reference_key
,
key_size
);
file
->
key_size
=
key_size
;
*
font_file
=
&
This
->
IDWriteFontFile_iface
;
*
ret
=
&
file
->
IDWriteFontFile_iface
;
return
S_OK
;
}
...
...
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