[x265] [PATCH] check before delete

wenju at multicorewareinc.com wenju at multicorewareinc.com
Wed Sep 11 23:11:06 CEST 2013


# HG changeset patch
# User Wenju He
# Date 1378930206 18000
#      Wed Sep 11 15:10:06 2013 -0500
# Node ID fb41c642fd5604572ff64ef521a07ea06ef09f37
# Parent  ea0aa1f8abda53da2473d3d4c444690d2099c01a
check before delete

diff -r ea0aa1f8abda -r fb41c642fd56 source/Lib/TLibEncoder/TEncCu.cpp
--- a/source/Lib/TLibEncoder/TEncCu.cpp	Wed Sep 11 14:50:24 2013 -0500
+++ b/source/Lib/TLibEncoder/TEncCu.cpp	Wed Sep 11 15:10:06 2013 -0500
@@ -277,9 +277,12 @@
         }
         for (int j = 0; j < MAX_PRED_TYPES; j++)
         {
-            m_modePredYuv[j][i]->destroy();
-            delete m_modePredYuv[j][i];
-            m_modePredYuv[j][i] = NULL;
+            if (m_modePredYuv[j][i])
+            {
+                m_modePredYuv[j][i]->destroy();
+                delete m_modePredYuv[j][i];
+                m_modePredYuv[j][i] = NULL;
+            }
         }
 
         if (m_tmpResiYuv[i])


More information about the x265-devel mailing list