Commit 3779c5a
committed
Improve heap safety in CProxyDirect3DVertexBuffer::Lock
Pre-sized the fallback staging buffer during construction so its backing allocation never moves while a caller is writing through the pointer we returned.
Added guard at the top of Lock: if a previous fallback session hasn’t finished, we simply return D3DERR_WASSTILLDRAWING
Keep the fallback tracking zeroed only after sure no retry is pending, and leave its storage allocated so later locks stay in-bounds without reallocations.
Now, the fallback pointer is always within a stable buffer, and it rejects overlapping fallback locks so interfering software hooks can’t trigger resizing under a writer
*Note: Most problems with vertex buffer locking (now and before) come from 3rd party hooks, like recording tools and overlays1 parent 53097a6 commit 3779c5a
1 file changed
+17
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| 125 | + | |
125 | 126 | | |
126 | 127 | | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
131 | 138 | | |
132 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
133 | 145 | | |
134 | 146 | | |
135 | 147 | | |
| |||
0 commit comments