pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/x11/pixman Fix a null pointer dereference, some warnin...
details: https://anonhg.NetBSD.org/pkgsrc/rev/b42f2f3fe38d
branches: trunk
changeset: 538725:b42f2f3fe38d
user: bjs <bjs%pkgsrc.org@localhost>
date: Mon Feb 18 05:36:51 2008 +0000
description:
Fix a null pointer dereference, some warnings, and add refactored code
for FbFetchTransformed() from GIT. Bump rev.
diffstat:
x11/pixman/Makefile | 4 +-
x11/pixman/distinfo | 4 +-
x11/pixman/patches/patch-aa | 1045 +++++++++++++++++++++++++++++++++++++++++++
x11/pixman/patches/patch-ab | 13 +
4 files changed, 1063 insertions(+), 3 deletions(-)
diffs (truncated from 1092 to 300 lines):
diff -r 18f12d62f331 -r b42f2f3fe38d x11/pixman/Makefile
--- a/x11/pixman/Makefile Mon Feb 18 00:00:59 2008 +0000
+++ b/x11/pixman/Makefile Mon Feb 18 05:36:51 2008 +0000
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.5 2008/02/07 06:40:27 bjs Exp $
+# $NetBSD: Makefile,v 1.6 2008/02/18 05:36:51 bjs Exp $
#
DISTNAME= pixman-0.9.6
-PKGREVISION= 4
+PKGREVISION= 5
CATEGORIES= x11
MASTER_SITES= ${MASTER_SITE_LOCAL}
EXTRACT_SUFX= .tar.bz2
diff -r 18f12d62f331 -r b42f2f3fe38d x11/pixman/distinfo
--- a/x11/pixman/distinfo Mon Feb 18 00:00:59 2008 +0000
+++ b/x11/pixman/distinfo Mon Feb 18 05:36:51 2008 +0000
@@ -1,5 +1,7 @@
-$NetBSD: distinfo,v 1.5 2008/02/07 06:40:27 bjs Exp $
+$NetBSD: distinfo,v 1.6 2008/02/18 05:36:51 bjs Exp $
SHA1 (pixman-0.9.6.tar.bz2) = 9dc40e9c1610080a92b054cdbf1c417f605eb5ce
RMD160 (pixman-0.9.6.tar.bz2) = 928e18c06b959b6e7cb7f13ebf113fd2d8cf9493
Size (pixman-0.9.6.tar.bz2) = 281291 bytes
+SHA1 (patch-aa) = df0b5e160aaa382a5671c67db36cfafe93c6f9c6
+SHA1 (patch-ab) = b0404cfca7ed89c433aff34d9c5e0ab02b4495df
diff -r 18f12d62f331 -r b42f2f3fe38d x11/pixman/patches/patch-aa
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/pixman/patches/patch-aa Mon Feb 18 05:36:51 2008 +0000
@@ -0,0 +1,1045 @@
+$NetBSD: patch-aa,v 1.4 2008/02/18 05:36:51 bjs Exp $
+
+--- pixman/pixman-compose.c.orig 2008-02-18 00:32:50.000000000 -0500
++++ pixman/pixman-compose.c
+@@ -3678,19 +3678,516 @@ static void pixmanFetchSourcePict(source
+ }
+ }
+
+-static void fbFetchTransformed(bits_image_t * pict, int x, int y, int width, uint32_t *buffer, uint32_t *mask, uint32_t maskBits)
++/*
++ * Fetch from region strategies
++ */
++typedef FASTCALL uint32_t (*fetchFromRegionProc)(bits_image_t *pict, int x, int y, uint32_t *buffer, fetchPixelProc fetch, pixman_box16_t *box);
++
++static inline uint32_t
++fbFetchFromNoRegion(bits_image_t *pict, int x, int y, uint32_t *buffer, fetchPixelProc fetch, pixman_box16_t *box)
+ {
+- uint32_t *bits;
+- int32_t stride;
++ return fetch (pict, x, y);
++}
++
++static uint32_t
++fbFetchFromNRectangles(bits_image_t *pict, int x, int y, uint32_t *buffer, fetchPixelProc fetch, pixman_box16_t *box)
++{
++ pixman_box16_t box2;
++ if (pixman_region_contains_point (pict->common.src_clip, x, y, &box2))
++ return fbFetchFromNoRegion(pict, x, y, buffer, fetch, box);
++ else
++ return 0;
++}
++
++static uint32_t
++fbFetchFromOneRectangle(bits_image_t *pict, int x, int y, uint32_t *buffer, fetchPixelProc fetch, pixman_box16_t *box)
++{
++ pixman_box16_t box2 = *box;
++ return ((x < box2.x1) | (x >= box2.x2) | (y < box2.y1) | (y >= box2.y2)) ?
++ 0 : fbFetchFromNoRegion(pict, x, y, buffer, fetch, box);
++}
++
++/*
++ * Fetching Algorithms
++ */
++static void
++fbFetchTransformed_Nearest_Normal(bits_image_t * pict, int width, uint32_t *buffer, uint32_t *mask, uint32_t maskBits, pixman_bool_t affine, pixman_vector_t v, pixman_vector_t unit)
++{
++ pixman_box16_t* box = NULL;
+ fetchPixelProc fetch;
+- pixman_vector_t v;
+- pixman_vector_t unit;
+- int i;
+- pixman_box16_t box;
+- pixman_bool_t affine = TRUE;
++ fetchFromRegionProc fetchFromRegion;
++ int x, y, i;
++
++ /* initialize the two function pointers */
++ fetch = fetchPixelProcForPicture(pict);
++
++ if(pixman_region_n_rects (pict->common.src_clip) == 1)
++ fetchFromRegion = fbFetchFromNoRegion;
++ else
++ fetchFromRegion = fbFetchFromNRectangles;
++
++ for ( i = 0; i < width; ++i)
++ {
++ if (!mask || mask[i] & maskBits)
++ {
++ if (!v.vector[2])
++ {
++ *(buffer + i) = 0;
++ }
++ else
++ {
++ if (!affine)
++ {
++ y = MOD(DIV(v.vector[1],v.vector[2]), pict->height);
++ x = MOD(DIV(v.vector[0],v.vector[2]), pict->width);
++ }
++ else
++ {
++ y = MOD(v.vector[1]>>16, pict->height);
++ x = MOD(v.vector[0]>>16, pict->width);
++ }
++ *(buffer + i) = fetchFromRegion(pict, x, y, buffer, fetch, box);
++ }
++ }
++
++ v.vector[0] += unit.vector[0];
++ v.vector[1] += unit.vector[1];
++ v.vector[2] += unit.vector[2];
++ }
++}
++
++static void
++fbFetchTransformed_Nearest_Pad(bits_image_t * pict, int width, uint32_t *buffer, uint32_t *mask, uint32_t maskBits, pixman_bool_t affine, pixman_vector_t v, pixman_vector_t unit)
++{
++ pixman_box16_t *box = NULL;
++ fetchPixelProc fetch;
++ fetchFromRegionProc fetchFromRegion;
++ int x, y, i;
++
++ /* initialize the two function pointers */
++ fetch = fetchPixelProcForPicture(pict);
++
++ if(pixman_region_n_rects (pict->common.src_clip) == 1)
++ fetchFromRegion = fbFetchFromNoRegion;
++ else
++ fetchFromRegion = fbFetchFromNRectangles;
++
++ for (i = 0; i < width; ++i)
++ {
++ if (!mask || mask[i] & maskBits)
++ {
++ if (!v.vector[2])
++ {
++ *(buffer + i) = 0;
++ }
++ else
++ {
++ if (!affine)
++ {
++ y = CLIP(DIV(v.vector[1], v.vector[2]), 0, pict->height-1);
++ x = CLIP(DIV(v.vector[0], v.vector[2]), 0, pict->width-1);
++ }
++ else
++ {
++ y = CLIP(v.vector[1]>>16, 0, pict->height-1);
++ x = CLIP(v.vector[0]>>16, 0, pict->width-1);
++ }
++
++ *(buffer + i) = fetchFromRegion(pict, x, y, buffer, fetch, box);
++ }
++ }
++
++ v.vector[0] += unit.vector[0];
++ v.vector[1] += unit.vector[1];
++ v.vector[2] += unit.vector[2];
++ }
++}
++
++static void
++fbFetchTransformed_Nearest_General(bits_image_t * pict, int width, uint32_t *buffer, uint32_t *mask, uint32_t maskBits, pixman_bool_t affine, pixman_vector_t v, pixman_vector_t unit)
++{
++ pixman_box16_t *box = NULL;
++ fetchPixelProc fetch;
++ fetchFromRegionProc fetchFromRegion;
++ int x, y, i;
+
++ /* initialize the two function pointers */
+ fetch = fetchPixelProcForPicture(pict);
+
++ if(pixman_region_n_rects (pict->common.src_clip) == 1)
++ {
++ box = &(pict->common.src_clip->extents);
++ fetchFromRegion = fbFetchFromOneRectangle;
++ }
++ else
++ {
++ fetchFromRegion = fbFetchFromNRectangles;
++ }
++
++ for (i = 0; i < width; ++i) {
++ if (!mask || mask[i] & maskBits)
++ {
++ if (!v.vector[2]) {
++ *(buffer + i) = 0;
++ } else {
++ if (!affine) {
++ y = DIV(v.vector[1],v.vector[2]);
++ x = DIV(v.vector[0],v.vector[2]);
++ } else {
++ y = v.vector[1]>>16;
++ x = v.vector[0]>>16;
++ }
++ *(buffer + i) = fetchFromRegion(pict, x, y, buffer, fetch, box);
++ }
++ }
++ v.vector[0] += unit.vector[0];
++ v.vector[1] += unit.vector[1];
++ v.vector[2] += unit.vector[2];
++ }
++}
++
++static void
++fbFetchTransformed_Bilinear_Normal(bits_image_t * pict, int width, uint32_t *buffer, uint32_t *mask, uint32_t maskBits, pixman_bool_t affine, pixman_vector_t v, pixman_vector_t unit)
++{
++ pixman_box16_t *box = NULL;
++ fetchPixelProc fetch;
++ fetchFromRegionProc fetchFromRegion;
++ int i;
++
++ /* initialize the two function pointers */
++ fetch = fetchPixelProcForPicture(pict);
++
++ if(pixman_region_n_rects (pict->common.src_clip) == 1)
++ fetchFromRegion = fbFetchFromNoRegion;
++ else
++ fetchFromRegion = fbFetchFromNRectangles;
++
++ for (i = 0; i < width; ++i) {
++ if (!mask || mask[i] & maskBits)
++ {
++ if (!v.vector[2]) {
++ *(buffer + i) = 0;
++ } else {
++ int x1, x2, y1, y2, distx, idistx, disty, idisty;
++ uint32_t tl, tr, bl, br, r;
++ uint32_t ft, fb;
++
++ if (!affine) {
++ pixman_fixed_48_16_t div;
++ div = ((pixman_fixed_48_16_t)v.vector[0] << 16)/v.vector[2];
++ x1 = div >> 16;
++ distx = ((pixman_fixed_t)div >> 8) & 0xff;
++ div = ((pixman_fixed_48_16_t)v.vector[1] << 16)/v.vector[2];
++ y1 = div >> 16;
++ disty = ((pixman_fixed_t)div >> 8) & 0xff;
++ } else {
++ x1 = v.vector[0] >> 16;
++ distx = (v.vector[0] >> 8) & 0xff;
++ y1 = v.vector[1] >> 16;
++ disty = (v.vector[1] >> 8) & 0xff;
++ }
++ x2 = x1 + 1;
++ y2 = y1 + 1;
++
++ idistx = 256 - distx;
++ idisty = 256 - disty;
++
++ x1 = MOD (x1, pict->width);
++ x2 = MOD (x2, pict->width);
++ y1 = MOD (y1, pict->height);
++ y2 = MOD (y2, pict->height);
++
++ tl = fetchFromRegion(pict, x1, y1, buffer, fetch, box);
++ tr = fetchFromRegion(pict, x2, y1, buffer, fetch, box);
++ bl = fetchFromRegion(pict, x1, y2, buffer, fetch, box);
++ br = fetchFromRegion(pict, x2, y2, buffer, fetch, box);
++
++ ft = FbGet8(tl,0) * idistx + FbGet8(tr,0) * distx;
++ fb = FbGet8(bl,0) * idistx + FbGet8(br,0) * distx;
++ r = (((ft * idisty + fb * disty) >> 16) & 0xff);
++ ft = FbGet8(tl,8) * idistx + FbGet8(tr,8) * distx;
++ fb = FbGet8(bl,8) * idistx + FbGet8(br,8) * distx;
++ r |= (((ft * idisty + fb * disty) >> 8) & 0xff00);
++ ft = FbGet8(tl,16) * idistx + FbGet8(tr,16) * distx;
++ fb = FbGet8(bl,16) * idistx + FbGet8(br,16) * distx;
++ r |= (((ft * idisty + fb * disty)) & 0xff0000);
++ ft = FbGet8(tl,24) * idistx + FbGet8(tr,24) * distx;
++ fb = FbGet8(bl,24) * idistx + FbGet8(br,24) * distx;
++ r |= (((ft * idisty + fb * disty) << 8) & 0xff000000);
++ *(buffer + i) = r;
++ }
++ }
++ v.vector[0] += unit.vector[0];
++ v.vector[1] += unit.vector[1];
++ v.vector[2] += unit.vector[2];
++ }
++}
++
++static void
++fbFetchTransformed_Bilinear_Pad(bits_image_t * pict, int width, uint32_t *buffer, uint32_t *mask, uint32_t maskBits, pixman_bool_t affine, pixman_vector_t v, pixman_vector_t unit)
++{
++ pixman_box16_t *box = NULL;
++ fetchPixelProc fetch;
++ fetchFromRegionProc fetchFromRegion;
++ int i;
++
++ /* initialize the two function pointers */
Home |
Main Index |
Thread Index |
Old Index