[PATCH] mciwave: return on error (Coverity)

Marcus Meissner marcus at jet.franken.de
Sat Oct 17 10:44:21 CDT 2009


Hi,

The first if () should just return, as  lpParms->lpstrReturn[0]
will cause a fault otherwise.

Ciao, Marcus
---
 dlls/mciwave/mciwave.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/dlls/mciwave/mciwave.c b/dlls/mciwave/mciwave.c
index 66af58a..4dce9f2 100644
--- a/dlls/mciwave/mciwave.c
+++ b/dlls/mciwave/mciwave.c
@@ -1561,9 +1561,10 @@ static DWORD WAVE_mciInfo(MCIDEVICEID wDevID, DWORD dwFlags, LPMCI_INFO_PARMSW l
 
     TRACE("(%u, %08X, %p);\n", wDevID, dwFlags, lpParms);
 
-    if (lpParms == NULL || lpParms->lpstrReturn == NULL) {
-	ret = MCIERR_NULL_PARAMETER_BLOCK;
-    } else if (wmw == NULL) {
+    if (!lpParms || !lpParms->lpstrReturn)
+	return MCIERR_NULL_PARAMETER_BLOCK;
+
+    if (wmw == NULL) {
 	ret = MCIERR_INVALID_DEVICE_ID;
     } else {
         static const WCHAR wszAudio  [] = {'W','i','n','e','\'','s',' ','a','u','d','i','o',' ','p','l','a','y','e','r',0};
-- 
1.5.6



More information about the wine-patches mailing list