From: Józef Kucia Subject: [PATCH 6/7] wined3d: Validate stream_idx in wined3d_device_set_stream_source_freq(). Message-Id: <1453936672-29947-6-git-send-email-jkucia@codeweavers.com> Date: Thu, 28 Jan 2016 00:17:51 +0100 In-Reply-To: <1453936672-29947-1-git-send-email-jkucia@codeweavers.com> References: <1453936672-29947-1-git-send-email-jkucia@codeweavers.com> Signed-off-by: Józef Kucia --- This and the following patch are just to prevent a potential memory corruption. --- dlls/wined3d/device.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index e937abc..f41f043 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1412,6 +1412,12 @@ HRESULT CDECL wined3d_device_set_stream_source_freq(struct wined3d_device *devic return WINED3DERR_INVALIDCALL; } + if (stream_idx >= MAX_STREAMS) + { + FIXME("Stream index %u out of range.\n", stream_idx); + return WINED3DERR_INVALIDCALL; + } + stream = &device->update_state->streams[stream_idx]; old_flags = stream->flags; old_freq = stream->frequency; -- 2.4.10