[vlc-devel] [PATCH 4/8] video_output: use the vout_display_cfg_t in use by the display when possible

Rémi Denis-Courmont remi at remlab.net
Mon May 13 15:03:13 CEST 2019


display->cfg belongs to another thread. This looks like UB to me.

Le 13 mai 2019 14:54:49 GMT+03:00, Steve Lhomme <robux4 at ycbcr.xyz> a écrit :
>During initialization SizeWindow returns the size based on the initial
>sizes
>forced by the user (or the visible source dimensions). But once the
>display is
>created the width/height of the display is known/updated in the local
>config.
>
>Same thing for the zoom which is used in vout_display_SizeWindow().
>---
> src/video_output/video_output.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/src/video_output/video_output.c
>b/src/video_output/video_output.c
>index 6e8c8608eb..8605ac2e0b 100644
>--- a/src/video_output/video_output.c
>+++ b/src/video_output/video_output.c
>@@ -196,7 +196,7 @@ static void vout_SizeWindow(vout_thread_t *vout,
>unsigned *restrict width,
>/* If the vout thread is running, the window lock must be held here. */
>     vout_display_SizeWindow(width, height, w, h, sar_num, sar_den,
>                             sys->original.orientation,
>-                            &sys->display_cfg);
>+                            sys->display != NULL ? sys->display->cfg :
>&sys->display_cfg);
> }
> 
> static void vout_UpdateWindowSize(vout_thread_t *vout)
>-- 
>2.17.1
>
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel

-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20190513/68e82f10/attachment.html>


More information about the vlc-devel mailing list