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
811cdfaf
Commit
811cdfaf
authored
Jul 20, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Reject invalid DIB depths in CreateDIBSection.
parent
21ced8dd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
28 deletions
+36
-28
dib.c
dlls/gdi32/dib.c
+2
-3
bitmap.c
dlls/gdi32/tests/bitmap.c
+1
-1
graphics.c
dlls/gdiplus/tests/graphics.c
+33
-24
No files found.
dlls/gdi32/dib.c
View file @
811cdfaf
...
...
@@ -1261,11 +1261,10 @@ HBITMAP WINAPI CreateDIBSection(HDC hdc, CONST BITMAPINFO *bmi, UINT usage,
case
8
:
case
24
:
if
(
compression
==
BI_RGB
)
break
;
/* fall through */
default:
WARN
(
"invalid %u bpp compression %u
\n
"
,
bpp
,
compression
);
return
0
;
default:
FIXME
(
"should fail %u bpp compression %u
\n
"
,
bpp
,
compression
);
break
;
}
if
(
!
(
dib
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
dib
)
)))
return
0
;
...
...
dlls/gdi32/tests/bitmap.c
View file @
811cdfaf
...
...
@@ -554,7 +554,7 @@ static void test_dibsections(void)
if
(
i
==
1
||
i
==
4
||
i
==
8
||
i
==
16
||
i
==
24
||
i
==
32
)
ok
(
hdib
!=
NULL
,
"CreateDIBSection bpp %u
\n
"
,
i
);
else
todo_wine
ok
(
hdib
==
NULL
,
"CreateDIBSection bpp %u succeeded
\n
"
,
i
);
ok
(
hdib
==
NULL
,
"CreateDIBSection bpp %u succeeded
\n
"
,
i
);
if
(
hdib
)
DeleteObject
(
hdib
);
}
...
...
dlls/gdiplus/tests/graphics.c
View file @
811cdfaf
...
...
@@ -2346,34 +2346,43 @@ static void test_GdipGetNearestColor(void)
GdipDisposeImage
((
GpImage
*
)
bitmap
);
status
=
GdipCreateBitmapFromScan0
(
10
,
10
,
10
,
PixelFormat48bppRGB
,
NULL
,
&
bitmap
);
expect
(
Ok
,
status
);
status
=
GdipGetImageGraphicsContext
((
GpImage
*
)
bitmap
,
&
graphics
);
expect
(
Ok
,
status
);
status
=
GdipGetNearestColor
(
graphics
,
&
color
);
expect
(
Ok
,
status
);
expect
(
0xdeadbeef
,
color
);
GdipDeleteGraphics
(
graphics
);
GdipDisposeImage
((
GpImage
*
)
bitmap
);
todo_wine
expect
(
Ok
,
status
);
if
(
status
==
Ok
)
{
status
=
GdipGetImageGraphicsContext
((
GpImage
*
)
bitmap
,
&
graphics
);
expect
(
Ok
,
status
);
status
=
GdipGetNearestColor
(
graphics
,
&
color
);
expect
(
Ok
,
status
);
expect
(
0xdeadbeef
,
color
);
GdipDeleteGraphics
(
graphics
);
GdipDisposeImage
((
GpImage
*
)
bitmap
);
}
status
=
GdipCreateBitmapFromScan0
(
10
,
10
,
10
,
PixelFormat64bppARGB
,
NULL
,
&
bitmap
);
expect
(
Ok
,
status
);
status
=
GdipGetImageGraphicsContext
((
GpImage
*
)
bitmap
,
&
graphics
);
expect
(
Ok
,
status
);
status
=
GdipGetNearestColor
(
graphics
,
&
color
);
expect
(
Ok
,
status
);
expect
(
0xdeadbeef
,
color
);
GdipDeleteGraphics
(
graphics
);
GdipDisposeImage
((
GpImage
*
)
bitmap
);
todo_wine
expect
(
Ok
,
status
);
if
(
status
==
Ok
)
{
status
=
GdipGetImageGraphicsContext
((
GpImage
*
)
bitmap
,
&
graphics
);
expect
(
Ok
,
status
);
status
=
GdipGetNearestColor
(
graphics
,
&
color
);
expect
(
Ok
,
status
);
expect
(
0xdeadbeef
,
color
);
GdipDeleteGraphics
(
graphics
);
GdipDisposeImage
((
GpImage
*
)
bitmap
);
}
status
=
GdipCreateBitmapFromScan0
(
10
,
10
,
10
,
PixelFormat64bppPARGB
,
NULL
,
&
bitmap
);
expect
(
Ok
,
status
);
status
=
GdipGetImageGraphicsContext
((
GpImage
*
)
bitmap
,
&
graphics
);
expect
(
Ok
,
status
);
status
=
GdipGetNearestColor
(
graphics
,
&
color
);
expect
(
Ok
,
status
);
expect
(
0xdeadbeef
,
color
);
GdipDeleteGraphics
(
graphics
);
GdipDisposeImage
((
GpImage
*
)
bitmap
);
todo_wine
expect
(
Ok
,
status
);
if
(
status
==
Ok
)
{
status
=
GdipGetImageGraphicsContext
((
GpImage
*
)
bitmap
,
&
graphics
);
expect
(
Ok
,
status
);
status
=
GdipGetNearestColor
(
graphics
,
&
color
);
expect
(
Ok
,
status
);
expect
(
0xdeadbeef
,
color
);
GdipDeleteGraphics
(
graphics
);
GdipDisposeImage
((
GpImage
*
)
bitmap
);
}
status
=
GdipCreateBitmapFromScan0
(
10
,
10
,
10
,
PixelFormat16bppRGB565
,
NULL
,
&
bitmap
);
expect
(
Ok
,
status
);
...
...
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