From acdb91258a27dfc7d2e19686b4d1f1c497426d99 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 8 Mar 2010 01:54:59 -0800 Subject: [PATCH] Don't access invalid memory The ThreadInfo handle is deleted by the time the user thread function returns --- src/streamplay.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/streamplay.cpp b/src/streamplay.cpp index 8602571..1044804 100644 --- a/src/streamplay.cpp +++ b/src/streamplay.cpp @@ -76,15 +76,14 @@ static ALuint StopThread(ThreadInfo *inf) typedef struct { ALuint (*func)(ALvoid*); ALvoid *ptr; - ALuint ret; pthread_t thread; } ThreadInfo; static void *StarterFunc(void *ptr) { ThreadInfo *inf = (ThreadInfo*)ptr; - inf->ret = inf->func(inf->ptr); - return NULL; + void *ret = (void*)(inf->func(inf->ptr)); + return ret; } static ThreadInfo *StartThread(ALuint (*func)(ALvoid*), ALvoid *ptr) -- 2.11.4.GIT