mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-20 14:00:03 +01:00
Xext: Fix buggy checks.
XvMCScreenKey is defined as XvMCScreenKeyRec's address, so will never be
NULL. Use the check proposed by Alan Coopersmith and Jeremy Huddleston
instead.
Those warnings go away accordingly:
| CC xvmc.lo
| xvmc.c: In function 'ProcXvMCListSubpictureTypes':
| xvmc.c:490:22: warning: the comparison will always evaluate as 'false' for the address of 'XvMCScreenKeyRec' will never be NULL [-Waddress]
| xvmc.c: In function 'XvMCExtensionInit':
| xvmc.c:671:21: warning: the comparison will always evaluate as 'false' for the address of 'XvMCScreenKeyRec' will never be NULL [-Waddress]
| xvmc.c: In function 'XvMCFindXvImage':
| xvmc.c:749:22: warning: the comparison will always evaluate as 'false' for the address of 'XvMCScreenKeyRec' will never be NULL [-Waddress]
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Cyril Brulebois <kibi@debian.org>
(cherry picked from commit 9da5aa09d7)
This commit is contained in:
parent
9fab8b475d
commit
1834e82b42
1 changed files with 6 additions and 5 deletions
|
|
@ -487,8 +487,8 @@ ProcXvMCListSubpictureTypes(ClientPtr client)
|
|||
|
||||
pScreen = pPort->pAdaptor->pScreen;
|
||||
|
||||
if(XvMCScreenKey == NULL) /* No XvMC adaptors */
|
||||
return BadMatch;
|
||||
if (!dixPrivateKeyRegistered(XvMCScreenKey))
|
||||
return BadMatch; /* No XvMC adaptors */
|
||||
|
||||
if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen)))
|
||||
return BadMatch; /* None this screen */
|
||||
|
|
@ -668,7 +668,7 @@ XvMCExtensionInit(void)
|
|||
{
|
||||
ExtensionEntry *extEntry;
|
||||
|
||||
if(XvMCScreenKey == NULL) /* nobody supports it */
|
||||
if (!dixPrivateKeyRegistered(XvMCScreenKey))
|
||||
return;
|
||||
|
||||
if(!(XvMCRTContext = CreateNewResourceType(XvMCDestroyContextRes,
|
||||
|
|
@ -746,7 +746,8 @@ XvImagePtr XvMCFindXvImage(XvPortPtr pPort, CARD32 id)
|
|||
XvMCAdaptorPtr adaptor = NULL;
|
||||
int i;
|
||||
|
||||
if(XvMCScreenKey == NULL) return NULL;
|
||||
if (!dixPrivateKeyRegistered(XvMCScreenKey))
|
||||
return NULL;
|
||||
|
||||
if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen)))
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue