[x265] [PATCH] fix crash with error cmd options

Min Chen chenm003 at 163.com
Fri Nov 13 19:25:09 CET 2015


# HG changeset patch
# User Min Chen <chenm003 at 163.com>
# Date 1447439101 21600
# Node ID 88afde8efc818cb3d33889a4ed080a95537ce9ea
# Parent  ff01e7f269eaa1803b8bf3c92e1b2e953091e97f
fix crash with error cmd options
---
 source/encoder/bitcost.cpp |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff -r ff01e7f269ea -r 88afde8efc81 source/encoder/bitcost.cpp
--- a/source/encoder/bitcost.cpp	Wed Nov 11 17:53:11 2015 -0600
+++ b/source/encoder/bitcost.cpp	Fri Nov 13 12:25:01 2015 -0600
@@ -93,10 +93,13 @@
         {
             X265_FREE(s_costs[i] - 2 * BC_MAX_MV);
 
-            s_costs[i] = 0;
+            s_costs[i] = NULL;
         }
     }
 
-    X265_FREE(s_bitsizes - 2 * BC_MAX_MV);
-    s_bitsizes = 0;
+    if (s_bitsizes)
+    {
+        X265_FREE(s_bitsizes - 2 * BC_MAX_MV);
+        s_bitsizes = NULL;
+    }
 }



More information about the x265-devel mailing list