aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xext
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/Xext')
-rw-r--r--xorg-server/Xext/panoramiX.c5
-rw-r--r--xorg-server/Xext/xvmc.c8
2 files changed, 8 insertions, 5 deletions
diff --git a/xorg-server/Xext/panoramiX.c b/xorg-server/Xext/panoramiX.c
index 070f54d7a..6eefa9789 100644
--- a/xorg-server/Xext/panoramiX.c
+++ b/xorg-server/Xext/panoramiX.c
@@ -1051,14 +1051,15 @@ int
ProcXineramaQueryScreens(ClientPtr client)
{
/* REQUEST(xXineramaQueryScreensReq); */
+ CARD32 number = (noPanoramiXExtension) ? 0 : PanoramiXNumScreens;
xXineramaQueryScreensReply rep;
REQUEST_SIZE_MATCH(xXineramaQueryScreensReq);
rep.type = X_Reply;
rep.sequenceNumber = client->sequence;
- rep.number = (noPanoramiXExtension) ? 0 : PanoramiXNumScreens;
- rep.length = bytes_to_int32(rep.number * sz_XineramaScreenInfo);
+ rep.length = bytes_to_int32(number * sz_XineramaScreenInfo);
+ rep.number = number;
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
diff --git a/xorg-server/Xext/xvmc.c b/xorg-server/Xext/xvmc.c
index 8d93cc3b0..5f0123b32 100644
--- a/xorg-server/Xext/xvmc.c
+++ b/xorg-server/Xext/xvmc.c
@@ -135,6 +135,7 @@ ProcXvMCListSurfaceTypes(ClientPtr client)
xvmcSurfaceInfo info;
XvMCAdaptorPtr adaptor = NULL;
XvMCSurfaceInfoPtr surface;
+ int num_surfaces;
REQUEST(xvmcListSurfaceTypesReq);
REQUEST_SIZE_MATCH(xvmcListSurfaceTypesReq);
@@ -154,16 +155,17 @@ ProcXvMCListSurfaceTypes(ClientPtr client)
}
}
+ num_surfaces = (adaptor) ? adaptor->num_surfaces : 0;
rep = (xvmcListSurfaceTypesReply) {
.type = X_Reply,
.sequenceNumber = client->sequence,
- .num = (adaptor) ? adaptor->num_surfaces : 0,
- .length = bytes_to_int32(rep.num * sizeof(xvmcSurfaceInfo)),
+ .num = num_surfaces,
+ .length = bytes_to_int32(num_surfaces * sizeof(xvmcSurfaceInfo)),
};
WriteToClient(client, sizeof(xvmcListSurfaceTypesReply), &rep);
- for (i = 0; i < rep.num; i++) {
+ for (i = 0; i < num_surfaces; i++) {
surface = adaptor->surfaces[i];
info.surface_type_id = surface->surface_type_id;
info.chroma_format = surface->chroma_format;