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
97154872
Commit
97154872
authored
Nov 17, 2022
by
Alex Henrie
Committed by
Alexandre Julliard
Nov 18, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Use standard C functions for memory allocation in metadataquery.c.
parent
81a432c3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
20 deletions
+10
-20
metadataquery.c
dlls/windowscodecs/metadataquery.c
+10
-10
wincodecs_private.h
dlls/windowscodecs/wincodecs_private.h
+0
-10
No files found.
dlls/windowscodecs/metadataquery.c
View file @
97154872
...
@@ -86,8 +86,8 @@ static ULONG WINAPI mqr_Release(IWICMetadataQueryReader *iface)
...
@@ -86,8 +86,8 @@ static ULONG WINAPI mqr_Release(IWICMetadataQueryReader *iface)
if
(
!
ref
)
if
(
!
ref
)
{
{
IWICMetadataBlockReader_Release
(
This
->
block
);
IWICMetadataBlockReader_Release
(
This
->
block
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
root
);
free
(
This
->
root
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
free
(
This
);
}
}
return
ref
;
return
ref
;
}
}
...
@@ -461,7 +461,7 @@ static HRESULT WINAPI mqr_GetMetadataByName(IWICMetadataQueryReader *iface, LPCW
...
@@ -461,7 +461,7 @@ static HRESULT WINAPI mqr_GetMetadataByName(IWICMetadataQueryReader *iface, LPCW
len
=
lstrlenW
(
query
)
+
1
;
len
=
lstrlenW
(
query
)
+
1
;
if
(
This
->
root
)
len
+=
lstrlenW
(
This
->
root
);
if
(
This
->
root
)
len
+=
lstrlenW
(
This
->
root
);
full_query
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
full_query
=
malloc
(
len
*
sizeof
(
WCHAR
));
full_query
[
0
]
=
0
;
full_query
[
0
]
=
0
;
if
(
This
->
root
)
if
(
This
->
root
)
lstrcpyW
(
full_query
,
This
->
root
);
lstrcpyW
(
full_query
,
This
->
root
);
...
@@ -591,7 +591,7 @@ static HRESULT WINAPI mqr_GetMetadataByName(IWICMetadataQueryReader *iface, LPCW
...
@@ -591,7 +591,7 @@ static HRESULT WINAPI mqr_GetMetadataByName(IWICMetadataQueryReader *iface, LPCW
else
else
PropVariantClear
(
&
new_value
);
PropVariantClear
(
&
new_value
);
HeapFree
(
GetProcessHeap
(),
0
,
full_query
);
free
(
full_query
);
return
hr
;
return
hr
;
}
}
...
@@ -730,7 +730,7 @@ HRESULT MetadataQueryReader_CreateInstance(IWICMetadataBlockReader *mbr, const W
...
@@ -730,7 +730,7 @@ HRESULT MetadataQueryReader_CreateInstance(IWICMetadataBlockReader *mbr, const W
{
{
QueryReader
*
obj
;
QueryReader
*
obj
;
obj
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
obj
));
obj
=
calloc
(
1
,
sizeof
(
*
obj
));
if
(
!
obj
)
if
(
!
obj
)
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
...
@@ -740,7 +740,7 @@ HRESULT MetadataQueryReader_CreateInstance(IWICMetadataBlockReader *mbr, const W
...
@@ -740,7 +740,7 @@ HRESULT MetadataQueryReader_CreateInstance(IWICMetadataBlockReader *mbr, const W
IWICMetadataBlockReader_AddRef
(
mbr
);
IWICMetadataBlockReader_AddRef
(
mbr
);
obj
->
block
=
mbr
;
obj
->
block
=
mbr
;
obj
->
root
=
root
?
heap_strdupW
(
root
)
:
NULL
;
obj
->
root
=
wcsdup
(
root
)
;
*
out
=
&
obj
->
IWICMetadataQueryReader_iface
;
*
out
=
&
obj
->
IWICMetadataQueryReader_iface
;
...
@@ -804,8 +804,8 @@ static ULONG WINAPI mqw_Release(IWICMetadataQueryWriter *iface)
...
@@ -804,8 +804,8 @@ static ULONG WINAPI mqw_Release(IWICMetadataQueryWriter *iface)
if
(
!
ref
)
if
(
!
ref
)
{
{
IWICMetadataBlockWriter_Release
(
writer
->
block
);
IWICMetadataBlockWriter_Release
(
writer
->
block
);
HeapFree
(
GetProcessHeap
(),
0
,
writer
->
root
);
free
(
writer
->
root
);
HeapFree
(
GetProcessHeap
(),
0
,
writer
);
free
(
writer
);
}
}
return
ref
;
return
ref
;
}
}
...
@@ -870,7 +870,7 @@ HRESULT MetadataQueryWriter_CreateInstance(IWICMetadataBlockWriter *mbw, const W
...
@@ -870,7 +870,7 @@ HRESULT MetadataQueryWriter_CreateInstance(IWICMetadataBlockWriter *mbw, const W
{
{
QueryWriter
*
obj
;
QueryWriter
*
obj
;
obj
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
obj
));
obj
=
calloc
(
1
,
sizeof
(
*
obj
));
if
(
!
obj
)
if
(
!
obj
)
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
...
@@ -880,7 +880,7 @@ HRESULT MetadataQueryWriter_CreateInstance(IWICMetadataBlockWriter *mbw, const W
...
@@ -880,7 +880,7 @@ HRESULT MetadataQueryWriter_CreateInstance(IWICMetadataBlockWriter *mbw, const W
IWICMetadataBlockWriter_AddRef
(
mbw
);
IWICMetadataBlockWriter_AddRef
(
mbw
);
obj
->
block
=
mbw
;
obj
->
block
=
mbw
;
obj
->
root
=
root
?
heap_strdupW
(
root
)
:
NULL
;
obj
->
root
=
wcsdup
(
root
)
;
*
out
=
&
obj
->
IWICMetadataQueryWriter_iface
;
*
out
=
&
obj
->
IWICMetadataQueryWriter_iface
;
...
...
dlls/windowscodecs/wincodecs_private.h
View file @
97154872
...
@@ -229,16 +229,6 @@ extern HRESULT MetadataQueryReader_CreateInstance(IWICMetadataBlockReader *, con
...
@@ -229,16 +229,6 @@ extern HRESULT MetadataQueryReader_CreateInstance(IWICMetadataBlockReader *, con
extern
HRESULT
MetadataQueryWriter_CreateInstance
(
IWICMetadataBlockWriter
*
,
const
WCHAR
*
,
IWICMetadataQueryWriter
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
MetadataQueryWriter_CreateInstance
(
IWICMetadataBlockWriter
*
,
const
WCHAR
*
,
IWICMetadataQueryWriter
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
stream_initialize_from_filehandle
(
IWICStream
*
iface
,
HANDLE
hfile
)
DECLSPEC_HIDDEN
;
extern
HRESULT
stream_initialize_from_filehandle
(
IWICStream
*
iface
,
HANDLE
hfile
)
DECLSPEC_HIDDEN
;
static
inline
WCHAR
*
heap_strdupW
(
const
WCHAR
*
src
)
{
WCHAR
*
dst
;
SIZE_T
len
;
if
(
!
src
)
return
NULL
;
len
=
(
lstrlenW
(
src
)
+
1
)
*
sizeof
(
WCHAR
);
if
((
dst
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
)))
memcpy
(
dst
,
src
,
len
);
return
dst
;
}
static
inline
const
char
*
debug_wic_rect
(
const
WICRect
*
rect
)
static
inline
const
char
*
debug_wic_rect
(
const
WICRect
*
rect
)
{
{
if
(
!
rect
)
return
"(null)"
;
if
(
!
rect
)
return
"(null)"
;
...
...
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