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
cfae1ceb
Commit
cfae1ceb
authored
May 13, 2022
by
Alistair Leslie-Hughes
Committed by
Alexandre Julliard
Sep 14, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3drm: Correct D3DRMIMAGE validation.
parent
e85cab70
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
7 deletions
+37
-7
d3drm.c
dlls/d3drm/tests/d3drm.c
+17
-0
texture.c
dlls/d3drm/texture.c
+20
-7
No files found.
dlls/d3drm/tests/d3drm.c
View file @
cfae1ceb
...
...
@@ -2724,6 +2724,12 @@ static void test_Texture(void)
TRUE
,
0
,
(
void
*
)
0xcafebabe
,
NULL
,
0x000000ff
,
0x0000ff00
,
0x00ff0000
,
0
,
0
,
NULL
},
testimg_palette
=
{
2
,
2
,
1
,
1
,
32
,
FALSE
,
2
*
sizeof
(
DWORD
),
(
void
*
)
0xcafebabe
,
NULL
,
0x00000000
,
0x00000000
,
0x00000000
,
0
,
2
,
(
void
*
)
0xcafebabe
},
*
d3drm_img
=
NULL
;
DWORD
pixel
[
4
]
=
{
20000
,
30000
,
10000
,
0
};
...
...
@@ -2785,6 +2791,17 @@ static void test_Texture(void)
IDirect3DRMTexture2_Release
(
texture2
);
IDirect3DRMTexture3_Release
(
texture3
);
/* Just palette set */
hr
=
IDirect3DRM_CreateTexture
(
d3drm1
,
&
testimg_palette
,
&
texture1
);
ok
(
SUCCEEDED
(
hr
),
"Cannot get IDirect3DRMTexture interface, hr %#lx
\n
"
,
hr
);
hr
=
IDirect3DRM2_CreateTexture
(
d3drm2
,
&
testimg_palette
,
&
texture2
);
ok
(
SUCCEEDED
(
hr
),
"Cannot get IDirect3DRMTexture2 interface, hr %#lx
\n
"
,
hr
);
hr
=
IDirect3DRM3_CreateTexture
(
d3drm3
,
&
testimg_palette
,
&
texture3
);
ok
(
SUCCEEDED
(
hr
),
"Cannot get IDirect3DRMTexture3 interface, hr %#lx
\n
"
,
hr
);
IDirect3DRMTexture_Release
(
texture1
);
IDirect3DRMTexture2_Release
(
texture2
);
IDirect3DRMTexture3_Release
(
texture3
);
initimg
.
rgb
=
0
;
texture1
=
(
IDirect3DRMTexture
*
)
0xdeadbeef
;
hr
=
IDirect3DRM_CreateTexture
(
d3drm1
,
&
initimg
,
&
texture1
);
...
...
dlls/d3drm/texture.c
View file @
cfae1ceb
...
...
@@ -52,14 +52,27 @@ static void d3drm_texture_destroy(struct d3drm_texture *texture)
static
BOOL
d3drm_validate_image
(
D3DRMIMAGE
*
image
)
{
if
(
!
image
||
!
image
->
red_mask
||
!
image
->
green_mask
||
!
image
->
blue_mask
||
!
image
->
buffer1
||
!
(
image
->
rgb
||
(
image
->
palette
&&
image
->
palette_size
)))
{
if
(
!
image
)
return
FALSE
;
TRACE
(
"size (%d, %d), aspect (%d, %d), depth %d, red %#lx, green %#lx, blue %#lx, "
"buffer1 %p, buffer2 %p, rgb %d, pal %p, size %d
\n
"
,
image
->
width
,
image
->
height
,
image
->
aspectx
,
image
->
aspecty
,
image
->
depth
,
image
->
red_mask
,
image
->
green_mask
,
image
->
blue_mask
,
image
->
buffer1
,
image
->
buffer2
,
image
->
rgb
,
image
->
palette
,
image
->
palette_size
);
if
(
!
image
->
buffer1
)
return
FALSE
;
if
(
image
->
rgb
)
{
if
(
!
image
->
red_mask
||
!
image
->
green_mask
||
!
image
->
blue_mask
)
return
FALSE
;
}
else
{
if
(
!
image
->
palette
||
!
image
->
palette_size
)
return
FALSE
;
}
return
TRUE
;
...
...
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