diff options
author | Pär Björklund <per.bjorklund@gmail.com> | 2016-09-15 10:36:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-15 10:36:31 +0200 |
commit | 44fb790dbad19564153f2d9e360278c443edef11 (patch) | |
tree | 807b14c53cf511b9cea09f7b75e92d7ac408b4ec | |
parent | 226b3c1323639baf53ecd843e18e4a0b0fcf08ad (diff) | |
parent | 569ae039245e2e88a379874a0f053001aaf71e75 (diff) |
Merge pull request #10456 from ace20022/cov32
[win32] Fix some coverity issues.
-rw-r--r-- | xbmc/cores/VideoPlayer/VideoRenderers/WinRenderer.cpp | 4 | ||||
-rw-r--r-- | xbmc/filesystem/win32/Win32Directory.cpp | 18 | ||||
-rw-r--r-- | xbmc/network/Socket.cpp | 1 |
3 files changed, 17 insertions, 6 deletions
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderer.cpp index 187aedcb4a..1290313cb1 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderer.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderer.cpp @@ -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; diff --git a/xbmc/filesystem/win32/Win32Directory.cpp b/xbmc/filesystem/win32/Win32Directory.cpp index c580c2b2c1..ce284f40bb 100644 --- a/xbmc/filesystem/win32/Win32Directory.cpp +++ b/xbmc/filesystem/win32/Win32Directory.cpp @@ -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); @@ -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 diff --git a/xbmc/network/Socket.cpp b/xbmc/network/Socket.cpp index 4a04fc0999..ed60cc2672 100644 --- a/xbmc/network/Socket.cpp +++ b/xbmc/network/Socket.cpp @@ -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; } |