mirror of
https://github.com/mpv-player/mpv.git
synced 2026-10-16 22:40:53 +08:00
ta_talloc: fix assert in MP_TARRAY_REMOVE_AT
The index must be strictly less than the number of elements.
This commit is contained in:
+1
-1
@@ -142,7 +142,7 @@ char *ta_talloc_asprintf_append_buffer(char *s, const char *fmt, ...) TA_PRF(2,
|
||||
#define MP_TARRAY_REMOVE_AT(p, idxvar, at) \
|
||||
do { \
|
||||
size_t at_ = (at); \
|
||||
assert(at_ <= (idxvar)); \
|
||||
assert(at_ < (idxvar)); \
|
||||
memmove((p) + at_, (p) + at_ + 1, \
|
||||
((idxvar) - at_ - 1) * sizeof((p)[0])); \
|
||||
(idxvar)--; \
|
||||
|
||||
Reference in New Issue
Block a user