d3dxof: Initialize binary member variable of xobjects.

Dylan Smith dylan.ah.smith at gmail.com
Wed Apr 20 15:21:06 CDT 2011


Testing with valgrind revealed that the binary member variable was being
used uninitialized to determine if a IDirectXFileBinary object should be
by GetNextObject. Reference and normal data objects must initialize this to
FALSE to avoid undefined behaviour.
---
 dlls/d3dxof/parsing.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/dlls/d3dxof/parsing.c b/dlls/d3dxof/parsing.c
index 34801ac..c3bfba0 100644
--- a/dlls/d3dxof/parsing.c
+++ b/dlls/d3dxof/parsing.c
@@ -1229,6 +1229,7 @@ _exit:
 
         buf->pxo->childs[buf->pxo->nb_childs] = &buf->pxo_tab[buf->pxo->root->nb_subobjects++];
         buf->pxo->childs[buf->pxo->nb_childs]->ptarget = &(buf->pxo_globals[i])[j];
+        buf->pxo->childs[buf->pxo->nb_childs]->binary = FALSE;
         buf->pxo->nb_childs++;
       }
       else if (check_TOKEN(buf) == TOKEN_NAME)
@@ -1274,6 +1275,7 @@ BOOL parse_object(parse_buffer * buf)
 
   buf->pxo->pos_data = buf->cur_pos_data;
   buf->pxo->ptarget = NULL;
+  buf->pxo->binary = FALSE;
   buf->pxo->root = buf->pxo_tab;
 
   if (get_TOKEN(buf) != TOKEN_NAME)
-- 
1.7.2.5




More information about the wine-patches mailing list