[x265] fix: Bus error

Satoshi Nakagawa nakagawa424 at oki.com
Wed Jun 4 07:23:45 CEST 2014


# HG changeset patch
# User Satoshi Nakagawa <nakagawa424 at oki.com>
# Date 1401859296 -32400
#      Wed Jun 04 14:21:36 2014 +0900
# Node ID f256e982b79c0c1a32810500474fa781ee814ac9
# Parent  f2479eb454b0ef50e50a7df5ab877ced2cfe5db6
fix: Bus error

diff -r f2479eb454b0 -r f256e982b79c source/Lib/TLibCommon/SEI.h
--- a/source/Lib/TLibCommon/SEI.h	Tue Jun 03 15:24:22 2014 -0500
+++ b/source/Lib/TLibCommon/SEI.h	Wed Jun 04 14:21:36 2014 +0900
@@ -185,7 +185,10 @@
 
     PayloadType payloadType() const { return PICTURE_TIMING; }
 
-    SEIPictureTiming() {}
+    SEIPictureTiming()
+        : m_numNalusInDuMinus1(0)
+        , m_duCpbRemovalDelayMinus1(0)
+    {}
 
     virtual ~SEIPictureTiming()
     {
diff -r f2479eb454b0 -r f256e982b79c source/Lib/TLibCommon/TComBitStream.cpp
--- a/source/Lib/TLibCommon/TComBitStream.cpp	Tue Jun 03 15:24:22 2014 -0500
+++ b/source/Lib/TLibCommon/TComBitStream.cpp	Wed Jun 04 14:21:36 2014 +0900
@@ -205,9 +205,9 @@
         if (temp)
         {
             ::memcpy(temp, m_fifo, m_fsize);
-            X265_FREE(m_fifo);
             m_fifo = temp;
             m_buffsize *= 2;
+            X265_FREE(m_fifo);
         }
         else
         {
diff -r f2479eb454b0 -r f256e982b79c source/Lib/TLibEncoder/NALwrite.cpp
--- a/source/Lib/TLibEncoder/NALwrite.cpp	Tue Jun 03 15:24:22 2014 -0500
+++ b/source/Lib/TLibEncoder/NALwrite.cpp	Wed Jun 04 14:21:36 2014 +0900
@@ -108,7 +108,7 @@
         }
 
         uint32_t i = packetSize;
-        out = (uint8_t*)realloc(out, nalsize + 4);
+        out = (uint8_t*)realloc(out, packetSize + nalsize + 4);
         memcpy(out + packetSize, emulation, nalsize);
         packetSize += nalsize;
 
diff -r f2479eb454b0 -r f256e982b79c source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp	Tue Jun 03 15:24:22 2014 -0500
+++ b/source/encoder/encoder.cpp	Wed Jun 04 14:21:36 2014 +0900
@@ -174,6 +174,7 @@
 
 void Encoder::init()
 {
+    m_totalFrameThreads = param->frameNumThreads;
     if (m_frameEncoder)
     {
         int numRows = (param->sourceHeight + g_maxCUSize - 1) / g_maxCUSize;
@@ -189,7 +190,6 @@
     m_rateControl->init(&m_frameEncoder[0].m_sps);
     m_lookahead->init();
     m_encodeStartTime = x265_mdate();
-    m_totalFrameThreads = param->frameNumThreads;
 }
 
 int Encoder::getStreamHeaders(NALUnitEBSP **nalunits)


More information about the x265-devel mailing list