aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-04-21 23:10:09 -0700
committerChris Robinson <[email protected]>2014-04-21 23:10:09 -0700
commite9aee578a797c694655538cd0a00ad6c0bf6d5dc (patch)
tree619258dcfce3b50510bf54bb59636f03a913355d
parent0d2521e30e7b5d80bfea2cd56373333af657f723 (diff)
Avoid dereferencing a NULL pointer
-rw-r--r--Alc/vector.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Alc/vector.h b/Alc/vector.h
index f7db6517..242c5fa5 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)->Data + 0)
-#define VECTOR_ITER_END(_x) ((_x)->Data + VECTOR_SIZE((_x)))
+#define VECTOR_ITER_BEGIN(_x) ((_x) ? (_x)->Data : NULL)
+#define VECTOR_ITER_END(_x) ((_x) ? (_x)->Data + (_x)->Size : NULL)
ALboolean vector_insert(void *ptr, size_t base_size, size_t obj_size, void *ins_pos, const void *datstart, const void *datend);
#ifdef __GNUC__