FWGS / xash3d

DEPRECATED in favor of https://github.com/FWGS/xash3d-fwgs. Only bugfixes are accepted.
https://xash.su
GNU General Public License v3.0
549 stars 107 forks source link

Fixed potential VBO index buffer overflow #407

Closed noodlecollie closed 5 years ago

noodlecollie commented 5 years ago

https://github.com/FWGS/xash3d/issues/406

There were no checks on indices being written to in the VBO index buffer, and the size of the buffer was calculated somewhat arbitrarily. This caused overflow issues on my branch when I was attempting to load different BSP formats.

Index checks have been added, and the VBO index buffer size computation has been made accurate. In my fork I added a warning message if vbotex->curindex goes out of range, but because it can spam on every frame I thought it was best left out of the engine as a whole.

a1batross commented 5 years ago

PR is fine. But it should be tested on difficult maps, especially, which crashed a lot. For example: HL Echoes maps.

noodlecollie commented 5 years ago

I've compiled this on Windows and run up Echoes to test it. I did the intro and loaded a couple of maps at random (09, 15) and all seems fine, unless you have more specific recommendations about problem areas.

nekonomicon commented 5 years ago

Echoes crashes on echoes21 map, but trouble in another place.

mittorn commented 5 years ago

Echoes crash seems to be android-related

nekonomicon commented 5 years ago

@mittorn Platform-independent.

mittorn commented 5 years ago

Failed to reproduce on x86 linux

nekonomicon commented 5 years ago

Reproducible on i386 FreeBSD.

noodlecollie commented 5 years ago

Is the Echoes crash specifically to do with the code in this PR? I don't know what "Trouble in another place" means.