Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
bd601f99
Commit
bd601f99
authored
Jan 15, 2013
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jan 15, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Avoid not necessary memory allocation for BITMAPINFO.
parent
44e554b7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
15 deletions
+8
-15
image.c
dlls/gdiplus/image.c
+8
-15
No files found.
dlls/gdiplus/image.c
View file @
bd601f99
...
...
@@ -4694,28 +4694,21 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromHBITMAP(HBITMAP hbm, HPALETTE hpal, GpBi
if
(
retval
==
Ok
)
{
HDC
hdc
;
BITMAPINFO
*
pbmi
;
char
bmibuf
[
FIELD_OFFSET
(
BITMAPINFO
,
bmiColors
[
256
])];
BITMAPINFO
*
pbmi
=
(
BITMAPINFO
*
)
bmibuf
;
INT
src_height
;
hdc
=
CreateCompatibleDC
(
NULL
);
pbmi
=
GdipAlloc
(
sizeof
(
BITMAPINFOHEADER
)
+
256
*
sizeof
(
RGBQUAD
));
if
(
pbmi
)
{
pbmi
->
bmiHeader
.
biSize
=
sizeof
(
BITMAPINFOHEADER
);
pbmi
->
bmiHeader
.
biBitCount
=
0
;
GetDIBits
(
hdc
,
hbm
,
0
,
0
,
NULL
,
pbmi
,
DIB_RGB_COLORS
);
pbmi
->
bmiHeader
.
biSize
=
sizeof
(
BITMAPINFOHEADER
);
pbmi
->
bmiHeader
.
biBitCount
=
0
;
src_height
=
abs
(
pbmi
->
bmiHeader
.
biHeight
);
pbmi
->
bmiHeader
.
biHeight
=
-
src_height
;
GetDIBits
(
hdc
,
hbm
,
0
,
0
,
NULL
,
pbmi
,
DIB_RGB_COLORS
);
GetDIBits
(
hdc
,
hbm
,
0
,
src_height
,
lockeddata
.
Scan0
,
pbmi
,
DIB_RGB_COLORS
);
src_height
=
abs
(
pbmi
->
bmiHeader
.
biHeight
);
pbmi
->
bmiHeader
.
biHeight
=
-
src_height
;
GdipFree
(
pbmi
);
}
else
retval
=
OutOfMemory
;
GetDIBits
(
hdc
,
hbm
,
0
,
src_height
,
lockeddata
.
Scan0
,
pbmi
,
DIB_RGB_COLORS
);
DeleteDC
(
hdc
);
...
...
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