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
2453b6a8
Commit
2453b6a8
authored
Dec 08, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Add some sanity checks on bitmap formats before creating a pixmap.
parent
72fae39c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
21 deletions
+10
-21
bitmap.c
dlls/winex11.drv/bitmap.c
+10
-20
xrender.c
dlls/winex11.drv/xrender.c
+0
-1
No files found.
dlls/winex11.drv/bitmap.c
View file @
2453b6a8
...
...
@@ -130,6 +130,16 @@ BOOL X11DRV_create_phys_bitmap( HBITMAP hbitmap, const BITMAP *bitmap, int depth
{
X_PHYSBITMAP
*
physBitmap
;
if
(
bitmap
->
bmWidth
>
65535
||
bitmap
->
bmHeight
>
65535
||
bitmap
->
bmPlanes
!=
1
||
(
bitmap
->
bmBitsPixel
!=
1
&&
bitmap
->
bmBitsPixel
!=
screen_bpp
))
{
WARN
(
"Trying to create invalid pixmap %dx%d planes %d bpp %d
\n
"
,
bitmap
->
bmWidth
,
bitmap
->
bmHeight
,
bitmap
->
bmPlanes
,
bitmap
->
bmBitsPixel
);
return
FALSE
;
}
TRACE
(
"(%p) %dx%d %d bpp
\n
"
,
hbitmap
,
bitmap
->
bmWidth
,
bitmap
->
bmHeight
,
bitmap
->
bmBitsPixel
);
if
(
!
(
physBitmap
=
X11DRV_init_phys_bitmap
(
hbitmap
)))
return
FALSE
;
physBitmap
->
depth
=
depth
;
...
...
@@ -170,28 +180,8 @@ BOOL X11DRV_CreateBitmap( PHYSDEV dev, HBITMAP hbitmap )
if
(
!
GetObjectW
(
hbitmap
,
sizeof
(
bitmap
),
&
bitmap
))
return
FALSE
;
/* Check parameters */
if
(
bitmap
.
bmPlanes
!=
1
)
return
FALSE
;
/* check if bpp is compatible with screen depth */
if
(
!
((
bitmap
.
bmBitsPixel
==
1
)
||
(
bitmap
.
bmBitsPixel
==
screen_bpp
)))
{
WARN
(
"Trying to make bitmap with planes=%d, bpp=%d
\n
"
,
bitmap
.
bmPlanes
,
bitmap
.
bmBitsPixel
);
return
FALSE
;
}
TRACE
(
"(%p) %dx%d %d bpp
\n
"
,
hbitmap
,
bitmap
.
bmWidth
,
bitmap
.
bmHeight
,
bitmap
.
bmBitsPixel
);
if
(
bitmap
.
bmBitsPixel
==
1
)
{
if
(
hbitmap
==
BITMAP_stock_phys_bitmap
.
hbitmap
)
{
ERR
(
"called for stock bitmap, please report
\n
"
);
return
FALSE
;
}
return
X11DRV_create_phys_bitmap
(
hbitmap
,
&
bitmap
,
1
,
FALSE
,
NULL
);
}
return
X11DRV_create_phys_bitmap
(
hbitmap
,
&
bitmap
,
screen_depth
,
(
visual
->
class
==
TrueColor
||
visual
->
class
==
DirectColor
),
...
...
dlls/winex11.drv/xrender.c
View file @
2453b6a8
...
...
@@ -1303,7 +1303,6 @@ static BOOL xrenderdrv_CreateBitmap( PHYSDEV dev, HBITMAP hbitmap )
if
(
!
GetObjectW
(
hbitmap
,
sizeof
(
bitmap
),
&
bitmap
))
return
FALSE
;
if
(
bitmap
.
bmPlanes
!=
1
)
return
FALSE
;
format
=
get_bitmap_format
(
bitmap
.
bmBitsPixel
);
if
(
pict_formats
[
format
])
...
...
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