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
ce5763b8
Commit
ce5763b8
authored
Feb 24, 2011
by
Wolfram Sang
Committed by
Alexandre Julliard
Feb 28, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Make DIB_GetBitmapInfo checks stricter.
parent
25923d2f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
2 deletions
+31
-2
cursoricon.c
dlls/user32/cursoricon.c
+4
-2
cursoricon.c
dlls/user32/tests/cursoricon.c
+27
-0
No files found.
dlls/user32/cursoricon.c
View file @
ce5763b8
...
...
@@ -372,7 +372,9 @@ static int DIB_GetBitmapInfo( const BITMAPINFOHEADER *header, LONG *width,
*
compr
=
0
;
return
0
;
}
else
if
(
header
->
biSize
>=
sizeof
(
BITMAPINFOHEADER
))
else
if
(
header
->
biSize
==
sizeof
(
BITMAPINFOHEADER
)
||
header
->
biSize
==
sizeof
(
BITMAPV4HEADER
)
||
header
->
biSize
==
sizeof
(
BITMAPV5HEADER
))
{
*
width
=
header
->
biWidth
;
*
height
=
header
->
biHeight
;
...
...
@@ -380,7 +382,7 @@ static int DIB_GetBitmapInfo( const BITMAPINFOHEADER *header, LONG *width,
*
compr
=
header
->
biCompression
;
return
1
;
}
ERR
(
"(%d): unknown/wrong size for header
\n
"
,
header
->
biSize
);
WARN
(
"unknown/wrong size (%u) for header
\n
"
,
header
->
biSize
);
return
-
1
;
}
...
...
dlls/user32/tests/cursoricon.c
View file @
ce5763b8
...
...
@@ -765,6 +765,24 @@ static unsigned char gif4pixel[42] = {
0x02
,
0x00
,
0x00
,
0x02
,
0x03
,
0x14
,
0x16
,
0x05
,
0x00
,
0x3b
};
static
const
DWORD
biSize_tests
[]
=
{
0
,
sizeof
(
BITMAPCOREHEADER
)
-
1
,
sizeof
(
BITMAPCOREHEADER
)
+
1
,
sizeof
(
BITMAPINFOHEADER
)
-
1
,
sizeof
(
BITMAPINFOHEADER
)
+
1
,
sizeof
(
BITMAPV4HEADER
)
-
1
,
sizeof
(
BITMAPV4HEADER
)
+
1
,
sizeof
(
BITMAPV5HEADER
)
-
1
,
sizeof
(
BITMAPV5HEADER
)
+
1
,
(
sizeof
(
BITMAPCOREHEADER
)
+
sizeof
(
BITMAPINFOHEADER
))
/
2
,
(
sizeof
(
BITMAPV4HEADER
)
+
sizeof
(
BITMAPV5HEADER
))
/
2
,
0xdeadbeef
,
0xffffffff
};
#define ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
static
void
test_LoadImageBitmap
(
const
char
*
test_desc
,
HBITMAP
hbm
)
{
BITMAP
bm
;
...
...
@@ -856,6 +874,7 @@ static void test_LoadImage(void)
CURSORICONFILEDIRENTRY
*
icon_entry
;
BITMAPINFOHEADER
*
icon_header
,
*
bitmap_header
;
ICONINFO
icon_info
;
int
i
;
#define ICON_WIDTH 32
#define ICON_HEIGHT 32
...
...
@@ -992,8 +1011,16 @@ static void test_LoadImage(void)
bitmap_header
->
biWidth
=
65536
;
test_LoadImageFile
(
"BMP (too wide)"
,
bmpimage
,
sizeof
(
bmpimage
),
"bmp"
,
0
);
bitmap_header
->
biWidth
=
1
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
biSize_tests
);
i
++
)
{
bitmap_header
->
biSize
=
biSize_tests
[
i
];
test_LoadImageFile
(
"BMP (broken biSize)"
,
bmpimage
,
sizeof
(
bmpimage
),
"bmp"
,
0
);
}
bitmap_header
->
biSize
=
sizeof
(
BITMAPINFOHEADER
);
}
#undef ARRAY_SIZE
static
void
test_CreateIconFromResource
(
void
)
{
HANDLE
handle
;
...
...
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