Nikolay Sivov : mfplat: Fix early return from GetString() (Coverity).

Alexandre Julliard julliard at winehq.org
Mon Apr 8 15:11:59 CDT 2019


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Sat Apr  6 22:02:39 2019 +0300

mfplat: Fix early return from GetString() (Coverity).

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/mfplat/main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/mfplat/main.c b/dlls/mfplat/main.c
index 8303bf2..13c48cf 100644
--- a/dlls/mfplat/main.c
+++ b/dlls/mfplat/main.c
@@ -1260,9 +1260,9 @@ HRESULT attributes_GetString(struct attributes *attributes, REFGUID key, WCHAR *
                 *length = len;
 
             if (size <= len)
-                return STRSAFE_E_INSUFFICIENT_BUFFER;
-
-            memcpy(value, attribute->value.u.pwszVal, (len + 1) * sizeof(WCHAR));
+                hr = STRSAFE_E_INSUFFICIENT_BUFFER;
+            else
+                memcpy(value, attribute->value.u.pwszVal, (len + 1) * sizeof(WCHAR));
         }
         else
             hr = MF_E_INVALIDTYPE;




More information about the wine-cvs mailing list