summaryrefslogtreecommitdiff
path: root/Xext/xvmain.c
diff options
context:
space:
mode:
Diffstat (limited to 'Xext/xvmain.c')
-rw-r--r--Xext/xvmain.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/Xext/xvmain.c b/Xext/xvmain.c
index c6c10e544..2c3f484bd 100644
--- a/Xext/xvmain.c
+++ b/Xext/xvmain.c
@@ -21,7 +21,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
-/* $XFree86: xc/programs/Xserver/Xext/xvmain.c,v 1.13 2001/08/23 13:01:36 alanh Exp $ */
+/* $XFree86: xc/programs/Xserver/Xext/xvmain.c,v 1.16 2003/10/28 23:08:44 tsi Exp $ */
/*
** File:
@@ -101,7 +101,7 @@ SOFTWARE.
#ifdef PANORAMIX
#include "panoramiX.h"
#include "panoramiXsrv.h"
-extern void XineramifyXv(void);
+#include "xvdisp.h"
#endif
int XvScreenIndex = -1;
@@ -594,6 +594,15 @@ XvdiSendPortNotify(
}
+
+#define CHECK_SIZE(dw, dh, sw, sh) { \
+ if(!dw || !dh || !sw || !sh) return Success; \
+ /* The region code will break these if they are too large */ \
+ if((dw > 32767) || (dh > 32767) || (sw > 32767) || (sh > 32767)) \
+ return BadValue; \
+}
+
+
int
XvdiPutVideo(
ClientPtr client,
@@ -605,11 +614,9 @@ XvdiPutVideo(
INT16 drw_x, INT16 drw_y,
CARD16 drw_w, CARD16 drw_h
){
- int status;
DrawablePtr pOldDraw;
- if(!drw_w || !drw_h || !vid_w || !vid_h)
- return Success;
+ CHECK_SIZE(drw_w, drw_h, vid_w, vid_h);
/* UPDATE TIME VARIABLES FOR USE IN EVENTS */
@@ -633,7 +640,7 @@ XvdiPutVideo(
XvdiSendVideoNotify(pPort, pPort->pDraw, XvPreempted);
}
- status = (* pPort->pAdaptor->ddPutVideo)(client, pDraw, pPort, pGC,
+ (void) (* pPort->pAdaptor->ddPutVideo)(client, pDraw, pPort, pGC,
vid_x, vid_y, vid_w, vid_h,
drw_x, drw_y, drw_w, drw_h);
@@ -662,8 +669,7 @@ XvdiPutStill(
){
int status;
- if(!drw_w || !drw_h || !vid_w || !vid_h)
- return Success;
+ CHECK_SIZE(drw_w, drw_h, vid_w, vid_h);
/* UPDATE TIME VARIABLES FOR USE IN EVENTS */
@@ -703,8 +709,7 @@ XvdiPutImage(
Bool sync,
CARD16 width, CARD16 height
){
- if(!drw_w || !drw_h || !src_w || !src_h)
- return Success;
+ CHECK_SIZE(drw_w, drw_h, src_w, src_h);
/* UPDATE TIME VARIABLES FOR USE IN EVENTS */
@@ -739,11 +744,9 @@ XvdiGetVideo(
INT16 drw_x, INT16 drw_y,
CARD16 drw_w, CARD16 drw_h
){
- int status;
DrawablePtr pOldDraw;
- if(!drw_w || !drw_h || !vid_w || !vid_h)
- return Success;
+ CHECK_SIZE(drw_w, drw_h, vid_w, vid_h);
/* UPDATE TIME VARIABLES FOR USE IN EVENTS */
@@ -767,7 +770,7 @@ XvdiGetVideo(
XvdiSendVideoNotify(pPort, pPort->pDraw, XvPreempted);
}
- status = (* pPort->pAdaptor->ddGetVideo)(client, pDraw, pPort, pGC,
+ (void) (* pPort->pAdaptor->ddGetVideo)(client, pDraw, pPort, pGC,
vid_x, vid_y, vid_w, vid_h,
drw_x, drw_y, drw_w, drw_h);
@@ -796,8 +799,7 @@ XvdiGetStill(
){
int status;
- if(!drw_w || !drw_h || !vid_w || !vid_h)
- return Success;
+ CHECK_SIZE(drw_w, drw_h, vid_w, vid_h);
/* UPDATE TIME VARIABLES FOR USE IN EVENTS */