[PATCH xserver 1/5] xv: Fix unchecked AddResource
Adam Jackson
ajax at redhat.com
Tue Mar 1 19:09:29 UTC 2016
Signed-off-by: Adam Jackson <ajax at redhat.com>
---
Xext/xvmain.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/Xext/xvmain.c b/Xext/xvmain.c
index 0c6f25b..3a02634 100644
--- a/Xext/xvmain.c
+++ b/Xext/xvmain.c
@@ -844,7 +844,8 @@ XvdiSelectVideoNotify(ClientPtr client, DrawablePtr pDraw, BOOL onoff)
tpn->client = NULL;
tpn->id = FakeClientID(client->index);
- AddResource(tpn->id, XvRTVideoNotify, tpn);
+ if (!AddResource(tpn->id, XvRTVideoNotify, tpn))
+ return BadAlloc;
tpn->client = client;
return Success;
@@ -893,7 +894,8 @@ XvdiSelectPortNotify(ClientPtr client, XvPortPtr pPort, BOOL onoff)
tpn->client = client;
tpn->id = FakeClientID(client->index);
- AddResource(tpn->id, XvRTPortNotify, tpn);
+ if (!AddResource(tpn->id, XvRTPortNotify, tpn))
+ return BadAlloc;
return Success;
--
2.5.0
More information about the xorg-devel
mailing list