Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/apps
diff options
context:
space:
mode:
authorSpec-Chum <spec-chum@users.sourceforge.net>2010-03-03 23:59:21 +0300
committerSpec-Chum <spec-chum@users.sourceforge.net>2010-03-03 23:59:21 +0300
commit7f96527decfc08d87eb6e7f8ae992d49e38709aa (patch)
treef61961cfdc3cc8427d4827a9cac0ef2171faa5ff /src/apps
parent6f50b4353a1e745b1c15a4a3fc98b908fab6f9cb (diff)
Fix potential undefined behavior using MediaInfo
Patch by jackieku git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@1727 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/apps')
-rw-r--r--src/apps/mplayerc/PPageFileInfoSheet.cpp9
-rw-r--r--src/apps/mplayerc/PPageFileMediaInfo.cpp6
-rw-r--r--src/apps/mplayerc/PPageFileMediaInfo.h1
3 files changed, 9 insertions, 7 deletions
diff --git a/src/apps/mplayerc/PPageFileInfoSheet.cpp b/src/apps/mplayerc/PPageFileInfoSheet.cpp
index ef4c3436e..b866948e0 100644
--- a/src/apps/mplayerc/PPageFileInfoSheet.cpp
+++ b/src/apps/mplayerc/PPageFileInfoSheet.cpp
@@ -26,9 +26,6 @@
#include "MainFrm.h"
#include "PPageFileInfoSheet.h"
-#include <MediaInfoDLL.h>
-using namespace MediaInfoDLL;
-
// CPPageFileInfoSheet
IMPLEMENT_DYNAMIC(CPPageFileInfoSheet, CPropertySheet)
@@ -54,10 +51,8 @@ CPPageFileInfoSheet::CPPageFileInfoSheet(CString fn, CMainFrame* pMainFrame, CWn
}
EndEnumFilters
- MediaInfo MI;
- CString mi_text = MI.Option(_T("Info_Version"), _T("")).c_str();
- MI.Close();
- if(mi_text.Find(_T("Unable to load"))<0) AddPage(&m_mi);
+ if (CPPageFileMediaInfo::HasMediaInfo())
+ AddPage(&m_mi);
}
CPPageFileInfoSheet::~CPPageFileInfoSheet()
diff --git a/src/apps/mplayerc/PPageFileMediaInfo.cpp b/src/apps/mplayerc/PPageFileMediaInfo.cpp
index 9e62bacd0..4ec69f65f 100644
--- a/src/apps/mplayerc/PPageFileMediaInfo.cpp
+++ b/src/apps/mplayerc/PPageFileMediaInfo.cpp
@@ -94,3 +94,9 @@ void CPPageFileMediaInfo::OnShowWindow(BOOL bShow, UINT nStatus)
else
GetParent()->GetDlgItem(IDC_BUTTON_MI)->ShowWindow(SW_HIDE);
}
+
+bool CPPageFileMediaInfo::HasMediaInfo()
+{
+ MediaInfo MI;
+ return MI.IsReady();
+}
diff --git a/src/apps/mplayerc/PPageFileMediaInfo.h b/src/apps/mplayerc/PPageFileMediaInfo.h
index 319e505f7..864e578e5 100644
--- a/src/apps/mplayerc/PPageFileMediaInfo.h
+++ b/src/apps/mplayerc/PPageFileMediaInfo.h
@@ -42,6 +42,7 @@ public:
CString MI_Text;
+ static bool HasMediaInfo();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual BOOL OnInitDialog();