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
293ec584
Commit
293ec584
authored
Jan 15, 2008
by
Marcus Meissner
Committed by
Alexandre Julliard
Jan 16, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Check for overflows.
parent
e59bf8c5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
device.c
dlls/wined3d/device.c
+26
-0
No files found.
dlls/wined3d/device.c
View file @
293ec584
...
...
@@ -3178,6 +3178,12 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetSamplerState(IWineD3DDevice *iface,
Sampler
-=
(
WINED3DVERTEXTEXTURESAMPLER0
-
MAX_FRAGMENT_SAMPLERS
);
}
if
(
Sampler
>=
sizeof
(
This
->
stateBlock
->
samplerState
)
/
sizeof
(
This
->
stateBlock
->
samplerState
[
0
]))
{
ERR
(
"Current Sampler overflows sampleState0 array (sampler %d vs size %d)
\n
"
,
Sampler
,
sizeof
(
This
->
stateBlock
->
samplerState
)
/
sizeof
(
This
->
stateBlock
->
samplerState
[
0
])
);
return
WINED3D_OK
;
/* Windows accepts overflowing this array ... we do not. */
}
/**
* SetSampler is designed to allow for more than the standard up to 8 textures
* and Geforce has stopped supporting more than 6 standard textures in openGL.
...
...
@@ -3223,6 +3229,12 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetSamplerState(IWineD3DDevice *iface,
Sampler
-=
(
WINED3DVERTEXTEXTURESAMPLER0
-
MAX_FRAGMENT_SAMPLERS
);
}
if
(
Sampler
>=
sizeof
(
This
->
stateBlock
->
samplerState
)
/
sizeof
(
This
->
stateBlock
->
samplerState
[
0
]))
{
ERR
(
"Current Sampler overflows sampleState0 array (sampler %d vs size %d)
\n
"
,
Sampler
,
sizeof
(
This
->
stateBlock
->
samplerState
)
/
sizeof
(
This
->
stateBlock
->
samplerState
[
0
])
);
return
WINED3D_OK
;
/* Windows accepts overflowing this array ... we do not. */
}
*
Value
=
This
->
stateBlock
->
samplerState
[
Sampler
][
Type
];
TRACE
(
"(%p) : Returning %#x
\n
"
,
This
,
*
Value
);
...
...
@@ -4398,6 +4410,13 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetTexture(IWineD3DDevice *iface, DWORD
Stage
-=
(
WINED3DVERTEXTEXTURESAMPLER0
-
MAX_FRAGMENT_SAMPLERS
);
}
if
(
Stage
>=
sizeof
(
This
->
stateBlock
->
textures
)
/
sizeof
(
This
->
stateBlock
->
textures
[
0
]))
{
ERR
(
"Current stage overflows textures array (stage %d vs size %d)
\n
"
,
Stage
,
sizeof
(
This
->
stateBlock
->
textures
)
/
sizeof
(
This
->
stateBlock
->
textures
[
0
])
);
return
WINED3D_OK
;
/* Windows accepts overflowing this array ... we do not. */
}
oldTexture
=
This
->
updateStateBlock
->
textures
[
Stage
];
if
(
pTexture
!=
NULL
)
{
...
...
@@ -4490,6 +4509,13 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetTexture(IWineD3DDevice *iface, DWORD
Stage
-=
(
WINED3DVERTEXTEXTURESAMPLER0
-
MAX_FRAGMENT_SAMPLERS
);
}
if
(
Stage
>=
sizeof
(
This
->
stateBlock
->
textures
)
/
sizeof
(
This
->
stateBlock
->
textures
[
0
]))
{
ERR
(
"Current stage overflows textures array (stage %d vs size %d)
\n
"
,
Stage
,
sizeof
(
This
->
stateBlock
->
textures
)
/
sizeof
(
This
->
stateBlock
->
textures
[
0
])
);
return
WINED3D_OK
;
/* Windows accepts overflowing this array ... we do not. */
}
*
ppTexture
=
This
->
stateBlock
->
textures
[
Stage
];
if
(
*
ppTexture
)
IWineD3DBaseTexture_AddRef
(
*
ppTexture
);
...
...
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