[x265] [PATCH] fix(encoder): correct size check in fetchStats
leo zhang
leoyuygfgg at gmail.com
Sat Jul 26 01:22:36 UTC 2025
Hi all,
Just a friendly ping on this patch. Is there any feedback or anything I can do to help get it reviewed?
Thanks
> 2025年6月11日 09:55,yuygfgg <leoyuygfgg at gmail.com> 写道:
>
> 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 <leoyuygfgg at gmail.com>
> ---
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20250725/4576a34f/attachment.htm>
More information about the x265-devel
mailing list