[vlc-commits] player: fix crash when sending OSD messages to multiple vouts
Pierre Lamot
git at videolan.org
Wed Mar 20 15:52:28 CET 2019
vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Wed Mar 20 14:58:42 2019 +0100| [0caa73ce69570b0632e626cef69324ff030e6e5b] | committer: Thomas Guillem
player: fix crash when sending OSD messages to multiple vouts
va_args was reused without being copied
Signed-off-by: Thomas Guillem <thomas at gllm.fr>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0caa73ce69570b0632e626cef69324ff030e6e5b
---
src/input/player.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/input/player.c b/src/input/player.c
index 355c9e5408..22284418e4 100644
--- a/src/input/player.c
+++ b/src/input/player.c
@@ -278,7 +278,12 @@ vouts_osd_Message(vout_thread_t **vouts, size_t count, const char *fmt, ...)
va_list args;
va_start(args, fmt);
for (size_t i = 0; i < count; ++i)
- vout_OSDMessageVa(vouts[i], VOUT_SPU_CHANNEL_OSD, fmt, args);
+ {
+ va_list acpy;
+ va_copy(acpy, args);
+ vout_OSDMessageVa(vouts[i], VOUT_SPU_CHANNEL_OSD, fmt, acpy);
+ va_end(acpy);
+ }
va_end(args);
}
@@ -307,7 +312,12 @@ vlc_player_vout_OSDMessage(vlc_player_t *player, const char *fmt, ...)
va_list args;
va_start(args, fmt);
for (size_t i = 0; i < count; ++i)
- vout_OSDMessageVa(vouts[i], VOUT_SPU_CHANNEL_OSD, fmt, args);
+ {
+ va_list acpy;
+ va_copy(acpy, args);
+ vout_OSDMessageVa(vouts[i], VOUT_SPU_CHANNEL_OSD, fmt, acpy);
+ va_end(acpy);
+ }
va_end(args);
vlc_player_vout_OSDReleaseAll(player, vouts, count);
More information about the vlc-commits
mailing list