[vlc-devel] [PATCH] player: fix crash when sending OSD messages to multiple vouts

Steve Lhomme robux4 at ycbcr.xyz
Wed Mar 20 15:01:20 CET 2019


LGTM

On 3/20/2019 2:58 PM, Pierre Lamot wrote:
>    va_args was reused without being copied
> ---
>   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);
> -- 
> 2.19.1
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel



More information about the vlc-devel mailing list