mesa: Fix another crash

This commit is contained in:
Alexpux
2013-12-16 09:47:15 +04:00
parent dfc9138b8f
commit cbf6acb3b4
2 changed files with 33 additions and 3 deletions

View File

@@ -4,7 +4,7 @@ _realname=mesa
_mingw_suff=mingw-w64-${CARCH}
pkgname="${_mingw_suff}-${_realname}"
pkgver=10.0.1
pkgrel=1
pkgrel=2
pkgdesc="Open-source implementation of the OpenGL specification (mingw-w64)"
arch=('any')
depends=("")
@@ -14,9 +14,11 @@ url="http://www.mesa3d.org"
license=('MIT')
options=('staticlibs' 'strip')
source=(ftp://ftp.freedesktop.org/pub/mesa/10.0.1/MesaLib-${pkgver}.tar.bz2
fix-crash.patch)
fix-crash.patch
llvmpipe-freeing.patch)
md5sums=('0a72ca5b36046a658bf6038326ff32ed'
'2803a57b4368ef3b8bfd25efa1544176')
'2803a57b4368ef3b8bfd25efa1544176'
'b8da20a1bfb9045bdb82d3f6f2a13beb')
noextract=("MesaLib-${pkgver}.tar.bz2")
case ${MINGW_CHOST} in
@@ -33,6 +35,7 @@ prepare() {
[ -d $srcdir/$_realname-$pkgver ] || tar -xjvf MesaLib-${pkgver}.tar.bz2 -C $srcdir
cd ${srcdir}/Mesa-$pkgver
patch -p1 -i ${srcdir}/fix-crash.patch
patch -p1 -i ${srcdir}/llvmpipe-freeing.patch
}
build() {

View File

@@ -0,0 +1,27 @@
This fixes another case of faulting when freeing a pipe_sampler_view
that belongs to a previously destroyed context.
Signed-off-by: Jonathan Liu <net147 at gmail.com>
---
src/gallium/drivers/llvmpipe/lp_state_sampler.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/gallium/drivers/llvmpipe/lp_state_sampler.c b/src/gallium/drivers/llvmpipe/lp_state_sampler.c
index 1d3db0f..ff498f7 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_sampler.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_sampler.c
@@ -136,6 +136,12 @@ llvmpipe_set_sampler_views(struct pipe_context *pipe,
/* set the new sampler views */
for (i = 0; i < num; i++) {
+ /* Note: we're using pipe_sampler_view_release() here to work around
+ * a possible crash when the old view belongs to another context that
+ * was already destroyed.
+ */
+ pipe_sampler_view_release(pipe,
+ &llvmpipe->sampler_views[shader][start + i]);
pipe_sampler_view_reference(&llvmpipe->sampler_views[shader][start + i],
views[i]);
}
--
1.8.5.1