[vlc-devel] [PATCH] demux: avi: initialize bool

Rémi Denis-Courmont remi at remlab.net
Mon Jul 24 09:39:06 CEST 2017


Le 24 juillet 2017 09:49:33 GMT+03:00, Shaleen Jain <shaleen.jain95 at gmail.com> a écrit :
>Undefined behaviour
>---
> modules/demux/avi/avi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/modules/demux/avi/avi.c b/modules/demux/avi/avi.c
>index c0f47ac1a8..586e27eaa6 100644
>--- a/modules/demux/avi/avi.c
>+++ b/modules/demux/avi/avi.c
>@@ -1003,7 +1003,7 @@ static int Demux_Seekable( demux_t *p_demux )
>     for( i_track = 0; i_track < p_sys->i_track; i_track++ )
>     {
>         avi_track_t *tk = p_sys->track[i_track];
>-        bool  b;
>+        bool  b = false;
> 
>     es_out_Control( p_demux->out, ES_OUT_GET_ES_STATE, tk->p_es, &b );
>         if( tk->p_es_dv_audio )
>-- 
>2.13.3
>
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel

How is that UB? Unless the control reads the value, but the name implies that it sets it.
-- 
Rémi Denis-Courmont
Typed on an inconvenient virtual keyboard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20170724/bb5cd647/attachment.html>


More information about the vlc-devel mailing list