Alexandre Julliard : ole32: Fix sign expansion of codepage values.

Alexandre Julliard julliard at winehq.org
Thu Apr 14 16:50:33 CDT 2022


Module: wine
Branch: master
Commit: 1f71ea3106d41a0cc392fc626a3ecd7c890425fd
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=1f71ea3106d41a0cc392fc626a3ecd7c890425fd

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Apr 14 09:44:16 2022 +0200

ole32: Fix sign expansion of codepage values.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ole32/stg_prop.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/ole32/stg_prop.c b/dlls/ole32/stg_prop.c
index 28793d7cbd5..8efb8ed5543 100644
--- a/dlls/ole32/stg_prop.c
+++ b/dlls/ole32/stg_prop.c
@@ -802,7 +802,7 @@ static HRESULT WINAPI IPropertyStorage_fnWriteMultiple(
                 if (dictionary_num_entries(This->propid_to_prop) == 0 &&
                  rgpropvar[i].vt == VT_I2)
                 {
-                    This->codePage = rgpropvar[i].iVal;
+                    This->codePage = (USHORT)rgpropvar[i].iVal;
                     if (This->codePage == CP_UNICODE)
                         This->grfFlags &= ~PROPSETFLAG_ANSI;
                     else
@@ -1868,7 +1868,7 @@ static HRESULT PropertyStorage_ReadFromStream(PropertyStorage_impl *This)
                     {
                     case PID_CODEPAGE:
                         if (prop.vt == VT_I2)
-                            This->codePage = (UINT)prop.iVal;
+                            This->codePage = (USHORT)prop.iVal;
                         break;
                     case PID_LOCALE:
                         if (prop.vt == VT_I4)




More information about the wine-cvs mailing list