[vlc-devel] [PATCH] demux: avi: initialize bool
Shaleen Jain
shaleen.jain95 at gmail.com
Mon Jul 24 09:45:24 CEST 2017
Regards,
Shaleen Jain
On Mon, Jul 24, 2017 at 1:09 PM, Rémi Denis-Courmont <remi at remlab.net>
wrote:
> 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 )
>
> How is that UB? Unless the control reads the value, but the name
> implies that it sets it.
>
It is UB in cases where the control doesn't get a valid value which is
read further down.
> --
> 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/d4f3d423/attachment.html>
More information about the vlc-devel
mailing list