[7/10] WineD3D: No bounds checking is done on sampler / texture numbers

H. Verbeet hverbeet at gmail.com
Tue Feb 20 09:46:03 CST 2007

On 20/02/07, Stefan Dösinger <stefan at codeweavers.com> wrote:
> Am Montag 19 Februar 2007 16:19 schrieb H. Verbeet:
> > On 19/02/07, Stefan Dösinger <stefan at codeweavers.com> wrote:
> > >-    if(Sampler >  GL_LIMITS(sampler_stages) || Sampler < 0 || Type >
> >
> >
> > This also checked the sampler state, not just the sampler.
> I added a test to see if the sampler state is checked too, and neither ddraw,
> d3d8 nor d3d9 did checks on the sampler state / texture stage state. I am not
> sure if we should commit the test to wine because it could cause invisible
> memory corruption in the native d3d object which randomly breaks other tests.
> DirectX is incorrect here, because I have a test for lights where the light
> type IS checked.
Would it make sense to catch out of bounds samplers/sampler states,
print a ERR/WARN, and just return WINED3D_OK? Memory corruption is
pretty nasty, and we'd at least have some log info that an application
is doing something it shouldn't be doing.

More information about the wine-devel mailing list