vlc_arrays: make "pos" expansion-safe
commit65366bd416413b4a7d0b0a825703e266ffea9c65
authorRomain Vimont <rom1v@videolabs.io>
Tue, 28 Aug 2018 08:52:21 +0000 (28 10:52 +0200)
committerJean-Baptiste Kempf <jb@videolan.org>
Wed, 29 Aug 2018 10:07:19 +0000 (29 12:07 +0200)
treea0a228ea76c520530dfb1c205d66c7a187bee5eb
parent03930828165ef1e49993beb03307c9c8e3a5889c
vlc_arrays: make "pos" expansion-safe

In a call to ARRAY_INSERT(array, elem, index + 1), "-pos" was expanded
to "-index + 1" instead of "-(index + 1)", leading to surprising results
and crashes.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
include/vlc_arrays.h