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
0571af43
Commit
0571af43
authored
Jun 16, 2000
by
Ken Coleman
Committed by
Alexandre Julliard
Jun 16, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes to CreateDIBSection and other areas where biSizeImage is
incorrectly assumed to be correct if it non-zero. This fixes a crashing problem in Sid Meier's Alpha Centauri.
parent
f70cd822
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
dib.c
graphics/x11drv/dib.c
+15
-5
No files found.
graphics/x11drv/dib.c
View file @
0571af43
...
...
@@ -3053,7 +3053,11 @@ static void X11DRV_DIB_DoProtectDIBSection( BITMAPOBJ *bmp, DWORD new_prot )
DIBSECTION
*
dib
=
bmp
->
dib
;
INT
effHeight
=
dib
->
dsBm
.
bmHeight
>=
0
?
dib
->
dsBm
.
bmHeight
:
-
dib
->
dsBm
.
bmHeight
;
INT
totalSize
=
dib
->
dsBmih
.
biSizeImage
?
dib
->
dsBmih
.
biSizeImage
/* use the biSizeImage data as the memory size only if we're dealing with a
compressed image where the value is set. Otherwise, calculate based on
width * height */
INT
totalSize
=
dib
->
dsBmih
.
biSizeImage
&&
dib
->
dsBmih
.
biCompression
!=
BI_RGB
?
dib
->
dsBmih
.
biSizeImage
:
dib
->
dsBm
.
bmWidthBytes
*
effHeight
;
DWORD
old_prot
;
...
...
@@ -3273,8 +3277,12 @@ HBITMAP16 X11DRV_DIB_CreateDIBSection16(
DIBSECTION
*
dib
=
bmp
->
dib
;
INT
height
=
dib
->
dsBm
.
bmHeight
>=
0
?
dib
->
dsBm
.
bmHeight
:
-
dib
->
dsBm
.
bmHeight
;
INT
size
=
dib
->
dsBmih
.
biSizeImage
?
dib
->
dsBmih
.
biSizeImage
:
dib
->
dsBm
.
bmWidthBytes
*
height
;
/* same as above - only use biSizeImage as the correct size if it a
compressed image and it's currently non-zero. In other cases, use
width * height as the value. */
INT
size
=
dib
->
dsBmih
.
biSizeImage
&&
dib
->
dsBmih
.
biCompression
!=
BI_RGB
?
dib
->
dsBmih
.
biSizeImage
:
dib
->
dsBm
.
bmWidthBytes
*
height
;
if
(
dib
->
dsBm
.
bmBits
)
{
((
X11DRV_DIBSECTION
*
)
bmp
->
dib
)
->
selector
=
...
...
@@ -3393,8 +3401,10 @@ HBITMAP X11DRV_DIB_CreateDIBSection(
bm
.
bmBitsPixel
=
bi
->
biBitCount
;
bm
.
bmBits
=
NULL
;
/* Get storage location for DIB bits */
totalSize
=
bi
->
biSizeImage
?
bi
->
biSizeImage
:
bm
.
bmWidthBytes
*
effHeight
;
/* Get storage location for DIB bits. Only use biSizeImage if it's valid and
we're dealing with a compressed bitmap. Otherwise, use width * height. */
totalSize
=
bi
->
biSizeImage
&&
bi
->
biCompression
!=
BI_RGB
?
bi
->
biSizeImage
:
bm
.
bmWidthBytes
*
effHeight
;
if
(
section
)
bm
.
bmBits
=
MapViewOfFile
(
section
,
FILE_MAP_ALL_ACCESS
,
...
...
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