Commit da63312
committed
Fix integer overflow in computeBindingSize for glTF accessors
Add overflow validation to computeBindingSize(), consistent with the
existing overflow check already present in decodeMeshoptCompression()
in the same file (lines 100-104).
The multiplication accessor->stride * (accessor->count - 1) can
overflow when both stride and count are large values from a glTF file.
The result is truncated to uint32_t, producing an undersized value that
is used for buffer allocation in ResourceLoader.
Uses postcondition checks as requested in review.1 parent e28b7da commit da63312
1 file changed
+14
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
172 | 185 | | |
173 | 186 | | |
174 | 187 | | |
| |||
0 commit comments