mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 827254 - Guard against garbage plugin instance in ANPSystem::setPowerState r=blassey
This commit is contained in:
parent
546582e56f
commit
fac471fc87
@ -66,9 +66,11 @@ jclass anp_system_loadJavaClass(NPP instance, const char* className)
|
|||||||
|
|
||||||
void anp_system_setPowerState(NPP instance, ANPPowerState powerState)
|
void anp_system_setPowerState(NPP instance, ANPPowerState powerState)
|
||||||
{
|
{
|
||||||
nsNPAPIPluginInstance* pinst = static_cast<nsNPAPIPluginInstance*>(instance->ndata);
|
nsNPAPIPluginInstance* pinst = nsNPAPIPluginInstance::GetFromNPP(instance);
|
||||||
|
|
||||||
pinst->SetWakeLock(powerState == kScreenOn_ANPPowerState);
|
if (pinst) {
|
||||||
|
pinst->SetWakeLock(powerState == kScreenOn_ANPPowerState);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void InitSystemInterface(ANPSystemInterfaceV0 *i) {
|
void InitSystemInterface(ANPSystemInterfaceV0 *i) {
|
||||||
|
Loading…
Reference in New Issue
Block a user