winmm: Fixed boundary condition in mmioOpen file name parsing.

This commit is contained in:
Alexander Puzankov 2010-12-05 17:24:59 +03:00 committed by Alexandre Julliard
parent e75635a738
commit 4431c32c91

View file

@ -399,13 +399,13 @@ static FOURCC MMIO_ParseExtA(LPCSTR szFileName)
} else { } else {
/* Find the first '.' before '+' */ /* Find the first '.' before '+' */
extStart = extEnd - 1; extStart = extEnd - 1;
while (*extStart != '.') { while (extStart >= szFileName && *extStart != '.') {
if (extStart == szFileName) {
ERR("No extension in szFileName: %s\n", debugstr_a(szFileName));
return ret;
}
extStart--; extStart--;
} }
if (extStart < szFileName) {
ERR("No extension in szFileName: %s\n", debugstr_a(szFileName));
return ret;
}
} }
if (extEnd - extStart - 1 > 4) if (extEnd - extStart - 1 > 4)