]> git.xonotic.org Git - xonotic/netradiant.git/commitdiff
Fix a horrible bug in q3map2
authorMattia Basaglia <mattia.basaglia@gmail.com>
Tue, 21 Jul 2015 14:26:18 +0000 (16:26 +0200)
committerMattia Basaglia <mattia.basaglia@gmail.com>
Tue, 21 Jul 2015 14:26:18 +0000 (16:26 +0200)
This function passed a int* instead of a void** causing local variables to be overwritten,
which in turn caused the program to crash.

tools/quake3/common/threads.c

index 4d44bf36c8743ac9dd5a58f6c661f80a15dcee88..04946dd2f72edfc87566a954fee655d57becd854 100644 (file)
@@ -538,7 +538,7 @@ void RunThreadsOn( int workcnt, qboolean showpacifier, void ( *func )( int ) ){
        size_t stacksize;
 
        int start, end;
-       int i = 0, status = 0;
+       int i = 0;
 
        start     = I_FloatTime();
        pacifier  = showpacifier;
@@ -582,7 +582,7 @@ void RunThreadsOn( int workcnt, qboolean showpacifier, void ( *func )( int ) ){
                }
                for ( i = 0 ; i < numthreads ; i++ )
                {
-                       if ( pthread_join( work_threads[i], (void **)&status ) != 0 ) {
+                       if ( pthread_join( work_threads[i], NULL ) != 0 ) {
                                Error( "pthread_join failed" );
                        }
                }