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
eb69fa7e
Commit
eb69fa7e
authored
Jun 02, 2019
by
Sven Baars
Committed by
Alexandre Julliard
Jun 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvfw32: Fix copying of a BITMAPINFO structure (Valgrind).
Signed-off-by:
Sven Baars
<
sven.wine@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e5857da2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
3 deletions
+23
-3
msvideo_main.c
dlls/msvfw32/msvideo_main.c
+23
-3
No files found.
dlls/msvfw32/msvideo_main.c
View file @
eb69fa7e
...
...
@@ -1506,6 +1506,28 @@ void VFWAPI ICSeqCompressFrameEnd(PCOMPVARS pc)
clear_compvars
(
pc
);
}
static
BITMAPINFO
*
copy_bitmapinfo
(
const
BITMAPINFO
*
src
)
{
int
num_colors
;
unsigned
int
size
;
BITMAPINFO
*
dst
;
if
(
src
->
bmiHeader
.
biClrUsed
)
num_colors
=
min
(
src
->
bmiHeader
.
biClrUsed
,
256
);
else
num_colors
=
src
->
bmiHeader
.
biBitCount
>
8
?
0
:
1
<<
src
->
bmiHeader
.
biBitCount
;
size
=
FIELD_OFFSET
(
BITMAPINFO
,
bmiColors
[
num_colors
]);
if
(
src
->
bmiHeader
.
biCompression
==
BI_BITFIELDS
)
size
+=
3
*
sizeof
(
DWORD
);
if
(
!
(
dst
=
heap_alloc
(
size
)))
return
NULL
;
memcpy
(
dst
,
src
,
size
);
return
dst
;
}
/***********************************************************************
* ICSeqCompressFrameStart [MSVFW32.@]
*/
...
...
@@ -1517,11 +1539,9 @@ BOOL VFWAPI ICSeqCompressFrameStart(PCOMPVARS pc, LPBITMAPINFO lpbiIn)
DWORD
ret
;
ICCOMPRESS
*
icComp
;
if
(
!
(
pc
->
lpbiIn
=
heap_alloc
(
sizeof
(
BITMAPINFO
)
)))
if
(
!
(
pc
->
lpbiIn
=
copy_bitmapinfo
(
lpbiIn
)))
return
FALSE
;
*
pc
->
lpbiIn
=
*
lpbiIn
;
if
(
!
(
pc
->
lpState
=
heap_alloc
(
sizeof
(
ICCOMPRESS
)
+
sizeof
(
*
icComp
->
lpckid
)
+
sizeof
(
*
icComp
->
lpdwFlags
))))
goto
error
;
...
...
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