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
0ad6af9c
Commit
0ad6af9c
authored
Jul 03, 2012
by
Józef Kucia
Committed by
Alexandre Julliard
Jul 09, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Validate the size of a volume texture in D3DXGetImageInfoFromFile.
parent
563355d6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
surface.c
dlls/d3dx9_36/surface.c
+6
-3
surface.c
dlls/d3dx9_36/tests/surface.c
+1
-1
No files found.
dlls/d3dx9_36/surface.c
View file @
0ad6af9c
...
...
@@ -317,8 +317,8 @@ static HRESULT calculate_dds_surface_size(const D3DXIMAGE_INFO *img_info,
static
HRESULT
get_image_info_from_dds
(
const
void
*
buffer
,
UINT
length
,
D3DXIMAGE_INFO
*
info
)
{
UINT
i
;
UINT
faces
=
0
;
UINT
width
,
height
;
UINT
faces
=
1
;
UINT
width
,
height
,
depth
;
const
struct
dds_header
*
header
=
buffer
;
UINT
expected_length
=
0
;
...
...
@@ -347,6 +347,7 @@ static HRESULT get_image_info_from_dds(const void *buffer, UINT length, D3DXIMAG
else
if
(
header
->
caps2
&
DDS_CAPS2_CUBEMAP
)
{
DWORD
face
;
faces
=
0
;
for
(
face
=
DDS_CAPS2_CUBEMAP_POSITIVEX
;
face
<=
DDS_CAPS2_CUBEMAP_NEGATIVEZ
;
face
<<=
1
)
{
if
(
header
->
caps2
&
face
)
...
...
@@ -356,20 +357,22 @@ static HRESULT get_image_info_from_dds(const void *buffer, UINT length, D3DXIMAG
}
else
{
faces
=
1
;
info
->
ResourceType
=
D3DRTYPE_TEXTURE
;
}
/* calculate the expected length */
width
=
info
->
Width
;
height
=
info
->
Height
;
depth
=
info
->
Depth
;
for
(
i
=
0
;
i
<
info
->
MipLevels
;
i
++
)
{
UINT
pitch
,
size
=
0
;
calculate_dds_surface_size
(
info
,
width
,
height
,
&
pitch
,
&
size
);
size
*=
depth
;
expected_length
+=
size
;
width
=
max
(
1
,
width
/
2
);
height
=
max
(
1
,
height
/
2
);
depth
=
max
(
1
,
depth
/
2
);
}
expected_length
*=
faces
;
...
...
dlls/d3dx9_36/tests/surface.c
View file @
0ad6af9c
...
...
@@ -544,7 +544,7 @@ static void test_D3DXGetImageInfo(void)
ok
(
hr
==
D3DXERR_INVALIDDATA
,
"D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x
\n
"
,
hr
,
D3DXERR_INVALIDDATA
);
hr
=
D3DXGetImageInfoFromFileInMemory
(
dds_volume_map
,
sizeof
(
dds_volume_map
)
-
1
,
&
info
);
todo_wine
ok
(
hr
==
D3DXERR_INVALIDDATA
,
"D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x
\n
"
,
hr
,
D3DXERR_INVALIDDATA
);
ok
(
hr
==
D3DXERR_INVALIDDATA
,
"D3DXGetImageInfoFromFileInMemory returned %#x, expected %#x
\n
"
,
hr
,
D3DXERR_INVALIDDATA
);
/* cleanup */
...
...
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