Module Name: xsrc
Committed By: macallan
Date: Fri Jan 13 20:58:40 UTC 2017
Modified Files:
xsrc/external/mit/xf86-video-suncg14/dist/src: cg14_accel.c
Log Message:
CG14CheckComposite():
- don't crash with SX_DEBUG set
- check destination format
To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 \
xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c
diff -u xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c:1.9 xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c:1.10
--- xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c:1.9 Fri Sep 16 22:05:47 2016
+++ xsrc/external/mit/xf86-video-suncg14/dist/src/cg14_accel.c Fri Jan 13 20:58:40 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: cg14_accel.c,v 1.9 2016/09/16 22:05:47 macallan Exp $ */
+/* $NetBSD: cg14_accel.c,v 1.10 2017/01/13 20:58:40 macallan Exp $ */
/*
* Copyright (c) 2013 Michael Lorenz
* All rights reserved.
@@ -549,20 +549,37 @@ CG14CheckComposite(int op, PicturePtr pS
DPRINTF(X_ERROR, "%s: rejecting %d\n", __func__, op);
return FALSE;
}
- i = 0;
- while ((i < arraysize(src_formats)) && (!ok)) {
- ok = (pSrcPicture->format == src_formats[i]);
- i++;
- }
- if (!ok) {
- DPRINTF(X_ERROR, "%s: unsupported src format %x\n",
- __func__, pSrcPicture->format);
- return FALSE;
+ if (pSrcPicture != NULL) {
+ i = 0;
+ while ((i < arraysize(src_formats)) && (!ok)) {
+ ok = (pSrcPicture->format == src_formats[i]);
+ i++;
+ }
+
+ if (!ok) {
+ DPRINTF(X_ERROR, "%s: unsupported src format %x\n",
+ __func__, pSrcPicture->format);
+ return FALSE;
+ }
+ DPRINTF(X_ERROR, "src is %x, %d\n", pSrcPicture->format, op);
}
- DPRINTF(X_ERROR, "src is %x, %d: %d %d\n", pSrcPicture->format, op,
- pSrcPicture->pDrawable->width, pSrcPicture->pDrawable->height);
+ if (pDstPicture != NULL) {
+ i = 0;
+ ok = FALSE;
+ while ((i < arraysize(src_formats)) && (!ok)) {
+ ok = (pDstPicture->format == src_formats[i]);
+ i++;
+ }
+
+ if (!ok) {
+ DPRINTF(X_ERROR, "%s: unsupported dst format %x\n",
+ __func__, pDstPicture->format);
+ return FALSE;
+ }
+ DPRINTF(X_ERROR, "dst is %x, %d\n", pDstPicture->format, op);
+ }
if (pMaskPicture != NULL) {
DPRINTF(X_ERROR, "mask is %x %d %d\n", pMaskPicture->format,