Commit 8ed8a43d authored by Mihai Moldovan's avatar Mihai Moldovan

nx-X11: add more NULL guards to TEST and DEBUG sections of Render.c.

Cherry-picked from branch 3.5.0.x.
parent ab4e5bf6
...@@ -26,6 +26,9 @@ nx-libs (2:3.5.0.32-0x2go1) UNRELEASED; urgency=low ...@@ -26,6 +26,9 @@ nx-libs (2:3.5.0.32-0x2go1) UNRELEASED; urgency=low
* nx-X11: fix typo in previous patch. * nx-X11: fix typo in previous patch.
Affects: Affects:
- 0017_nx-X11_fix-SetPictureFilter.full.patch - 0017_nx-X11_fix-SetPictureFilter.full.patch
* nx-X11: add more NULL guards to TEST and DEBUG sections of Render.c.
Affects:
- 0990_fix-DEBUG-and-TEST-builds.full.patch
-- X2Go Release Manager <git-admin@x2go.org> Tue, 17 Mar 2015 19:19:32 +0100 -- X2Go Release Manager <git-admin@x2go.org> Tue, 17 Mar 2015 19:19:32 +0100
......
...@@ -946,7 +946,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask) ...@@ -946,7 +946,7 @@ void nxagentChangePicture(PicturePtr pPicture, Mask mask)
#ifdef TEST #ifdef TEST
if (pPicture -> pDrawable -> type == DRAWABLE_PIXMAP) if (pPicture && pPicture->pDrawable && pPicture -> pDrawable -> type == DRAWABLE_PIXMAP)
{ {
fprintf(stderr, "nxagentChangePicture: %sPixmap [%p] Picture [%p][%p].\n", fprintf(stderr, "nxagentChangePicture: %sPixmap [%p] Picture [%p][%p].\n",
nxagentIsShmPixmap((PixmapPtr)pPicture -> pDrawable) ? "Shared " : "", nxagentIsShmPixmap((PixmapPtr)pPicture -> pDrawable) ? "Shared " : "",
...@@ -1008,7 +1008,7 @@ void nxagentComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pD ...@@ -1008,7 +1008,7 @@ void nxagentComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pD
#ifdef DEBUG #ifdef DEBUG
if (pSrc -> pDrawable != NULL) if (pSrc && pSrc -> pDrawable != NULL)
{ {
fprintf(stderr, "nxagentComposite: Source Picture [%lu][%p] with drawable [%s%s][%p].\n", fprintf(stderr, "nxagentComposite: Source Picture [%lu][%p] with drawable [%s%s][%p].\n",
nxagentPicturePriv(pSrc) -> picture, (void *) pSrc, nxagentPicturePriv(pSrc) -> picture, (void *) pSrc,
...@@ -1018,14 +1018,16 @@ void nxagentComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pD ...@@ -1018,14 +1018,16 @@ void nxagentComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pD
(void *) pSrc -> pDrawable); (void *) pSrc -> pDrawable);
} }
if (pDst && pDst->pDrawable) {
fprintf(stderr, "nxagentComposite: Destination Picture [%lu][%p] with drawable [%s%s][%p].\n", fprintf(stderr, "nxagentComposite: Destination Picture [%lu][%p] with drawable [%s%s][%p].\n",
nxagentPicturePriv(pDst) -> picture, (void *) pDst, nxagentPicturePriv(pDst) -> picture, (void *) pDst,
(pDst -> pDrawable -> type == DRAWABLE_PIXMAP && (pDst -> pDrawable -> type == DRAWABLE_PIXMAP &&
nxagentIsShmPixmap((PixmapPtr) pDst -> pDrawable)) ? "Shared " : "", nxagentIsShmPixmap((PixmapPtr) pDst -> pDrawable)) ? "Shared " : "",
pDst -> pDrawable -> type == DRAWABLE_PIXMAP ? "Pixmap" : "Window", pDst -> pDrawable -> type == DRAWABLE_PIXMAP ? "Pixmap" : "Window",
(void *) pDst -> pDrawable); (void *) pDst -> pDrawable);
}
if (pMask) if (pMask && pMask->pDrawable)
{ {
fprintf(stderr, "nxagentComposite: Mask Picture [%lu][%p] with drawable [%s%s][%p].\n", fprintf(stderr, "nxagentComposite: Mask Picture [%lu][%p] with drawable [%s%s][%p].\n",
nxagentPicturePriv(pMask) -> picture, (void *) pMask, nxagentPicturePriv(pMask) -> picture, (void *) pMask,
...@@ -1042,12 +1044,13 @@ void nxagentComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pD ...@@ -1042,12 +1044,13 @@ void nxagentComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pD
pDstRegion = nxagentCreateRegion(pDst -> pDrawable, NULL, xDst, yDst, width, height); pDstRegion = nxagentCreateRegion(pDst -> pDrawable, NULL, xDst, yDst, width, height);
#ifdef TEST #ifdef TEST
if ((pDstRegion) && (pDst && pDst->pDrawable)) {
fprintf(stderr, "nxagentComposite: WARNING! Prevented operation on region [%d,%d,%d,%d] " fprintf(stderr, "nxagentComposite: WARNING! Prevented operation on region [%d,%d,%d,%d] "
"for drawable at [%p] with type [%s].\n", pDstRegion -> extents.x1, "for drawable at [%p] with type [%s].\n", pDstRegion -> extents.x1,
pDstRegion -> extents.y1, pDstRegion -> extents.x2, pDstRegion -> extents.y2, pDstRegion -> extents.y1, pDstRegion -> extents.x2, pDstRegion -> extents.y2,
(void *) pDst -> pDrawable, (void *) pDst -> pDrawable,
pDst -> pDrawable -> type == DRAWABLE_PIXMAP ? "pixmap" : "window"); pDst -> pDrawable -> type == DRAWABLE_PIXMAP ? "pixmap" : "window");
}
#endif #endif
nxagentMarkCorruptedRegion(pDst -> pDrawable, pDstRegion); nxagentMarkCorruptedRegion(pDst -> pDrawable, pDstRegion);
...@@ -1176,10 +1179,12 @@ void nxagentGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, ...@@ -1176,10 +1179,12 @@ void nxagentGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
} }
#ifdef TEST #ifdef TEST
if ((pSrc && pSrc->pDrawable) && (pDst && pDst->pDrawable)) {
fprintf(stderr, "nxagentGlyphs: Called with source [%s][%p] destination [%s][%p] and size id [%d].\n", fprintf(stderr, "nxagentGlyphs: Called with source [%s][%p] destination [%s][%p] and size id [%d].\n",
(pSrc -> pDrawable -> type == DRAWABLE_PIXMAP ? "pixmap" : "window"), (void *) pSrc, (pSrc -> pDrawable -> type == DRAWABLE_PIXMAP ? "pixmap" : "window"), (void *) pSrc,
(pDst -> pDrawable -> type == DRAWABLE_PIXMAP ? "pixmap" : "window"), (void *) pDst, (pDst -> pDrawable -> type == DRAWABLE_PIXMAP ? "pixmap" : "window"), (void *) pDst,
sizeID); sizeID);
}
#endif #endif
pForm = NULL; pForm = NULL;
...@@ -1264,9 +1269,11 @@ void nxagentGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, ...@@ -1264,9 +1269,11 @@ void nxagentGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
nxagentDrawableStatus(pSrc -> pDrawable) == NotSynchronized) nxagentDrawableStatus(pSrc -> pDrawable) == NotSynchronized)
{ {
#ifdef TEST #ifdef TEST
if (pSrc && pSrc->pDrawable) {
fprintf(stderr, "nxagentGlyphs: Synchronizing source [%s] at [%p].\n", fprintf(stderr, "nxagentGlyphs: Synchronizing source [%s] at [%p].\n",
pSrc -> pDrawable -> type == DRAWABLE_PIXMAP ? "pixmap" : "window", pSrc -> pDrawable -> type == DRAWABLE_PIXMAP ? "pixmap" : "window",
(void *) pSrc -> pDrawable); (void *) pSrc -> pDrawable);
}
#endif #endif
/* /*
...@@ -1280,12 +1287,14 @@ void nxagentGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, ...@@ -1280,12 +1287,14 @@ void nxagentGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
if (pSrc -> repeat == 1 || nxagentGlyphsExtents == NullBox) if (pSrc -> repeat == 1 || nxagentGlyphsExtents == NullBox)
{ {
#ifdef DEBUG #ifdef DEBUG
if (pSrc && pSrc->pDrawable) {
fprintf(stderr, "nxagentGlyphs: Synchronizing source [%s] at [%p] " fprintf(stderr, "nxagentGlyphs: Synchronizing source [%s] at [%p] "
"with geometry [%d,%d,%d,%d].\n", "with geometry [%d,%d,%d,%d].\n",
(pSrc -> pDrawable -> type == DRAWABLE_PIXMAP ? "pixmap" : "window"), (pSrc -> pDrawable -> type == DRAWABLE_PIXMAP ? "pixmap" : "window"),
(void *) pSrc -> pDrawable, pSrc -> pDrawable -> x, pSrc -> pDrawable -> y, (void *) pSrc -> pDrawable, pSrc -> pDrawable -> x, pSrc -> pDrawable -> y,
pSrc -> pDrawable -> x + pSrc -> pDrawable -> width, pSrc -> pDrawable -> x + pSrc -> pDrawable -> width,
pSrc -> pDrawable -> y + pSrc -> pDrawable -> height); pSrc -> pDrawable -> y + pSrc -> pDrawable -> height);
}
#endif #endif
nxagentSynchronizeBox(pSrc -> pDrawable, NullBox, NEVER_BREAK); nxagentSynchronizeBox(pSrc -> pDrawable, NullBox, NEVER_BREAK);
...@@ -1293,12 +1302,14 @@ void nxagentGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, ...@@ -1293,12 +1302,14 @@ void nxagentGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
else else
{ {
#ifdef DEBUG #ifdef DEBUG
if (pSrc && pSrc->pDrawable) {
fprintf(stderr, "nxagentGlyphs: Synchronizing region [%d,%d,%d,%d] of source [%s] at [%p] " fprintf(stderr, "nxagentGlyphs: Synchronizing region [%d,%d,%d,%d] of source [%s] at [%p] "
"with geometry [%d,%d,%d,%d].\n", glyphBox.x1, glyphBox.y1, glyphBox.x2, glyphBox.y2, "with geometry [%d,%d,%d,%d].\n", glyphBox.x1, glyphBox.y1, glyphBox.x2, glyphBox.y2,
(pSrc -> pDrawable -> type == DRAWABLE_PIXMAP ? "pixmap" : "window"), (pSrc -> pDrawable -> type == DRAWABLE_PIXMAP ? "pixmap" : "window"),
(void *) pSrc -> pDrawable, pSrc -> pDrawable -> x, pSrc -> pDrawable -> y, (void *) pSrc -> pDrawable, pSrc -> pDrawable -> x, pSrc -> pDrawable -> y,
pSrc -> pDrawable -> x + pSrc -> pDrawable -> width, pSrc -> pDrawable -> x + pSrc -> pDrawable -> width,
pSrc -> pDrawable -> y + pSrc -> pDrawable -> height); pSrc -> pDrawable -> y + pSrc -> pDrawable -> height);
}
#endif #endif
nxagentSynchronizeBox(pSrc -> pDrawable, &glyphBox, NEVER_BREAK); nxagentSynchronizeBox(pSrc -> pDrawable, &glyphBox, NEVER_BREAK);
...@@ -1314,20 +1325,24 @@ void nxagentGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, ...@@ -1314,20 +1325,24 @@ void nxagentGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
nxagentDrawableStatus(pDst -> pDrawable) == NotSynchronized) nxagentDrawableStatus(pDst -> pDrawable) == NotSynchronized)
{ {
#ifdef TEST #ifdef TEST
if (pDst && pDst->pDrawable) {
fprintf(stderr, "nxagentGlyphs: Synchronizing destination [%s] at [%p].\n", fprintf(stderr, "nxagentGlyphs: Synchronizing destination [%s] at [%p].\n",
pDst -> pDrawable -> type == DRAWABLE_PIXMAP ? "pixmap" : "window", pDst -> pDrawable -> type == DRAWABLE_PIXMAP ? "pixmap" : "window",
(void *) pDst -> pDrawable); (void *) pDst -> pDrawable);
}
#endif #endif
if (nxagentGlyphsExtents == NullBox) if (nxagentGlyphsExtents == NullBox)
{ {
#ifdef DEBUG #ifdef DEBUG
if (pDst && pDst->pDrawable) {
fprintf(stderr, "nxagentGlyphs: Synchronizing destination [%s] at [%p] " fprintf(stderr, "nxagentGlyphs: Synchronizing destination [%s] at [%p] "
"with geometry [%d,%d,%d,%d].\n", "with geometry [%d,%d,%d,%d].\n",
(pDst -> pDrawable -> type == DRAWABLE_PIXMAP ? "pixmap" : "window"), (pDst -> pDrawable -> type == DRAWABLE_PIXMAP ? "pixmap" : "window"),
(void *) pDst -> pDrawable, pDst -> pDrawable -> x, pDst -> pDrawable -> y, (void *) pDst -> pDrawable, pDst -> pDrawable -> x, pDst -> pDrawable -> y,
pDst -> pDrawable -> x + pDst -> pDrawable -> width, pDst -> pDrawable -> x + pDst -> pDrawable -> width,
pDst -> pDrawable -> y + pDst -> pDrawable -> height); pDst -> pDrawable -> y + pDst -> pDrawable -> height);
}
#endif #endif
nxagentSynchronizeBox(pDst -> pDrawable, NullBox, NEVER_BREAK); nxagentSynchronizeBox(pDst -> pDrawable, NullBox, NEVER_BREAK);
...@@ -1335,12 +1350,14 @@ void nxagentGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, ...@@ -1335,12 +1350,14 @@ void nxagentGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
else else
{ {
#ifdef DEBUG #ifdef DEBUG
if (pDst && pDst->pDrawable) {
fprintf(stderr, "nxagentGlyphs: Synchronizing region [%d,%d,%d,%d] of destination [%s] at [%p] " fprintf(stderr, "nxagentGlyphs: Synchronizing region [%d,%d,%d,%d] of destination [%s] at [%p] "
"with geometry [%d,%d,%d,%d].\n", glyphBox.x1, glyphBox.y1, glyphBox.x2, glyphBox.y2, "with geometry [%d,%d,%d,%d].\n", glyphBox.x1, glyphBox.y1, glyphBox.x2, glyphBox.y2,
(pDst -> pDrawable -> type == DRAWABLE_PIXMAP ? "pixmap" : "window"), (pDst -> pDrawable -> type == DRAWABLE_PIXMAP ? "pixmap" : "window"),
(void *) pDst -> pDrawable, pDst -> pDrawable -> x, pDst -> pDrawable -> y, (void *) pDst -> pDrawable, pDst -> pDrawable -> x, pDst -> pDrawable -> y,
pDst -> pDrawable -> x + pDst -> pDrawable -> width, pDst -> pDrawable -> x + pDst -> pDrawable -> width,
pDst -> pDrawable -> y + pDst -> pDrawable -> height); pDst -> pDrawable -> y + pDst -> pDrawable -> height);
}
#endif #endif
nxagentSynchronizeBox(pDst -> pDrawable, &glyphBox, NEVER_BREAK); nxagentSynchronizeBox(pDst -> pDrawable, &glyphBox, NEVER_BREAK);
...@@ -1355,9 +1372,11 @@ void nxagentGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, ...@@ -1355,9 +1372,11 @@ void nxagentGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
nxagentSetDrawableContainGlyphs(pDst -> pDrawable, 1); nxagentSetDrawableContainGlyphs(pDst -> pDrawable, 1);
#ifdef TEST #ifdef TEST
if (pDst && pDst->pDrawable) {
fprintf(stderr, "nxagentGlyphs: Glyph flag set on drawable [%s][%p].\n", fprintf(stderr, "nxagentGlyphs: Glyph flag set on drawable [%s][%p].\n",
pDst -> pDrawable -> type == DRAWABLE_PIXMAP ? "pixmap" : "window", pDst -> pDrawable -> type == DRAWABLE_PIXMAP ? "pixmap" : "window",
(void *) pDst -> pDrawable); (void *) pDst -> pDrawable);
}
#endif #endif
#ifdef SPLIT_GLYPH_LISTS #ifdef SPLIT_GLYPH_LISTS
...@@ -1569,9 +1588,11 @@ void nxagentCompositeRects(CARD8 op, PicturePtr pDst, xRenderColor *color, ...@@ -1569,9 +1588,11 @@ void nxagentCompositeRects(CARD8 op, PicturePtr pDst, xRenderColor *color,
} }
#ifdef TEST #ifdef TEST
if (pDst && pDst->pDrawable) {
fprintf(stderr, "nxagentCompositeRects: Called for picture at [%p] with [%s] at [%p].\n", fprintf(stderr, "nxagentCompositeRects: Called for picture at [%p] with [%s] at [%p].\n",
(void *) pDst, (pDst -> pDrawable -> type == DRAWABLE_PIXMAP ? "pixmap" : "window"), (void *) pDst, (pDst -> pDrawable -> type == DRAWABLE_PIXMAP ? "pixmap" : "window"),
(void *) pDst -> pDrawable); (void *) pDst -> pDrawable);
}
#endif #endif
/* /*
...@@ -1703,11 +1724,13 @@ FIXME: Is this useful or just a waste of bandwidth? ...@@ -1703,11 +1724,13 @@ FIXME: Is this useful or just a waste of bandwidth?
nxagentTrapezoidExtents) == rgnIN) nxagentTrapezoidExtents) == rgnIN)
{ {
#ifdef TEST #ifdef TEST
if (pDst && pDst->pDrawable) {
fprintf(stderr, "nxagentTrapezoids: WARNING! Prevented operation on region [%d,%d,%d,%d] already dirty " fprintf(stderr, "nxagentTrapezoids: WARNING! Prevented operation on region [%d,%d,%d,%d] already dirty "
"for drawable [%s][%p].\n", nxagentTrapezoidExtents -> x1, nxagentTrapezoidExtents -> y1, "for drawable [%s][%p].\n", nxagentTrapezoidExtents -> x1, nxagentTrapezoidExtents -> y1,
nxagentTrapezoidExtents -> x2, nxagentTrapezoidExtents -> y2, nxagentTrapezoidExtents -> x2, nxagentTrapezoidExtents -> y2,
pDst -> pDrawable -> type == DRAWABLE_PIXMAP ? "pixmap" : "window", pDst -> pDrawable -> type == DRAWABLE_PIXMAP ? "pixmap" : "window",
(void *) pDst -> pDrawable); (void *) pDst -> pDrawable);
}
#endif #endif
if (pDst -> pDrawable -> type == DRAWABLE_PIXMAP) if (pDst -> pDrawable -> type == DRAWABLE_PIXMAP)
...@@ -1733,11 +1756,13 @@ FIXME: Is this useful or just a waste of bandwidth? ...@@ -1733,11 +1756,13 @@ FIXME: Is this useful or just a waste of bandwidth?
nxagentTrapezoidExtents -> y2 - nxagentTrapezoidExtents -> y1); nxagentTrapezoidExtents -> y2 - nxagentTrapezoidExtents -> y1);
#ifdef TEST #ifdef TEST
if (pDst && pDst->pDrawable) {
fprintf(stderr, "nxagentTrapezoids: WARNING! Prevented operation on region [%d,%d,%d,%d] " fprintf(stderr, "nxagentTrapezoids: WARNING! Prevented operation on region [%d,%d,%d,%d] "
"for drawable [%s][%p].\n", pDstRegion -> extents.x1, pDstRegion -> extents.y1, "for drawable [%s][%p].\n", pDstRegion -> extents.x1, pDstRegion -> extents.y1,
pDstRegion -> extents.x2, pDstRegion -> extents.y2, pDstRegion -> extents.x2, pDstRegion -> extents.y2,
pDst -> pDrawable -> type == DRAWABLE_PIXMAP ? "pixmap" : "window", pDst -> pDrawable -> type == DRAWABLE_PIXMAP ? "pixmap" : "window",
(void *) pDst -> pDrawable); (void *) pDst -> pDrawable);
}
#endif #endif
nxagentMarkCorruptedRegion(pDst -> pDrawable, pDstRegion); nxagentMarkCorruptedRegion(pDst -> pDrawable, pDstRegion);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment