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
553 stars 107 forks source link

texture corruption in opposing force #316

Closed revelator closed 6 years ago

revelator commented 6 years ago

Noticed this in the latest pull from site when building it myself, half-life itself works but opposing force has all world textures flagged as notexture. This happens when built with msvc 2010 to 2017 and even with mingw. What changed from your release ? since even if i build it with the same source as your's is based on it still does this. Only change is that i use a newer SDL2 version 2.0.9 which is marked as stable.

nekonomicon commented 6 years ago

Build engine from 0.19.x branch or 0.19 release commit. Latest commits by @x6herbius breaks textures loading on some maps.

revelator commented 6 years ago

Ok thought i was going crazy, thanks for clearing that up. Will those commits be reverted ? or are there other plans.

noodlecollie commented 6 years ago

I'll take a look at this tonight. If the commits are the ones I'm thinking of, they prevented a crash, so probably best not to revert them just yet. I do have Opposing Force, so I'll see if I can sort the issue out on my end and provide a fix.

nekonomicon commented 6 years ago

@revelator, this commits was reverted into 0.19.x branch. @x6herbius, you can just initialize token array with empty initializer list to fix this vulnerability.

revelator commented 6 years ago

Ok if it prevents a crash it might be better just to fix it up. Not all that used to the mechanic behind half-life wads so i havent tried to do something about it myself yet.

noodlecollie commented 6 years ago

@nekonomicon I'm having trouble getting that fix to work. I've tried both initialising token to {NULL} and memsetting the whole thing to zero, but that doesn't seem to stop my textures from loading in pink and black. As far as I can see the paths are read correctly and the texture loader doesn't set the actual OpenGL texture ID to that of the default (as I would have expected were it not able to find the WAD files), so I'm not really sure where it's going wrong.

mittorn commented 6 years ago

x6herbius, revert your commit before nullifing buffer. You have add counter for free token space, but did not clean it when filling buffer by new token.

noodlecollie commented 6 years ago

If nulling the buffer fixes the issue my commits were trying to fix, I guess it's best to leave it that way. It's probably simpler than the way I was doing it.

revelator commented 6 years ago

Changed back to old method with nullifying the buffer as sugessted, it works fine agaim after this change.

a1batross commented 6 years ago

Seems to be fixed, as for master branch.