In Encoder::fetchStats, the size check for the stats buffer was incorrectly using sizeof(stats) on the x265_stats pointer. This evaluates to the size of a pointer, not the size of the structure it points to.
This commit changes the check to sizeof(*stats) to correctly compare against the size of the x265_stats structure. Signed-off-by: yuygfgg <[email protected]> --- source/encoder/encoder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/encoder/encoder.cpp b/source/encoder/encoder.cpp index cf2e95988..be898cbbf 100644 --- a/source/encoder/encoder.cpp +++ b/source/encoder/encoder.cpp @@ -2963,7 +2963,7 @@ void Encoder::printSummary() void Encoder::fetchStats(x265_stats *stats, size_t statsSizeBytes, int layer) { - if (statsSizeBytes >= sizeof(stats)) + if (statsSizeBytes >= sizeof(*stats)) { stats->globalPsnrY = m_analyzeAll[layer].m_psnrSumY; stats->globalPsnrU = m_analyzeAll[layer].m_psnrSumU; -- 2.49.0 _______________________________________________ x265-devel mailing list [email protected] https://mailman.videolan.org/listinfo/x265-devel
