[x265] fix: Bus error

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


Please discard previous patch, sorry.


# HG changeset patch
# User Satoshi Nakagawa <nakagawa424 at oki.com>
# Date 1401859829 -32400
#      Wed Jun 04 14:30:29 2014 +0900
# Node ID 3ae987980ba4e72b57a57e957cb2a6b455c9b737
# Parent  f2479eb454b0ef50e50a7df5ab877ced2cfe5db6
fix: Bus error

diff -r f2479eb454b0 -r 3ae987980ba4 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:30:29 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 3ae987980ba4 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:30:29 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 3ae987980ba4 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:30:29 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