From 2660ecfd4a0c0028f4332a8c1c6857a163e6cbfa Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 2 May 2014 11:48:55 -0700 Subject: [PATCH] Revert e9aee578a797c694655538cd0a00ad6c0bf6d5dc The vector iterator needs to be the start of the Data array even if the vector itself is NULL, or else insertion can have a negative insert position. --- Alc/vector.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Alc/vector.h b/Alc/vector.h index b4a843d5..5c094bee 100644 --- a/Alc/vector.h +++ b/Alc/vector.h @@ -32,8 +32,8 @@ ALboolean vector_resize(void *ptr, size_t base_size, size_t obj_count, size_t ob #define VECTOR_CAPACITY(_x) ((const ALsizei)((_x) ? (_x)->Capacity : 0)) #define VECTOR_SIZE(_x) ((const ALsizei)((_x) ? (_x)->Size : 0)) -#define VECTOR_ITER_BEGIN(_x) ((_x) ? (_x)->Data : NULL) -#define VECTOR_ITER_END(_x) ((_x) ? (_x)->Data + (_x)->Size : NULL) +#define VECTOR_ITER_BEGIN(_x) ((_x)->Data + 0) +#define VECTOR_ITER_END(_x) ((_x)->Data + VECTOR_SIZE(_x)) ALboolean vector_insert(void *ptr, size_t base_size, size_t obj_size, void *ins_pos, const void *datstart, const void *datend); #ifdef __GNUC__