From fc54bbfeb386051fb6431ddc5dbc1975bff0206ee53f8dfc0a0593529e11c14f Mon Sep 17 00:00:00 2001 From: Stefan Dirsch Date: Sat, 6 Nov 2010 08:50:48 +0000 Subject: [PATCH] - 0001-Fix-crash-in-swrast-when-setting-a-texture-for-a-pix.patch * Fix crash in swrast when setting a texture for a pixmap (bnc #641297) - readd swrastg DRI driver OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/Mesa?expand=0&rev=140 --- ...ast-when-setting-a-texture-for-a-pix.patch | 39 +++++++++++++++++++ Mesa.changes | 8 ++++ Mesa.spec | 3 +- 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 0001-Fix-crash-in-swrast-when-setting-a-texture-for-a-pix.patch diff --git a/0001-Fix-crash-in-swrast-when-setting-a-texture-for-a-pix.patch b/0001-Fix-crash-in-swrast-when-setting-a-texture-for-a-pix.patch new file mode 100644 index 0000000..e68c707 --- /dev/null +++ b/0001-Fix-crash-in-swrast-when-setting-a-texture-for-a-pix.patch @@ -0,0 +1,39 @@ +From 761ca4b98dfe7440402aa8e24defc2c881975f07 Mon Sep 17 00:00:00 2001 +From: Egbert Eich +Date: Fri, 5 Nov 2010 08:00:12 +0100 +Subject: [PATCH] Fix crash in swrast when setting a texture for a pixmap. + +When getImage() is called in swrastSetTexBuffer2() there will be +a crash somewhere down the line since texImage->Data isn't initialized +which holds a pointer to the destination. +To initialize texImage->Data we call ctx->Driver.TexImage2D(). +--- + Mesa-7.9/src/mesa/drivers/dri/swrast/swrast.c | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +diff --git a/Mesa-7.9/src/mesa/drivers/dri/swrast/swrast.c b/Mesa-7.9/src/mesa/drivers/dri/swrast/swrast.c +index ff53ffd..233f225 100644 +--- a/Mesa-7.9/src/mesa/drivers/dri/swrast/swrast.c ++++ b/Mesa-7.9/src/mesa/drivers/dri/swrast/swrast.c +@@ -62,6 +62,7 @@ + static void swrastSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, + GLint texture_format, __DRIdrawable *dPriv) + { ++ GET_CURRENT_CONTEXT(ctx); + struct dri_context *dri_ctx; + int x, y, w, h; + __DRIscreen *sPriv = dPriv->driScreenPriv; +@@ -92,6 +93,10 @@ static void swrastSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, + + _mesa_set_fetch_functions(texImage, 2); + ++ ctx->Driver.TexImage2D(ctx, target, 0, internalFormat, ++ w, h, 0, texture_format, GL_UNSIGNED_INT_8_8_8_8, ++ NULL, &ctx->Unpack, texObj, texImage); ++ + sPriv->swrast_loader->getImage(dPriv, x, y, w, h, (char *)texImage->Data, + dPriv->loaderPrivate); + +-- +1.7.3.1 + diff --git a/Mesa.changes b/Mesa.changes index 8ae0358..0036897 100644 --- a/Mesa.changes +++ b/Mesa.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Sat Nov 6 08:36:11 UTC 2010 - sndirsch@novell.com + +- 0001-Fix-crash-in-swrast-when-setting-a-texture-for-a-pix.patch + * Fix crash in swrast when setting a texture for a pixmap + (bnc #641297) +- readd swrastg DRI driver + ------------------------------------------------------------------- Wed Nov 3 20:45:02 UTC 2010 - sndirsch@novell.com diff --git a/Mesa.spec b/Mesa.spec index 9a1611d..d34c7f9 100644 --- a/Mesa.spec +++ b/Mesa.spec @@ -54,6 +54,7 @@ Patch1: dri_driver_dir.diff # to be upstreamed Patch8: egl-buildfix.diff Patch9: Mesa_indirect_old_xserver_compatibility.diff +Patch11: 0001-Fix-crash-in-swrast-when-setting-a-texture-for-a-pix.patch # already upstream Patch10: commit-d316391.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -148,6 +149,7 @@ sed -i 's/REPLACE/%_lib/g' src/egl/drivers/dri2/Makefile %patch8 %patch9 -p0 %patch10 -p1 +%patch11 -p2 %build @@ -218,7 +220,6 @@ install -m 644 $RPM_SOURCE_DIR/drirc $RPM_BUILD_ROOT/etc %if 0%{?suse_version} > 1020 %fdupes -s $RPM_BUILD_ROOT/%_mandir %endif -rm $RPM_BUILD_ROOT/%{_libdir}/dri/swrastg_dri.so %clean rm -rf $RPM_BUILD_ROOT