mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 17:44:45 +00:00
don't pass NULL as the last two parameters to ReadFile. This fixes a crash while installing OOo 2.0. Patch also submitted to winehq.
svn path=/trunk/; revision=18834
This commit is contained in:
parent
b1f73ba822
commit
98191672ef
1 changed files with 6 additions and 5 deletions
|
@ -3676,8 +3676,9 @@ static LPWSTR load_ttfname_from(LPCWSTR filename)
|
|||
TT_TABLE_DIRECTORY tblDir;
|
||||
BOOL bFound = FALSE;
|
||||
TT_OFFSET_TABLE ttOffsetTable;
|
||||
DWORD dwRead;
|
||||
|
||||
ReadFile(handle,&ttOffsetTable, sizeof(TT_OFFSET_TABLE),NULL,NULL);
|
||||
ReadFile(handle,&ttOffsetTable, sizeof(TT_OFFSET_TABLE),&dwRead,NULL);
|
||||
ttOffsetTable.uNumOfTables = SWAPWORD(ttOffsetTable.uNumOfTables);
|
||||
ttOffsetTable.uMajorVersion = SWAPWORD(ttOffsetTable.uMajorVersion);
|
||||
ttOffsetTable.uMinorVersion = SWAPWORD(ttOffsetTable.uMinorVersion);
|
||||
|
@ -3688,7 +3689,7 @@ static LPWSTR load_ttfname_from(LPCWSTR filename)
|
|||
|
||||
for (i=0; i< ttOffsetTable.uNumOfTables; i++)
|
||||
{
|
||||
ReadFile(handle,&tblDir, sizeof(TT_TABLE_DIRECTORY),NULL,NULL);
|
||||
ReadFile(handle,&tblDir, sizeof(TT_TABLE_DIRECTORY),&dwRead,NULL);
|
||||
if (strncmp(tblDir.szTag,"name",4)==0)
|
||||
{
|
||||
bFound = TRUE;
|
||||
|
@ -3705,14 +3706,14 @@ static LPWSTR load_ttfname_from(LPCWSTR filename)
|
|||
|
||||
SetFilePointer(handle, tblDir.uOffset, NULL, FILE_BEGIN);
|
||||
ReadFile(handle,&ttNTHeader, sizeof(TT_NAME_TABLE_HEADER),
|
||||
NULL,NULL);
|
||||
&dwRead,NULL);
|
||||
|
||||
ttNTHeader.uNRCount = SWAPWORD(ttNTHeader.uNRCount);
|
||||
ttNTHeader.uStorageOffset = SWAPWORD(ttNTHeader.uStorageOffset);
|
||||
bFound = FALSE;
|
||||
for(i=0; i<ttNTHeader.uNRCount; i++)
|
||||
{
|
||||
ReadFile(handle,&ttRecord, sizeof(TT_NAME_RECORD),NULL,NULL);
|
||||
ReadFile(handle,&ttRecord, sizeof(TT_NAME_RECORD),&dwRead,NULL);
|
||||
ttRecord.uNameID = SWAPWORD(ttRecord.uNameID);
|
||||
/* 4 is the Full Font Name */
|
||||
if(ttRecord.uNameID == 4)
|
||||
|
@ -3730,7 +3731,7 @@ static LPWSTR load_ttfname_from(LPCWSTR filename)
|
|||
NULL, FILE_BEGIN);
|
||||
buf = msi_alloc( ttRecord.uStringLength + 1 + strlen(tt) );
|
||||
memset(buf, 0, ttRecord.uStringLength + 1 + strlen(tt));
|
||||
ReadFile(handle, buf, ttRecord.uStringLength, NULL, NULL);
|
||||
ReadFile(handle, buf, ttRecord.uStringLength, &dwRead, NULL);
|
||||
if (strlen(buf) > 0)
|
||||
{
|
||||
strcat(buf,tt);
|
||||
|
|
Loading…
Reference in a new issue