Hans Leidekker : msi: Fix integer conversion in get_table_value_from_record .
Alexandre Julliard
julliard at winehq.org
Tue Jul 30 14:14:21 CDT 2013
Module: wine
Branch: master
Commit: 1257db2109ccd81295997d1bf02d80b80944ca5a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1257db2109ccd81295997d1bf02d80b80944ca5a
Author: Hans Leidekker <hans at codeweavers.com>
Date: Tue Jul 30 11:09:54 2013 +0200
msi: Fix integer conversion in get_table_value_from_record.
---
dlls/msi/table.c | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/dlls/msi/table.c b/dlls/msi/table.c
index e2186fc..16e3144 100644
--- a/dlls/msi/table.c
+++ b/dlls/msi/table.c
@@ -1259,6 +1259,7 @@ static UINT get_table_value_from_record( MSITABLEVIEW *tv, MSIRECORD *rec, UINT
{
MSICOLUMNINFO columninfo;
UINT r;
+ int ival;
if ( (iField <= 0) ||
(iField > tv->num_cols) ||
@@ -1285,16 +1286,21 @@ static UINT get_table_value_from_record( MSITABLEVIEW *tv, MSIRECORD *rec, UINT
}
else if ( bytes_per_column( tv->db, &columninfo, LONG_STR_BYTES ) == 2 )
{
- *pvalue = 0x8000 + MSI_RecordGetInteger( rec, iField );
- if ( *pvalue & 0xffff0000 )
+ ival = MSI_RecordGetInteger( rec, iField );
+ if (ival == 0x80000000) *pvalue = 0x8000;
+ else
{
- ERR("field %u value %d out of range\n", iField, *pvalue - 0x8000);
- return ERROR_FUNCTION_FAILED;
+ *pvalue = 0x8000 + MSI_RecordGetInteger( rec, iField );
+ if (*pvalue & 0xffff0000)
+ {
+ ERR("field %u value %d out of range\n", iField, *pvalue - 0x8000);
+ return ERROR_FUNCTION_FAILED;
+ }
}
}
else
{
- INT ival = MSI_RecordGetInteger( rec, iField );
+ ival = MSI_RecordGetInteger( rec, iField );
*pvalue = ival ^ 0x80000000;
}
More information about the wine-cvs
mailing list