mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-29 07:22:05 +00:00
Fix uninitialized memory access if a FShaderProgram is destroyed without being fully compiled and linked
This commit is contained in:
parent
960038bb81
commit
b68bbaf617
2 changed files with 10 additions and 0 deletions
|
@ -52,6 +52,12 @@
|
||||||
#include "i_system.h"
|
#include "i_system.h"
|
||||||
#include "doomerrors.h"
|
#include "doomerrors.h"
|
||||||
|
|
||||||
|
FShaderProgram::FShaderProgram()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < NumShaderTypes; i++)
|
||||||
|
mShaders[i] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
// Free shader program resources
|
// Free shader program resources
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
class FShaderProgram
|
class FShaderProgram
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
FShaderProgram();
|
||||||
~FShaderProgram();
|
~FShaderProgram();
|
||||||
|
|
||||||
enum ShaderType
|
enum ShaderType
|
||||||
|
@ -30,6 +31,9 @@ public:
|
||||||
static void PatchFragShader(FString &code);
|
static void PatchFragShader(FString &code);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
FShaderProgram(const FShaderProgram &) = delete;
|
||||||
|
FShaderProgram &operator=(const FShaderProgram &) = delete;
|
||||||
|
|
||||||
static FString PatchShader(ShaderType type, const FString &code, const char *defines, int maxGlslVersion);
|
static FString PatchShader(ShaderType type, const FString &code, const char *defines, int maxGlslVersion);
|
||||||
static void PatchCommon(FString &code);
|
static void PatchCommon(FString &code);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue