]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Fix the uninitialized variable access detected by valgrind 370/head
authorJaroslav Kysela <perex@perex.cz>
Wed, 9 Apr 2014 20:47:25 +0000 (22:47 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 9 Apr 2014 20:53:15 +0000 (22:53 +0200)
- in linuxdvb the structure member alignment causes these complaints
- in FFdecsa - probably the batch processing is the culprit

src/descrambler/ffdecsa/FFdecsa.c
src/input/mpegts/linuxdvb/linuxdvb_frontend.c

index 74eb13734d6acf0e443b81a98db579ef7c403113..a7df001747d4439a54104d498de900f9195948ac 100644 (file)
@@ -361,6 +361,7 @@ static void block_decypher_group (
   int i,g,count_all=GROUP_PARALLELISM;
 
   roff=GROUP_PARALLELISM*56;
+  memset(r + roff, 0, sizeof(r) - roff);
 
 #define FASTTRASP1
 #ifndef FASTTRASP1
index 25675bff2c64c16ba107b8addf4dc6db4a44a65e..0c99119507aff5f5a451a5a4da9cf3cf8e420836 100644 (file)
@@ -508,6 +508,7 @@ linuxdvb_frontend_monitor ( void *aux )
 
   /* Statistics - New API */
 #if DVB_VER_ATLEAST(5,10)
+  memset(&fe_properties, 0, sizeof(fe_properties));
   fe_properties[0].cmd = DTV_STAT_SIGNAL_STRENGTH;
 
   /* BER */
@@ -974,7 +975,7 @@ linuxdvb_frontend_tune0
   /* S2 tuning */
 #if DVB_API_VERSION >= 5
   struct dtv_property cmds[20];
-  struct dtv_properties cmdseq = { .num = 0, .props = cmds };
+  struct dtv_properties cmdseq;
   
   /* Clear Q */
   static struct dtv_property clear_p[] = {
@@ -990,6 +991,9 @@ linuxdvb_frontend_tune0
   if (freq == (uint32_t)-1)
     freq = p.frequency;
 
+  memset(&cmdseq, 0, sizeof(cmdseq));
+  cmdseq.props = cmds;
+  memset(&cmds, 0, sizeof(cmds));
   
   /* Tune */
 #define S2CMD(c, d)\