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
778ea236
Commit
778ea236
authored
Sep 28, 2008
by
Lei Zhang
Committed by
Alexandre Julliard
Sep 30, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Allocate enough space for BITMAPINFO in GdipBitmapUnlockBits.
parent
2309a9e4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
image.c
dlls/gdiplus/image.c
+9
-7
No files found.
dlls/gdiplus/image.c
View file @
778ea236
...
...
@@ -197,7 +197,7 @@ GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap* bitmap,
HDC
hdc
;
HBITMAP
old
=
NULL
;
BOOL
bm_is_selected
;
BITMAPINFO
bmi
;
BITMAPINFO
*
p
bmi
;
if
(
!
bitmap
||
!
lockeddata
)
return
InvalidParameter
;
...
...
@@ -221,24 +221,26 @@ GpStatus WINGDIPAPI GdipBitmapUnlockBits(GpBitmap* bitmap,
IPicture_get_CurDC
(
bitmap
->
image
.
picture
,
&
hdc
);
bm_is_selected
=
(
hdc
!=
0
);
bmi
.
bmiHeader
.
biSize
=
sizeof
(
BITMAPINFOHEADER
);
bmi
.
bmiHeader
.
biBitCount
=
0
;
pbmi
=
GdipAlloc
(
sizeof
(
BITMAPINFOHEADER
)
+
256
*
sizeof
(
RGBQUAD
));
pbmi
->
bmiHeader
.
biSize
=
sizeof
(
BITMAPINFOHEADER
);
pbmi
->
bmiHeader
.
biBitCount
=
0
;
if
(
!
bm_is_selected
){
hdc
=
CreateCompatibleDC
(
0
);
old
=
SelectObject
(
hdc
,
(
HBITMAP
)
hbm
);
}
GetDIBits
(
hdc
,
(
HBITMAP
)
hbm
,
0
,
0
,
NULL
,
&
bmi
,
DIB_RGB_COLORS
);
bmi
.
bmiHeader
.
biBitCount
=
PIXELFORMATBPP
(
lockeddata
->
PixelFormat
);
SetDIBits
(
hdc
,
(
HBITMAP
)
hbm
,
0
,
abs
(
bmi
.
bmiHeader
.
biHeight
),
bitmap
->
bitmapbits
,
&
bmi
,
DIB_RGB_COLORS
);
GetDIBits
(
hdc
,
(
HBITMAP
)
hbm
,
0
,
0
,
NULL
,
p
bmi
,
DIB_RGB_COLORS
);
pbmi
->
bmiHeader
.
biBitCount
=
PIXELFORMATBPP
(
lockeddata
->
PixelFormat
);
SetDIBits
(
hdc
,
(
HBITMAP
)
hbm
,
0
,
abs
(
pbmi
->
bmiHeader
.
biHeight
),
bitmap
->
bitmapbits
,
p
bmi
,
DIB_RGB_COLORS
);
if
(
!
bm_is_selected
){
SelectObject
(
hdc
,
old
);
DeleteDC
(
hdc
);
}
GdipFree
(
pbmi
);
GdipFree
(
bitmap
->
bitmapbits
);
bitmap
->
bitmapbits
=
NULL
;
bitmap
->
lockmode
=
0
;
...
...
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