From f5cb8d171e7b5f5d690d957eca2d15760a9d9393 Mon Sep 17 00:00:00 2001 From: Henri Herscher Date: Thu, 16 Mar 2006 01:24:56 +0000 Subject: Check that pcap file actually exists before passing it to libpcap git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@196 09dcff7a-b715-0410-9601-b79a96267cd0 --- orkaudio/audiocaptureplugins/voip/VoIp.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'orkaudio') diff --git a/orkaudio/audiocaptureplugins/voip/VoIp.cpp b/orkaudio/audiocaptureplugins/voip/VoIp.cpp index b49651b..ef9c06d 100644 --- a/orkaudio/audiocaptureplugins/voip/VoIp.cpp +++ b/orkaudio/audiocaptureplugins/voip/VoIp.cpp @@ -619,8 +619,15 @@ void VoIp::Initialize() if(DLLCONFIG.m_pcapFile.size() > 0) { - OpenPcapFile(DLLCONFIG.m_pcapFile); - s_liveCapture = false; + if(FileCanOpen(DLLCONFIG.m_pcapFile)) + { + OpenPcapFile(DLLCONFIG.m_pcapFile); + s_liveCapture = false; + } + else + { + LOG4CXX_ERROR(s_packetLog, "Could not open pcap file: " + DLLCONFIG.m_pcapFile); + } } else { -- cgit v1.2.3