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
653c4140
Commit
653c4140
authored
Mar 10, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Added an exception handler to catch bad pointers in X11DRV_SetImageBits.
parent
5953a86a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
dib.c
dlls/winex11.drv/dib.c
+13
-2
No files found.
dlls/winex11.drv/dib.c
View file @
653c4140
...
...
@@ -39,7 +39,7 @@
#include "winbase.h"
#include "wingdi.h"
#include "x11drv.h"
#include "
excpt
.h"
#include "
wine/exception
.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
bitmap
);
...
...
@@ -3539,6 +3539,8 @@ static int X11DRV_DIB_SetImageBits( const X11DRV_DIB_IMAGEBITS_DESCR *descr )
bmpImage
->
red_mask
,
bmpImage
->
green_mask
,
bmpImage
->
blue_mask
);
/* Transfer the pixels */
__TRY
{
switch
(
descr
->
infoBpp
)
{
case
1
:
...
...
@@ -3598,6 +3600,13 @@ static int X11DRV_DIB_SetImageBits( const X11DRV_DIB_IMAGEBITS_DESCR *descr )
WARN
(
"(%d): Invalid depth
\n
"
,
descr
->
infoBpp
);
break
;
}
}
__EXCEPT_PAGE_FAULT
{
WARN
(
"invalid bits pointer %p
\n
"
,
descr
->
bits
);
lines
=
0
;
}
__ENDTRY
TRACE
(
"XPutImage(%ld,%p,%p,%d,%d,%d,%d,%d,%d)
\n
"
,
descr
->
drawable
,
descr
->
gc
,
bmpImage
,
...
...
@@ -3605,6 +3614,8 @@ static int X11DRV_DIB_SetImageBits( const X11DRV_DIB_IMAGEBITS_DESCR *descr )
descr
->
width
,
descr
->
height
);
wine_tsx11_lock
();
if
(
lines
)
{
#ifdef HAVE_LIBXXSHM
if
(
descr
->
image
&&
descr
->
useShm
)
{
...
...
@@ -3618,7 +3629,7 @@ static int X11DRV_DIB_SetImageBits( const X11DRV_DIB_IMAGEBITS_DESCR *descr )
XPutImage
(
gdi_display
,
descr
->
drawable
,
descr
->
gc
,
bmpImage
,
descr
->
xSrc
,
descr
->
ySrc
,
descr
->
xDest
,
descr
->
yDest
,
descr
->
width
,
descr
->
height
);
}
if
(
!
descr
->
image
)
XDestroyImage
(
bmpImage
);
wine_tsx11_unlock
();
return
lines
;
...
...
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