[channels,video] fix NULL dereference

This commit is contained in:
akallabeth 2025-05-19 08:13:49 +02:00
parent b595a6cba8
commit 2a020b8a5f
2 changed files with 8 additions and 2 deletions

View File

@ -1175,8 +1175,12 @@ static UINT video_plugin_initialize(IWTSPlugin* plugin, IWTSVirtualChannelManage
static UINT video_plugin_terminated(IWTSPlugin* pPlugin)
{
VIDEO_PLUGIN* video = (VIDEO_PLUGIN*)pPlugin;
if (!video)
return CHANNEL_RC_INVALID_INSTANCE;
if (video->context && video->context->priv)
freerdp_timer_remove(video->rdpcontext, video->context->priv->timerID);
freerdp_timer_remove(video->rdpcontext, video->context->priv->timerID);
if (video->control_callback)
{
IWTSVirtualChannelManager* mgr = video->control_callback->channel_mgr;

View File

@ -199,7 +199,9 @@ static DWORD WINAPI timer_thread(LPVOID arg)
const uint64_t diff = next - now;
const uint64_t diffMS = diff / 1000;
timeout = MIN(INFINITE, (uint32_t)diffMS);
timeout = INFINITE;
if (diffMS < INFINITE)
timeout = (uint32_t)diffMS;
}
return 0;
}