https://bugs.gentoo.org/964704
https://github.com/mean00/avidemux2/commit/c16d32a67cdb012db093472ad3776713939a30d1.patch

From c16d32a67cdb012db093472ad3776713939a30d1 Mon Sep 17 00:00:00 2001
From: eumagga0x2a <eumagga0x2a@users.noreply.github.com>
Date: Sat, 4 Jan 2025 23:34:14 +0100
Subject: [PATCH] [x265] Fix build with x265 4.1

---
 .../ADM_videoEncoder/x265/ADM_x265Setup.cpp   | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/avidemux_plugins/ADM_videoEncoder/x265/ADM_x265Setup.cpp b/avidemux_plugins/ADM_videoEncoder/x265/ADM_x265Setup.cpp
index 55816a713..0bc330b6e 100644
--- a/avidemux_plugins/ADM_videoEncoder/x265/ADM_x265Setup.cpp
+++ b/avidemux_plugins/ADM_videoEncoder/x265/ADM_x265Setup.cpp
@@ -216,13 +216,30 @@ bool x265Encoder::setup(void)
                         {
                              param.rc.bStatWrite=1;
                              param.rc.bStatRead=0;
+#if X265_BUILD > 213
+                             if (strlen(logFile) >= X265_MAX_STRING_SIZE)
+                             {
+                                 ADM_error("Logfile filename length %d out of bounds, must be less than %d\n", strlen(logFile), X265_MAX_STRING_SIZE);
+                                 return false;
+                             }
+                             snprintf(param.rc.statFileName, X265_MAX_STRING_SIZE, "%s", logFile);
+#else
                              param.rc.statFileName=strdup(logFile);
- 
+#endif
                         }else
                         {
                              param.rc.bStatWrite=0;
                              param.rc.bStatRead=1;
+#if X265_BUILD > 213
+                             if (strlen(logFile) >= X265_MAX_STRING_SIZE)
+                             {
+                                 ADM_error("Logfile filename length %d out of bounds, must be less than %d\n", strlen(logFile), X265_MAX_STRING_SIZE);
+                                 return false;
+                             }
+                             snprintf(param.rc.statFileName, X265_MAX_STRING_SIZE, "%s", logFile);
+#else
                              param.rc.statFileName=strdup(logFile);
+#endif
                              if(!ADM_fileExist(logFile))
                              {
                                    ADM_error("Logfile %s does not exist \n",logFile);
