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
35fc9c12
Commit
35fc9c12
authored
Jan 30, 2013
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jan 30, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Avoid not necessary memory allocation for BITMAPINFO.
parent
8f87fc5b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
6 deletions
+2
-6
image.c
dlls/gdiplus/image.c
+2
-6
No files found.
dlls/gdiplus/image.c
View file @
35fc9c12
...
...
@@ -1821,7 +1821,6 @@ static GpStatus get_screen_resolution(REAL *xres, REAL *yres)
GpStatus
WINGDIPAPI
GdipCreateBitmapFromScan0
(
INT
width
,
INT
height
,
INT
stride
,
PixelFormat
format
,
BYTE
*
scan0
,
GpBitmap
**
bitmap
)
{
BITMAPINFO
*
pbmi
;
HBITMAP
hbitmap
=
NULL
;
INT
row_size
,
dib_stride
;
BYTE
*
bits
=
NULL
,
*
own_bits
=
NULL
;
...
...
@@ -1851,9 +1850,8 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride,
if
(
format
&
PixelFormatGDI
&&
!
(
format
&
(
PixelFormatAlpha
|
PixelFormatIndexed
))
&&
!
scan0
)
{
pbmi
=
GdipAlloc
(
sizeof
(
BITMAPINFOHEADER
)
+
256
*
sizeof
(
RGBQUAD
));
if
(
!
pbmi
)
return
OutOfMemory
;
char
bmibuf
[
FIELD_OFFSET
(
BITMAPINFO
,
bmiColors
[
256
])];
BITMAPINFO
*
pbmi
=
(
BITMAPINFO
*
)
bmibuf
;
pbmi
->
bmiHeader
.
biSize
=
sizeof
(
BITMAPINFOHEADER
);
pbmi
->
bmiHeader
.
biWidth
=
width
;
...
...
@@ -1870,8 +1868,6 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride,
hbitmap
=
CreateDIBSection
(
0
,
pbmi
,
DIB_RGB_COLORS
,
(
void
**
)
&
bits
,
NULL
,
0
);
GdipFree
(
pbmi
);
if
(
!
hbitmap
)
return
GenericError
;
stride
=
dib_stride
;
...
...
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