Henri Verbeet : wined3d: Don't write past the end of the buffer' s conversion_map.

Alexandre Julliard julliard at winehq.org
Mon Apr 12 09:54:08 CDT 2010


Module: wine
Branch: master
Commit: a4fad54134ec8f547218b61e2a20e87c6692ceaa
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a4fad54134ec8f547218b61e2a20e87c6692ceaa

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Sun Apr 11 21:47:48 2010 +0200

wined3d: Don't write past the end of the buffer's conversion_map.

---

 dlls/wined3d/buffer.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
index 8bb1f63..a8fc0d1 100644
--- a/dlls/wined3d/buffer.c
+++ b/dlls/wined3d/buffer.c
@@ -275,12 +275,13 @@ static BOOL buffer_process_converted_attribute(struct wined3d_buffer *This,
     attrib_size = attrib->format_desc->component_count * attrib->format_desc->component_size;
     for (i = 0; i < attrib_size; ++i)
     {
-        if (This->conversion_map[data + i] != conversion_type)
+        DWORD_PTR idx = (data + i) % This->stride;
+        if (This->conversion_map[idx] != conversion_type)
         {
-            TRACE("Byte %ld in vertex changed\n", i + data);
-            TRACE("It was type %d, is %d now\n", This->conversion_map[data + i], conversion_type);
+            TRACE("Byte %ld in vertex changed\n", idx);
+            TRACE("It was type %d, is %d now\n", This->conversion_map[idx], conversion_type);
             ret = TRUE;
-            This->conversion_map[data + i] = conversion_type;
+            This->conversion_map[idx] = conversion_type;
         }
     }
 




More information about the wine-cvs mailing list