Index: /trunk/HTM.xcodeproj/project.pbxproj
===================================================================
--- /trunk/HTM.xcodeproj/project.pbxproj	(revision 104)
+++ /trunk/HTM.xcodeproj/project.pbxproj	(revision 105)
@@ -1503,4 +1503,5 @@
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/source/Lib/";
+				MACOSX_DEPLOYMENT_TARGET = 10.7;
 				ONLY_ACTIVE_ARCH = YES;
 				SDKROOT = macosx;
@@ -1518,4 +1519,5 @@
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/source/Lib/";
+				MACOSX_DEPLOYMENT_TARGET = 10.7;
 				SDKROOT = macosx;
 			};
Index: /trunk/source/App/TAppDecoder/TAppDecTop.cpp
===================================================================
--- /trunk/source/App/TAppDecoder/TAppDecTop.cpp	(revision 104)
+++ /trunk/source/App/TAppDecoder/TAppDecTop.cpp	(revision 105)
@@ -435,37 +435,46 @@
   if( isDepth )
     m_useDepth = true;
-  while( m_tVideoIOYuvReconFile.size() < newNumberOfViewDepth)
-  {
-    m_tVideoIOYuvReconFile.push_back(new TVideoIOYuv);
-    Char buffer[4];
-#if VIDYO_VPS_INTEGRATION
-    sprintf(buffer,"_%i", viewId );
-#else
-    sprintf(buffer,"_%i", (Int)(m_tVideoIOYuvReconFile.size()-1) / 2 );
-#endif
-    Char* nextFilename = NULL;
-#if VIDYO_VPS_INTEGRATION
-    if( isDepth)
-#else
-    if( (m_tVideoIOYuvReconFile.size() % 2) == 0 )
-#endif
-    {
-      Char* pchTempFilename = NULL;
-      xAppendToFileNameEnd( m_pchReconFile, "_depth", pchTempFilename);
-      xAppendToFileNameEnd( pchTempFilename, buffer, nextFilename);
-      free ( pchTempFilename );
-    }
-    else
-    {
-      xAppendToFileNameEnd( m_pchReconFile, buffer, nextFilename);
-    }
+
+#if FIX_DECODING_WO_WRITING
+  if ( m_pchReconFile )
+  { 
+#endif
+    while( m_tVideoIOYuvReconFile.size() < newNumberOfViewDepth)
+    {
+      m_tVideoIOYuvReconFile.push_back(new TVideoIOYuv);
+      Char buffer[4];
+#if VIDYO_VPS_INTEGRATION
+      sprintf(buffer,"_%i", viewId );
+#else
+      sprintf(buffer,"_%i", (Int)(m_tVideoIOYuvReconFile.size()-1) / 2 );
+#endif
+      Char* nextFilename = NULL;
+#if VIDYO_VPS_INTEGRATION
+      if( isDepth)
+#else
+      if( (m_tVideoIOYuvReconFile.size() % 2) == 0 )
+#endif
+      {
+        Char* pchTempFilename = NULL;
+        xAppendToFileNameEnd( m_pchReconFile, "_depth", pchTempFilename);
+        xAppendToFileNameEnd( pchTempFilename, buffer, nextFilename);
+        free ( pchTempFilename );
+      }
+      else
+      {
+        xAppendToFileNameEnd( m_pchReconFile, buffer, nextFilename);
+      }
 #if !VIDYO_VPS_INTEGRATION
-    if( isDepth || ( !isDepth && (m_tVideoIOYuvReconFile.size() % 2) == 1 ) )
-#endif
-    {
-      m_tVideoIOYuvReconFile.back()->open( nextFilename, true, m_outputBitDepth, g_uiBitDepth + g_uiBitIncrement );
-    }
+      if( isDepth || ( !isDepth && (m_tVideoIOYuvReconFile.size() % 2) == 1 ) )
+#endif
+      {
+        m_tVideoIOYuvReconFile.back()->open( nextFilename, true, m_outputBitDepth, g_uiBitDepth + g_uiBitIncrement );
+      }
       free ( nextFilename );
-  }
+    }
+#if FIX_DECODING_WO_WRITING
+  }
+#endif
+
   while( m_pocLastDisplay.size() < newNumberOfViewDepth )
   {
Index: /trunk/source/Lib/TLibCommon/CommonDef.h
===================================================================
--- /trunk/source/Lib/TLibCommon/CommonDef.h	(revision 104)
+++ /trunk/source/Lib/TLibCommon/CommonDef.h	(revision 105)
@@ -58,5 +58,5 @@
 
 #define HM_VERSION        "6.1"
-#define NV_VERSION        "4.0rc1"                 ///< Current software version
+#define NV_VERSION        "4.0"                  ///< Current software version
 
 // ====================================================================================================================
Index: /trunk/source/Lib/TLibCommon/TypeDef.h
===================================================================
--- /trunk/source/Lib/TLibCommon/TypeDef.h	(revision 104)
+++ /trunk/source/Lib/TLibCommon/TypeDef.h	(revision 105)
@@ -44,4 +44,7 @@
 #define FIXES                             1
 #define POZNAN_CABAC_INIT_FLAG_FIX        1
+#define FIX_DECODING_WO_WRITING           1
+#define FIX_INIT_ROM                      1
+#define FIX_VIRT_DESTRUCTOR               1
 
 
Index: /trunk/source/Lib/TLibEncoder/TEncTop.cpp
===================================================================
--- /trunk/source/Lib/TLibEncoder/TEncTop.cpp	(revision 104)
+++ /trunk/source/Lib/TLibEncoder/TEncTop.cpp	(revision 105)
@@ -91,6 +91,14 @@
 {
   // initialize global variables
-  initROM();
-  
+#if FIX_INIT_ROM
+  if( m_viewId == 0 && m_isDepth == false )
+  {
+#endif
+    initROM();
+#if FIX_INIT_ROM
+  }
+#endif
+
+
   // create processing unit classes
   m_cGOPEncoder.        create( getSourceWidth(), getSourceHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight );
Index: /trunk/source/Lib/TLibRenderer/TRenSingleModel.h
===================================================================
--- /trunk/source/Lib/TLibRenderer/TRenSingleModel.h	(revision 104)
+++ /trunk/source/Lib/TLibRenderer/TRenSingleModel.h	(revision 105)
@@ -68,4 +68,8 @@
 {
 public: 
+
+#if FIX_VIRT_DESTRUCTOR
+  virtual ~TRenSingleModel() { }  
+#endif
 #if LGE_VSO_EARLY_SKIP_A0093
   virtual Void   create    ( Int iMode, Int iWidth, Int iHeight, Int iShiftPrec, Int*** aaaiSubPelShiftTable, Int iHoleMargin, Bool bUseOrgRef, Int iBlendMode, Bool bEarlySkip ) = 0;
