[dvblast-devel] demux: Initialize local variable.

Georgi Chorbadzhiyski git at videolan.org
Fri Feb 3 21:52:20 CET 2012


dvblast | branch: master | Georgi Chorbadzhiyski <gf at unixsol.org> | Fri Feb  3 22:47:45 2012 +0200| [9d461a5542117d8ec914b2572b3d1a6a2a9636e0] | committer: Georgi Chorbadzhiyski

demux: Initialize local variable.

gcc 4.6 reports:
  demux.c: In function HandleSection:
  demux.c:2267:61: warning: f may be used uninitialized in this function [-Wuninitialized]
  demux.c:2261:26: note: f was declared here

The gcc is correct that f is used initialized which is real bug in
this case.

Signed-off-by: Georgi Chorbadzhiyski <gf at unixsol.org>

> http://git.videolan.org/gitweb.cgi/dvblast.git/?a=commit;h=9d461a5542117d8ec914b2572b3d1a6a2a9636e0
---

 demux.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/demux.c b/demux.c
index ba90687..b4dbaac 100644
--- a/demux.c
+++ b/demux.c
@@ -2258,7 +2258,7 @@ static void HandlePMT( uint16_t i_pid, uint8_t *p_pmt, mtime_t i_dts )
             if ( b_enable_ecm )
             {
                 k = 0;
-                uint16_t f;
+                uint16_t f = 0;
                 uint8_t *p_pmt_es;
                 while ((p_desc = descs_get_desc( pmtn_get_descs( p_es ), k++ )) != NULL)
                 {



More information about the dvblast-devel mailing list