Static analysis cleanups
This commit is contained in:
parent
6ab9f303da
commit
73f68bdc3f
@ -766,7 +766,7 @@ bool GetResolution(HWND hwndResolution, SIZE &resolution, BOOL bSelChange)
|
||||
String strCX = strResolution.GetToken(0, 'x');
|
||||
String strCY = strResolution.GetToken(1, 'x');
|
||||
|
||||
if(strCX.IsEmpty() || strCX.IsEmpty() || !ValidIntString(strCX) || !ValidIntString(strCY))
|
||||
if(strCX.IsEmpty() || strCY.IsEmpty() || !ValidIntString(strCX) || !ValidIntString(strCY))
|
||||
return false;
|
||||
|
||||
UINT cx = strCX.ToInt();
|
||||
|
@ -177,7 +177,7 @@ SceneItem* Scene::InsertImageSource(UINT pos, XElement *sourceElement)
|
||||
item->SetRender(render);
|
||||
|
||||
API->EnterSceneMutex();
|
||||
if(bSceneStarted) source->BeginScene();
|
||||
if(bSceneStarted && source) source->BeginScene();
|
||||
sceneItems.Insert(pos, item);
|
||||
API->LeaveSceneMutex();
|
||||
|
||||
|
@ -98,7 +98,7 @@ void ConfigFile::LoadData()
|
||||
{
|
||||
lpNextLine = schr(lpCurLine, '\r');
|
||||
if (!lpNextLine)
|
||||
CrashError(TEXT("Your %s file is corrupt, please delete it and re-launch OBS."), strFileName);
|
||||
CrashError(TEXT("Your %s file is corrupt, please delete it and re-launch OBS."), strFileName.Array());
|
||||
*lpNextLine = 0;
|
||||
|
||||
if((*lpCurLine == '[') && (*(lpNextLine-1) == ']'))
|
||||
@ -112,7 +112,7 @@ void ConfigFile::LoadData()
|
||||
{
|
||||
TSTR lpValuePtr = schr(lpCurLine, '=');
|
||||
if (!lpValuePtr)
|
||||
CrashError(TEXT("Your %s file is corrupt, please delete it and re-launch OBS."), strFileName);
|
||||
CrashError(TEXT("Your %s file is corrupt, please delete it and re-launch OBS."), strFileName.Array());
|
||||
|
||||
if(lpValuePtr[1] != 0)
|
||||
{
|
||||
|
@ -408,8 +408,6 @@ public:
|
||||
color = data->GetInt(TEXT("color"), 0xFFFFFFFF);
|
||||
if(opacity > 100)
|
||||
opacity = 100;
|
||||
else if(opacity < 0)
|
||||
opacity = 0;
|
||||
|
||||
if (changeMonitor)
|
||||
{
|
||||
|
@ -216,7 +216,7 @@ void SetupIni()
|
||||
strIni.Clear() << lpAppDataPath << TEXT("\\profiles\\") << strProfile << TEXT(".ini");
|
||||
|
||||
if(!AppConfig->Create(strIni))
|
||||
CrashError(TEXT("Could not create '%s'"), strIni);
|
||||
CrashError(TEXT("Could not create '%s'"), strIni.Array());
|
||||
|
||||
AppConfig->SetString(TEXT("Audio"), TEXT("Device"), TEXT("Default"));
|
||||
AppConfig->SetFloat (TEXT("Audio"), TEXT("MicVolume"), 1.0f);
|
||||
|
@ -471,7 +471,7 @@ OBS::OBS()
|
||||
strScenesConfig << lpAppDataPath << TEXT("\\scenes.xconfig");
|
||||
|
||||
if(!scenesConfig.Open(strScenesConfig))
|
||||
CrashError(TEXT("Could not open '%s'"), strScenesConfig);
|
||||
CrashError(TEXT("Could not open '%s'"), strScenesConfig.Array());
|
||||
|
||||
XElement *scenes = scenesConfig.GetElement(TEXT("scenes"));
|
||||
if(!scenes)
|
||||
@ -598,7 +598,7 @@ OBS::OBS()
|
||||
}
|
||||
else
|
||||
{
|
||||
Log(TEXT("Failed to initialize plugin %s"), strLocation);
|
||||
Log(TEXT("Failed to initialize plugin %s"), strLocation.Array());
|
||||
FreeLibrary(hPlugin);
|
||||
}
|
||||
}
|
||||
@ -1402,7 +1402,7 @@ void OBS::DrawStatusBar(DRAWITEMSTRUCT &dis)
|
||||
|
||||
if(dis.itemID == 4)
|
||||
{
|
||||
DWORD green = 0xFF, red = 0xFF;
|
||||
DWORD green = 0xFF, red;
|
||||
|
||||
statusBarData.bytesPerSec = App->bytesPerSec;
|
||||
statusBarData.strain = App->curStrain;
|
||||
|
@ -2571,7 +2571,7 @@ LRESULT CALLBACK OBS::OBSProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
|
||||
|
||||
App->EnableSceneSwitching(false);
|
||||
|
||||
if(App->bRunning)
|
||||
if(App->bRunning && App->scene)
|
||||
{
|
||||
SceneItem* selectedItem = App->scene->GetSceneItem(selectedID);
|
||||
source = selectedItem->GetSource();
|
||||
|
Loading…
x
Reference in New Issue
Block a user