[x265] [PATCH] encoder.cpp: fix encoder crash for --analysis-reuse-level=10

praveen at multicorewareinc.com praveen at multicorewareinc.com
Wed Nov 22 12:57:30 CET 2017


# HG changeset patch
# User Praveen Tiwari <praveen at multicorewareinc.com>
# Date 1511338280 -19800
#      Wed Nov 22 13:41:20 2017 +0530
# Branch stable
# Node ID dd11aa99f40a1af59065984afa9b699d2eb1162e
# Parent  752ed1108fce1b475e0458b70f92503d6343818b
encoder.cpp: fix encoder crash for --analysis-reuse-level=10

diff -r 752ed1108fce -r dd11aa99f40a source/encoder/encoder.cpp
--- a/source/encoder/encoder.cpp	Tue Nov 21 09:50:45 2017 +0530
+++ b/source/encoder/encoder.cpp	Wed Nov 22 13:41:20 2017 +0530
@@ -1155,6 +1155,8 @@
                     pic_out->analysisData.wt = outFrame->m_analysisData.wt;
                     pic_out->analysisData.interData = outFrame->m_analysisData.interData;
                     pic_out->analysisData.intraData = outFrame->m_analysisData.intraData;
+                    pic_out->analysisData.modeFlag[0] = outFrame->m_analysisData.modeFlag[0];
+                    pic_out->analysisData.modeFlag[1] = outFrame->m_analysisData.modeFlag[1];
                     if (m_param->bDisableLookahead)
                     {
                         int factor = 1;
@@ -3067,6 +3069,7 @@
                 CHECKED_MALLOC(interData->mvpIdx[dir], uint8_t, analysis->numPartitions * analysis->numCUsInFrame);
                 CHECKED_MALLOC(interData->refIdx[dir], int8_t, analysis->numPartitions * analysis->numCUsInFrame);
                 CHECKED_MALLOC(interData->mv[dir], MV, analysis->numPartitions * analysis->numCUsInFrame);
+                CHECKED_MALLOC(analysis->modeFlag[dir], uint8_t, analysis->numPartitions * analysis->numCUsInFrame);
             }
 
             /* Allocate intra in inter */
@@ -3146,7 +3149,11 @@
                     X265_FREE(((analysis_inter_data*)analysis->interData)->mvpIdx[dir]);
                     X265_FREE(((analysis_inter_data*)analysis->interData)->refIdx[dir]);
                     X265_FREE(((analysis_inter_data*)analysis->interData)->mv[dir]);
-                    X265_FREE(analysis->modeFlag[dir]);
+                    if (analysis->modeFlag[dir] != NULL)
+                    {
+                        X265_FREE(analysis->modeFlag[dir]);
+                        analysis->modeFlag[dir] = NULL;
+                    }
                 }
             }
             else


More information about the x265-devel mailing list