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
diff options
context:
space:
mode:
authorUnderground78 <underground78@users.sourceforge.net>2015-07-26 23:48:17 +0300
committerUnderground78 <underground78@users.sourceforge.net>2015-08-01 16:03:32 +0300
commit59c6a05643b244fa7e00ce8a6a8143304e8cfe04 (patch)
tree36bc06ccccd2a8991acde864762ff3f8690a18ee
parent07026cae53dbfb667995c4d7b133334d917e94d2 (diff)
Fix wrong buffer sizes of swscanf_s.
-rw-r--r--src/Subtitles/STS.cpp4
-rw-r--r--src/mpc-hc/MainFrm.cpp6
2 files changed, 4 insertions, 6 deletions
diff --git a/src/Subtitles/STS.cpp b/src/Subtitles/STS.cpp
index 24300dc55..11a7d9b4a 100644
--- a/src/Subtitles/STS.cpp
+++ b/src/Subtitles/STS.cpp
@@ -629,8 +629,8 @@ static bool OpenSubViewer(CTextFile* file, CSimpleTextSubtitle& ret, int CharSet
WCHAR sep;
int hh1, mm1, ss1, hs1, hh2, mm2, ss2, hs2;
int c = swscanf_s(buff, L"%d:%d:%d%c%d,%d:%d:%d%c%d\n",
- &hh1, &mm1, &ss1, &sep, sizeof(WCHAR),
- &hs1, &hh2, &mm2, &ss2, &sep, sizeof(WCHAR), &hs2);
+ &hh1, &mm1, &ss1, &sep, 1,
+ &hs1, &hh2, &mm2, &ss2, &sep, 1, &hs2);
if (c == 10) {
CStringW str;
diff --git a/src/mpc-hc/MainFrm.cpp b/src/mpc-hc/MainFrm.cpp
index c2f075e2d..ef004dd39 100644
--- a/src/mpc-hc/MainFrm.cpp
+++ b/src/mpc-hc/MainFrm.cpp
@@ -10712,10 +10712,8 @@ void CMainFrame::SetupChapters()
int h, m, s, ms;
WCHAR wc;
- if (7 != swscanf_s(CStringW(var), L"%d%c%d%c%d%c%d", &h,
- &wc, sizeof(WCHAR), &m,
- &wc, sizeof(WCHAR), &s,
- &wc, sizeof(WCHAR), &ms)) {
+ if (7 != swscanf_s(CStringW(var), L"%d%c%d%c%d%c%d",
+ &h, &wc, 1, &m, &wc, 1, &s, &wc, 1, &ms)) {
break;
}