mirror of
https://github.com/nillerusr/source-engine.git
synced 2024-12-22 14:16:50 +00:00
fix buffer overflow in shader and closed captions
This commit is contained in:
parent
a53fff833f
commit
6bc71d1491
@ -2025,7 +2025,7 @@ public:
|
||||
continue;
|
||||
|
||||
// Lookup the data
|
||||
CaptionLookup_t &entry = directories[ nFileIndex ].m_CaptionDirectory[ caption->dirindex ];
|
||||
CaptionLookup_t &entry = directories[ caption->fileindex ].m_CaptionDirectory[ caption->dirindex ];
|
||||
if ( entry.blockNum != nBlockNum )
|
||||
continue;
|
||||
|
||||
@ -2139,7 +2139,7 @@ public:
|
||||
int dc = directories.Count();
|
||||
for ( i = 0; i < dc; ++i )
|
||||
{
|
||||
idx = directories[ i ].m_CaptionDirectory.Find( search );
|
||||
idx = directories[ i ].m_CaptionDirectory.Find( search );
|
||||
if ( idx == directories[ i ].m_CaptionDirectory.InvalidIndex() )
|
||||
continue;
|
||||
|
||||
|
@ -254,7 +254,7 @@ void DrawFleshInteriorBlendedPass( CBaseVSShader *pShader, IMaterialVar** params
|
||||
// Debug force flesh on
|
||||
vVsConst0[3] = IS_PARAM_DEFINED( info.m_nflDebugForceFleshOn ) ? params[info.m_nflDebugForceFleshOn]->GetFloatValue() : kDefaultDebugForceFleshOn;
|
||||
|
||||
pShaderAPI->SetVertexShaderConstant( VERTEX_SHADER_SHADER_SPECIFIC_CONST_0, vVsConst0, 1 );
|
||||
pShaderAPI->SetVertexShaderConstant( VERTEX_SHADER_SHADER_SPECIFIC_CONST_0, vVsConst0 );
|
||||
|
||||
// Flesh effect centers and radii
|
||||
float vVsConst1[4] = { kDefaultEffectCenterRadius[0], kDefaultEffectCenterRadius[1], kDefaultEffectCenterRadius[2], kDefaultEffectCenterRadius[3] };
|
||||
@ -265,7 +265,7 @@ void DrawFleshInteriorBlendedPass( CBaseVSShader *pShader, IMaterialVar** params
|
||||
vVsConst1[3] = 0.001f;
|
||||
vVsConst1[3] = 1.0f / vVsConst1[3]; // Pass 1.0/radius so we do a mul instead of a divide in the shader
|
||||
}
|
||||
pShaderAPI->SetVertexShaderConstant( VERTEX_SHADER_SHADER_SPECIFIC_CONST_1, vVsConst1, 1 );
|
||||
pShaderAPI->SetVertexShaderConstant( VERTEX_SHADER_SHADER_SPECIFIC_CONST_1, vVsConst1 );
|
||||
|
||||
float vVsConst2[4] = { kDefaultEffectCenterRadius[0], kDefaultEffectCenterRadius[1], kDefaultEffectCenterRadius[2], kDefaultEffectCenterRadius[3] };
|
||||
if ( IS_PARAM_DEFINED( info.m_nvEffectCenterRadius2 ) )
|
||||
@ -275,7 +275,7 @@ void DrawFleshInteriorBlendedPass( CBaseVSShader *pShader, IMaterialVar** params
|
||||
vVsConst2[3] = 0.001f;
|
||||
vVsConst2[3] = 1.0f / vVsConst2[3]; // Pass 1.0/radius so we do a mul instead of a divide in the shader
|
||||
}
|
||||
pShaderAPI->SetVertexShaderConstant( VERTEX_SHADER_SHADER_SPECIFIC_CONST_2, vVsConst2, 2 );
|
||||
pShaderAPI->SetVertexShaderConstant( VERTEX_SHADER_SHADER_SPECIFIC_CONST_2, vVsConst2 );
|
||||
|
||||
float vVsConst3[4] = { kDefaultEffectCenterRadius[0], kDefaultEffectCenterRadius[1], kDefaultEffectCenterRadius[2], kDefaultEffectCenterRadius[3] };
|
||||
if ( IS_PARAM_DEFINED( info.m_nvEffectCenterRadius3 ) )
|
||||
@ -285,7 +285,7 @@ void DrawFleshInteriorBlendedPass( CBaseVSShader *pShader, IMaterialVar** params
|
||||
vVsConst3[3] = 0.001f;
|
||||
vVsConst3[3] = 1.0f / vVsConst3[3]; // Pass 1.0/radius so we do a mul instead of a divide in the shader
|
||||
}
|
||||
pShaderAPI->SetVertexShaderConstant( VERTEX_SHADER_SHADER_SPECIFIC_CONST_3, vVsConst3, 3 );
|
||||
pShaderAPI->SetVertexShaderConstant( VERTEX_SHADER_SHADER_SPECIFIC_CONST_3, vVsConst3 );
|
||||
|
||||
float vVsConst4[4] = { kDefaultEffectCenterRadius[0], kDefaultEffectCenterRadius[1], kDefaultEffectCenterRadius[2], kDefaultEffectCenterRadius[3] };
|
||||
if ( IS_PARAM_DEFINED( info.m_nvEffectCenterRadius4 ) )
|
||||
@ -295,7 +295,7 @@ void DrawFleshInteriorBlendedPass( CBaseVSShader *pShader, IMaterialVar** params
|
||||
vVsConst4[3] = 0.001f;
|
||||
vVsConst4[3] = 1.0f / vVsConst4[3]; // Pass 1.0/radius so we do a mul instead of a divide in the shader
|
||||
}
|
||||
pShaderAPI->SetVertexShaderConstant( VERTEX_SHADER_SHADER_SPECIFIC_CONST_4, vVsConst4, 4 );
|
||||
pShaderAPI->SetVertexShaderConstant( VERTEX_SHADER_SHADER_SPECIFIC_CONST_4, vVsConst4 );
|
||||
|
||||
// Set Pixel Shader Combos
|
||||
if( g_pHardwareConfig->SupportsPixelShaders_2_b() )
|
||||
|
Loading…
Reference in New Issue
Block a user