winmm: Fixed boundary condition in mmioOpen file name parsing.
Alexander Puzankov
alxpnv at gmail.com
Sun Dec 5 08:28:35 CST 2010
-------------- next part --------------
From 8b788c064432d99f1200024fc240685fbdcfd882 Mon Sep 17 00:00:00 2001
From: Alexander Puzankov <alxpnv at gmail.com>
Date: Sun, 5 Dec 2010 17:24:59 +0300
Subject: winmm: Fixed boundary condition in mmioOpen file name parsing.
---
dlls/winmm/mmio.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/winmm/mmio.c b/dlls/winmm/mmio.c
index 2e414ba..6ac295e 100644
--- a/dlls/winmm/mmio.c
+++ b/dlls/winmm/mmio.c
@@ -399,13 +399,13 @@ static FOURCC MMIO_ParseExtA(LPCSTR szFileName)
} else {
/* Find the first '.' before '+' */
extStart = extEnd - 1;
- while (*extStart != '.') {
- if (extStart == szFileName) {
- ERR("No extension in szFileName: %s\n", debugstr_a(szFileName));
- return ret;
- }
+ while (extStart >= szFileName && *extStart != '.') {
extStart--;
}
+ if (extStart < szFileName) {
+ ERR("No extension in szFileName: %s\n", debugstr_a(szFileName));
+ return ret;
+ }
}
if (extEnd - extStart - 1 > 4)
--
1.7.1
More information about the wine-patches
mailing list