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
08aded43
Commit
08aded43
authored
Jan 05, 2015
by
Henri Verbeet
Committed by
Alexandre Julliard
Jan 05, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Reject wined3d_texture_create() calls without explicit level count.
parent
be6575ef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
27 deletions
+12
-27
texture.c
dlls/wined3d/texture.c
+12
-27
No files found.
dlls/wined3d/texture.c
View file @
08aded43
...
...
@@ -1022,18 +1022,11 @@ static HRESULT cubetexture_init(struct wined3d_texture *texture, const struct wi
return
WINED3DERR_INVALIDCALL
;
}
if
(
levels
>
1
)
if
(
levels
!=
1
)
{
WARN
(
"
D3DUSAGE_AUTOGENMIPMAP is set, and level count >
1, returning D3DERR_INVALIDCALL.
\n
"
);
WARN
(
"
WINED3DUSAGE_AUTOGENMIPMAP is set, and level count !=
1, returning D3DERR_INVALIDCALL.
\n
"
);
return
WINED3DERR_INVALIDCALL
;
}
levels
=
1
;
}
else
if
(
!
levels
)
{
levels
=
wined3d_log2i
(
desc
->
width
)
+
1
;
TRACE
(
"Calculated levels = %u.
\n
"
,
levels
);
}
if
(
!
gl_info
->
supported
[
ARB_TEXTURE_NON_POWER_OF_TWO
])
...
...
@@ -1168,18 +1161,11 @@ static HRESULT texture_init(struct wined3d_texture *texture, const struct wined3
return
WINED3DERR_INVALIDCALL
;
}
if
(
levels
>
1
)
if
(
levels
!=
1
)
{
WARN
(
"
D3DUSAGE_AUTOGENMIPMAP is set, and level count >
1, returning WINED3DERR_INVALIDCALL.
\n
"
);
WARN
(
"
WINED3DUSAGE_AUTOGENMIPMAP is set, and level count !=
1, returning WINED3DERR_INVALIDCALL.
\n
"
);
return
WINED3DERR_INVALIDCALL
;
}
levels
=
1
;
}
else
if
(
!
levels
)
{
levels
=
wined3d_log2i
(
max
(
desc
->
width
,
desc
->
height
))
+
1
;
TRACE
(
"Calculated levels = %u.
\n
"
,
levels
);
}
if
(
FAILED
(
hr
=
wined3d_texture_init
(
texture
,
&
texture2d_ops
,
1
,
levels
,
desc
,
...
...
@@ -1366,18 +1352,11 @@ static HRESULT volumetexture_init(struct wined3d_texture *texture, const struct
return
WINED3DERR_INVALIDCALL
;
}
if
(
levels
>
1
)
if
(
levels
!=
1
)
{
WARN
(
"
D3DUSAGE_AUTOGENMIPMAP is set, and level count >
1, returning D3DERR_INVALIDCALL.
\n
"
);
WARN
(
"
WINED3DUSAGE_AUTOGENMIPMAP is set, and level count !=
1, returning D3DERR_INVALIDCALL.
\n
"
);
return
WINED3DERR_INVALIDCALL
;
}
levels
=
1
;
}
else
if
(
!
levels
)
{
levels
=
wined3d_log2i
(
max
(
max
(
desc
->
width
,
desc
->
height
),
desc
->
depth
))
+
1
;
TRACE
(
"Calculated levels = %u.
\n
"
,
levels
);
}
if
(
!
gl_info
->
supported
[
ARB_TEXTURE_NON_POWER_OF_TWO
])
...
...
@@ -1456,6 +1435,12 @@ HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct
TRACE
(
"device %p, desc %p, level_count %u, surface_flags %#x, parent %p, parent_ops %p, texture %p.
\n
"
,
device
,
desc
,
level_count
,
surface_flags
,
parent
,
parent_ops
,
texture
);
if
(
!
level_count
)
{
WARN
(
"Invalid level count.
\n
"
);
return
WINED3DERR_INVALIDCALL
;
}
if
(
!
(
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
...
...
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