Index: clipboard.c =================================================================== --- win32ss/user/ntuser/clipboard.c (revision 75004) +++ win32ss/user/ntuser/clipboard.c (working copy) @@ -448,9 +448,15 @@ { /* Return next format */ pElement = IntGetFormatElement(pWinStaObj, fmt); - ++pElement; - if (pElement < &pWinStaObj->pClipBase[pWinStaObj->cNumClipFormats]) - Ret = pElement->fmt; + ASSERT(pElement != NULL); // this shouldn't be here but we should hit this during tests and I want to know when + if (pElement != NULL) + { + ++pElement; + if (pElement < &pWinStaObj->pClipBase[pWinStaObj->cNumClipFormats]) + { + Ret = pElement->fmt; + } + } } cleanup: @@ -984,13 +990,13 @@ /* * Check if the clipboard is correctly opened: - * - in case of normal rendering, we must have opened the clipboard; + * - in case of normal rendering, someone must have opened the clipboard; * - in case of delayed rendering, the clipboard must be already opened * by another application, but we need to be the clipboard owner. */ - if ((!pWinStaObj->fInDelayedRendering && !IntIsClipboardOpenByMe(pWinStaObj)) || - (pWinStaObj->fInDelayedRendering && !(pWinStaObj->ptiClipLock && - pWinStaObj->spwndClipOwner->head.pti == PsGetCurrentThreadWin32Thread()))) + if (!pWinStaObj->ptiClipLock || + (pWinStaObj->fInDelayedRendering && // FIXME: pretty sure this check should go away + pWinStaObj->spwndClipOwner->head.pti != PsGetCurrentThreadWin32Thread())) { ERR("Access denied!\n"); EngSetLastError(ERROR_CLIPBOARD_NOT_OPEN);