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
cd67edd3
Commit
cd67edd3
authored
Nov 08, 1998
by
Eric Pouech
Committed by
Alexandre Julliard
Nov 08, 1998
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent CreateDIBSection from seg faulting when one dimension of
section is 0.
parent
dc163422
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
11 deletions
+20
-11
dib.c
objects/dib.c
+20
-11
No files found.
objects/dib.c
View file @
cd67edd3
...
...
@@ -979,12 +979,17 @@ HBITMAP32 WINAPI CreateDIBSection32 (HDC32 hdc, BITMAPINFO *bmi, UINT32 usage,
if
(
dib
)
{
res
=
CreateDIBitmap32
(
hdc
,
bi
,
0
,
NULL
,
bmi
,
usage
);
bmp
=
(
BITMAPOBJ
*
)
GDI_GetObjPtr
(
res
,
BITMAP_MAGIC
);
if
(
bmp
)
bmp
->
dib
=
dib
;
/* HACK for now */
if
(
!
bmp
->
DDBitmap
)
X11DRV_CreateBitmap
(
res
);
if
(
res
)
{
bmp
=
(
BITMAPOBJ
*
)
GDI_GetObjPtr
(
res
,
BITMAP_MAGIC
);
if
(
bmp
)
{
bmp
->
dib
=
dib
;
/* HACK for now */
if
(
!
bmp
->
DDBitmap
)
X11DRV_CreateBitmap
(
res
);
}
}
}
/* Create XImage */
...
...
@@ -994,6 +999,8 @@ HBITMAP32 WINAPI CreateDIBSection32 (HDC32 hdc, BITMAPINFO *bmi, UINT32 usage,
/* Clean up in case of errors */
if
(
!
res
||
!
bmp
||
!
dib
||
!
bm
.
bmBits
||
(
bm
.
bmBitsPixel
<=
8
&&
!
colorMap
))
{
TRACE
(
bitmap
,
"got an error res=%lu, bmp=%p, dib=%p, bm.bmBits=%p
\n
"
,
res
,
bmp
,
dib
,
bm
.
bmBits
);
if
(
bm
.
bmBits
)
{
if
(
section
)
...
...
@@ -1002,19 +1009,21 @@ HBITMAP32 WINAPI CreateDIBSection32 (HDC32 hdc, BITMAPINFO *bmi, UINT32 usage,
VirtualFree
(
bm
.
bmBits
,
MEM_RELEASE
,
0L
),
bm
.
bmBits
=
NULL
;
}
if
(
dib
->
image
)
XDestroyImage
(
dib
->
image
),
dib
->
image
=
NULL
;
if
(
colorMap
)
HeapFree
(
GetProcessHeap
(),
0
,
colorMap
),
colorMap
=
NULL
;
if
(
dib
)
HeapFree
(
GetProcessHeap
(),
0
,
dib
),
dib
=
NULL
;
if
(
res
)
DeleteObject32
(
res
),
res
=
0
;
if
(
dib
&&
dib
->
image
)
{
XDestroyImage
(
dib
->
image
);
dib
->
image
=
NULL
;
}
if
(
colorMap
)
{
HeapFree
(
GetProcessHeap
(),
0
,
colorMap
);
colorMap
=
NULL
;
}
if
(
dib
)
{
HeapFree
(
GetProcessHeap
(),
0
,
dib
);
dib
=
NULL
;
}
if
(
res
)
{
DeleteObject32
(
res
);
res
=
0
;
}
}
/* Install fault handler, if possible */
if
(
bm
.
bmBits
)
{
if
(
VIRTUAL_SetFaultHandler
(
bm
.
bmBits
,
DIB_FaultHandler
,
(
LPVOID
)
res
))
{
DIB_DoProtectDIBSection
(
bmp
,
PAGE_READONLY
);
dib
->
status
=
DIB_InSync
;
if
(
dib
)
dib
->
status
=
DIB_InSync
;
}
}
/* Return BITMAP handle and storage location */
if
(
res
)
GDI_HEAP_UNLOCK
(
res
);
...
...
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