Skip to content

Commit

Permalink
Merge pull request xbmc#10456 from ace20022/cov32
Browse files Browse the repository at this point in the history
[win32] Fix some coverity issues.
  • Loading branch information
Paxxi authored Sep 15, 2016
2 parents 226b3c1 + 569ae03 commit 44fb790
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
4 changes: 2 additions & 2 deletions xbmc/cores/VideoPlayer/VideoRenderers/WinRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,9 @@ void CWinRenderer::FlipPage(int source)
if( source >= 0 && source < m_NumYV12Buffers )
m_iYV12RenderBuffer = source;
else
m_iYV12RenderBuffer = NextYV12Texture();;
m_iYV12RenderBuffer = NextYV12Texture();

if (m_VideoBuffers[m_iYV12RenderBuffer] != nullptr)
if (m_iYV12RenderBuffer >= 0 && m_VideoBuffers[m_iYV12RenderBuffer] != nullptr)
m_VideoBuffers[m_iYV12RenderBuffer]->StartRender();

return;
Expand Down
18 changes: 14 additions & 4 deletions xbmc/filesystem/win32/Win32Directory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ bool CWin32Directory::RemoveRecursive(const CURL& url)
if (hSearch == INVALID_HANDLE_VALUE)
return GetLastError() == ERROR_FILE_NOT_FOUND ? Exists(url) : false; // return true if directory exist and empty

bool success = true;
do
{
std::wstring itemNameW(findData.cFileName);
Expand All @@ -218,20 +219,29 @@ bool CWin32Directory::RemoveRecursive(const CURL& url)
}

if (!RemoveRecursive(CURL{ path }))
return false;
{
success = false;
break;
}

if (FALSE == RemoveDirectoryW(pathW.c_str()))
return false;
{
success = false;
break;
}
}
else
{
if (FALSE == DeleteFileW(pathW.c_str()))
return false;
{
success = false;
break;
}
}
} while (FindNextFileW(hSearch, &findData));

FindClose(hSearch);

return true;
return success;
}
#endif // TARGET_WINDOWS
1 change: 1 addition & 0 deletions xbmc/network/Socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ bool CPosixUDPSocket::Bind(bool localOnly, int port, int range)
if (!m_ipv6Socket)
{
CLog::Log(LOGWARNING, "UDP: Unable to bind to advertised ipv6, fallback to ipv4");
closesocket(testSocket);
close(m_iSock);
m_iSock = INVALID_SOCKET;
}
Expand Down

0 comments on commit 44fb790

Please sign in to comment.