Merge pull request #1391 from Dmitry-Me/fixPotentialNullDeref01
UI: Check pointer before the first dereferencemaster
commit
6905b22c5f
|
@ -4185,6 +4185,9 @@ void OBSBasicSettings::AdvReplayBufferChanged()
|
||||||
int vbitrate = (int)obs_data_get_int(settings, "bitrate");
|
int vbitrate = (int)obs_data_get_int(settings, "bitrate");
|
||||||
const char *rateControl = obs_data_get_string(settings, "rate_control");
|
const char *rateControl = obs_data_get_string(settings, "rate_control");
|
||||||
|
|
||||||
|
if (!rateControl)
|
||||||
|
rateControl = "";
|
||||||
|
|
||||||
bool lossless = strcmp(rateControl, "lossless") == 0 ||
|
bool lossless = strcmp(rateControl, "lossless") == 0 ||
|
||||||
ui->advOutRecType->currentIndex() == 1;
|
ui->advOutRecType->currentIndex() == 1;
|
||||||
bool replayBufferEnabled = ui->advReplayBuf->isChecked();
|
bool replayBufferEnabled = ui->advReplayBuf->isChecked();
|
||||||
|
@ -4210,9 +4213,6 @@ void OBSBasicSettings::AdvReplayBufferChanged()
|
||||||
if (memMB < 1)
|
if (memMB < 1)
|
||||||
memMB = 1;
|
memMB = 1;
|
||||||
|
|
||||||
if (!rateControl)
|
|
||||||
rateControl = "";
|
|
||||||
|
|
||||||
bool varRateControl = (astrcmpi(rateControl, "CBR") == 0 ||
|
bool varRateControl = (astrcmpi(rateControl, "CBR") == 0 ||
|
||||||
astrcmpi(rateControl, "VBR") == 0 ||
|
astrcmpi(rateControl, "VBR") == 0 ||
|
||||||
astrcmpi(rateControl, "ABR") == 0);
|
astrcmpi(rateControl, "ABR") == 0);
|
||||||
|
|
Loading…
Reference in New Issue