]> git.sesse.net Git - vlc/blobdiff - include/aout_internal.h
Propagate changes from previous commit
[vlc] / include / aout_internal.h
index d05d5934ae154d2dd40c3358560d515662bba454..a7f7c4b285bf795116f8441d48288c1ac2d9c368 100644 (file)
@@ -34,6 +34,10 @@ typedef struct aout_alloc_t
 #define AOUT_ALLOC_STACK    1
 #define AOUT_ALLOC_HEAP     2
 
+#if defined( __APPLE__ ) || defined( SYS_BSD )
+#undef HAVE_ALLOCA
+#endif
+
 #ifdef HAVE_ALLOCA
 #   define ALLOCA_TEST( p_alloc, p_new_buffer )                             \
         if ( (p_alloc)->i_alloc_type == AOUT_ALLOC_STACK )                  \
@@ -81,11 +85,11 @@ typedef struct aout_alloc_t
     }
 
 #define aout_BufferFree( p_buffer )                                         \
-    if ( (p_buffer)->i_alloc_type == AOUT_ALLOC_HEAP )                      \
+    if( p_buffer != NULL && (p_buffer)->i_alloc_type == AOUT_ALLOC_HEAP )   \
     {                                                                       \
-        if( p_buffer ) free( p_buffer );                                    \
-        p_buffer = NULL;                                                    \
-    }
+        free( p_buffer );                                                   \
+    }                                                                       \
+    p_buffer = NULL;
 
 /*****************************************************************************
  * aout_fifo_t : audio output buffer FIFO