Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zsolt Vadász
wine
Commits
1d8ef194
Commit
1d8ef194
authored
23 years ago
by
Andreas Mohr
Committed by
Alexandre Julliard
23 years ago
Browse files
Options
Downloads
Patches
Plain Diff
DIB_GetBitmapInfo didn't recognize BITMAPV4/5HEADER.
parent
bb72c3d5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
objects/dib.c
+40
-3
40 additions, 3 deletions
objects/dib.c
with
40 additions
and
3 deletions
objects/dib.c
+
40
−
3
View file @
1d8ef194
...
...
@@ -88,7 +88,8 @@ int DIB_BitmapInfoSize( const BITMAPINFO * info, WORD coloruse )
* DIB_GetBitmapInfo
*
* Get the info from a bitmap header.
* Return 1 for INFOHEADER, 0 for COREHEADER, -1 for error.
* Return 1 for INFOHEADER, 0 for COREHEADER,
* 4 for V4HEADER, 5 for V5HEADER, -1 for error.
*/
int
DIB_GetBitmapInfo
(
const
BITMAPINFOHEADER
*
header
,
DWORD
*
width
,
int
*
height
,
WORD
*
bpp
,
WORD
*
compr
)
...
...
@@ -110,7 +111,25 @@ int DIB_GetBitmapInfo( const BITMAPINFOHEADER *header, DWORD *width,
*
compr
=
0
;
return
0
;
}
WARN
(
"(%ld): wrong size for header
\n
"
,
header
->
biSize
);
if
(
header
->
biSize
==
sizeof
(
BITMAPV4HEADER
))
{
BITMAPV4HEADER
*
v4hdr
=
(
BITMAPV4HEADER
*
)
header
;
*
width
=
v4hdr
->
bV4Width
;
*
height
=
v4hdr
->
bV4Height
;
*
bpp
=
v4hdr
->
bV4BitCount
;
*
compr
=
v4hdr
->
bV4Compression
;
return
4
;
}
if
(
header
->
biSize
==
sizeof
(
BITMAPV5HEADER
))
{
BITMAPV5HEADER
*
v5hdr
=
(
BITMAPV5HEADER
*
)
header
;
*
width
=
v5hdr
->
bV5Width
;
*
height
=
v5hdr
->
bV5Height
;
*
bpp
=
v5hdr
->
bV5BitCount
;
*
compr
=
v5hdr
->
bV5Compression
;
return
5
;
}
ERR
(
"(%ld): unknown/wrong size for header
\n
"
,
header
->
biSize
);
return
-
1
;
}
...
...
@@ -825,9 +844,27 @@ HBITMAP WINAPI CreateDIBitmap( HDC hdc, const BITMAPINFOHEADER *header,
}
else
fColor
=
TRUE
;
}
else
if
(
data
->
bmiHeader
.
biSize
==
sizeof
(
BITMAPV4HEADER
))
{
/* FIXME: correct ? */
RGBQUAD
*
rgb
=
data
->
bmiColors
;
DWORD
col
=
RGB
(
rgb
->
rgbRed
,
rgb
->
rgbGreen
,
rgb
->
rgbBlue
);
/* Check if the first color of the colormap is black */
if
((
col
==
RGB
(
0
,
0
,
0
)))
{
rgb
++
;
col
=
RGB
(
rgb
->
rgbRed
,
rgb
->
rgbGreen
,
rgb
->
rgbBlue
);
/* If the second color is white, create a monochrome bitmap */
fColor
=
(
col
!=
RGB
(
0xff
,
0xff
,
0xff
));
}
/* Note : If the first color of the colormap is white
followed by black, we have to create a color bitmap.
If we don't the white will be displayed in black later on!*/
else
fColor
=
TRUE
;
}
else
{
WARN
(
"(%ld): wrong size for data
\n
"
,
ERR
(
"(%ld): wrong
/unknown
size for data
\n
"
,
data
->
bmiHeader
.
biSize
);
return
0
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment