From cb4ff8c51ecc5acec292448dc519716e56c68644 Mon Sep 17 00:00:00 2001 From: Lionel Ulmer Date: Tue, 17 Oct 2000 00:26:37 +0000 Subject: [PATCH] Warning fix. --- dlls/ddraw/ddraw/x11.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/dlls/ddraw/ddraw/x11.c b/dlls/ddraw/ddraw/x11.c index 95b4e916f67..135ff1ed46f 100644 --- a/dlls/ddraw/ddraw/x11.c +++ b/dlls/ddraw/ddraw/x11.c @@ -1128,19 +1128,22 @@ HRESULT WINAPI Xlib_IDirectDraw2Impl_GetFourCCCodes( ICOM_THIS(IDirectDraw2Impl,iface); DDPRIVATE(This); XvImageFormatValues *fo; - int array_size = *lpNumCodes; - + int num_codes; + TRACE("(%p,%p,%p) - %ld slots available\n",This, lpNumCodes, lpCodes, *lpNumCodes); - fo = TSXvListImageFormats(display, ddpriv->port_id, lpNumCodes); - if (fo == NULL) *lpNumCodes = 0; /* I am not sure if X is clean in this case... */ + fo = TSXvListImageFormats(display, ddpriv->port_id, &num_codes); if (lpCodes != NULL) { /* Fill in the FourCC table */ int i; - for (i = 0; i < array_size; i++) lpCodes[i] = fo[i].id; + for (i = 0; i < *lpNumCodes; i++) lpCodes[i] = fo[i].id; } - if (fo) + if (fo) { + *lpNumCodes = num_codes; TSXFree(fo); + } else { + *lpNumCodes = 0; /* Not sure if X fills this variable in the error case */ + } return DD_OK; #else