Denis Oliver Kropp <dok@...> writes:

> 
> Hi,
> 
> I thought I'd share this with you as DirectFB since 1.2 did not accelerate
> with preallocated surfaces anymore, but the support is even better than ever 
now.

Hi Dok,

could you please ACK the below fix?


>From 51a421e0d6b00967ac52c5bc011dab1829cc1a31 Mon Sep 17 00:00:00 2001
From: Holger Hans Peter Freyther <hol...@moiji-mobile.com>
Date: Fri, 18 Nov 2011 20:55:50 +0100
Subject: [PATCH] core: dfb_core_memory_permissions_add assign to
 ret_permission ptr

If the ret ptr is not assigned releasing a surface will result in a crash
for any kind of surface because memory_permissions_count will be > 0 and
dfb_core_memory_permissions_remove does not check if permission is NULL.

Program received signal SIGSEGV, Segmentation fault.
dfb_core_memory_permissions_remove (core=0x805f710, permission=0x0) at 
core.c:1174
1174         D_DEBUG_AT( DirectFB_Core, "%s( flags 0x%02x, data %p, length
%zu )\n", __FUNCTION__,
(gdb) p permission
$1 = (CoreMemoryPermission *) 0x0
(gdb) bt
---
 src/core/core.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/core/core.c b/src/core/core.c
index baf192a..b9e290a 100644
--- a/src/core/core.c
+++ b/src/core/core.c
@@ -1164,6 +1164,8 @@ dfb_core_memory_permissions_add
 
      direct_mutex_unlock( &core->memory_permissions_lock );
 
+     *ret_permission = permission;
+
      return DFB_OK;
 }
 
-- 
1.7.7.3



_______________________________________________
directfb-dev mailing list
directfb-dev@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to