Commit 1e796221 for libheif

commit 1e796221435f8f06ba84bcde1da6d86ef627d6f5
Author: Lovell Fuller <github@lovell.info>
Date:   Fri May 1 13:01:09 2026 +0100

    decoder_libde265: guard against version length in plugin name

diff --git a/libheif/plugins/decoder_libde265.cc b/libheif/plugins/decoder_libde265.cc
index 3dd57326..9c0820d6 100644
--- a/libheif/plugins/decoder_libde265.cc
+++ b/libheif/plugins/decoder_libde265.cc
@@ -45,7 +45,7 @@ static const int LIBDE265_PLUGIN_PRIORITY = 100;
 #define MAX_PLUGIN_NAME_LENGTH 80

 static char plugin_name[MAX_PLUGIN_NAME_LENGTH];
-
+static std::string version_prefix = ", version ";

 static const char* libde265_plugin_name()
 {
@@ -53,8 +53,8 @@ static const char* libde265_plugin_name()

   const char* libde265_version = de265_get_version();

-  if (strlen(libde265_version) + 10 < MAX_PLUGIN_NAME_LENGTH) {
-    strcat(plugin_name, ", version ");
+  if (strlen(plugin_name) + strlen(libde265_version) + version_prefix.length() + 1 < MAX_PLUGIN_NAME_LENGTH) {
+    strcat(plugin_name, version_prefix.c_str());
     strcat(plugin_name, libde265_version);
   }