[vlc-commits] flac: init flac_header_info.i_pts before usage

Alexandre Janniaux git at videolan.org
Wed Mar 25 21:49:07 CET 2020


vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Wed Mar 25 17:15:31 2020 +0100| [49dd123315978a4705934c0fff159331ed91bf92] | committer: Tristan Matthews

flac: init flac_header_info.i_pts before usage

Depending on FLAC_ParseSyncInfo results, the field might get
non-initialized but still assigned. Remove -Wmaybe-uninitialized warning
on Windows.

Signed-off-by: Tristan Matthews <tmatth at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=49dd123315978a4705934c0fff159331ed91bf92
---

 modules/demux/flac.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/modules/demux/flac.c b/modules/demux/flac.c
index 92ad0178f9..8b1c118047 100644
--- a/modules/demux/flac.c
+++ b/modules/demux/flac.c
@@ -226,7 +226,7 @@ static block_t *GetPacketizedBlock( decoder_t *p_packetizer,
     {
         if( p_block->i_buffer >= FLAC_HEADER_SIZE_MAX )
         {
-            struct flac_header_info headerinfo;
+            struct flac_header_info headerinfo = { .i_pts = VLC_TICK_INVALID };
             int i_ret = FLAC_ParseSyncInfo( p_block->p_buffer, streaminfo, NULL, &headerinfo );
             assert( i_ret != 0 ); /* Same as packetizer */
             /* Use Frame PTS, not the interpolated one */
@@ -832,4 +832,3 @@ static void ParsePicture( demux_t *p_demux, const uint8_t *p_data, size_t i_data
 
     TAB_APPEND( p_sys->i_attachments, p_sys->attachments, p_attachment );
 }
-



More information about the vlc-commits mailing list