Description: 
  This patch addresses issues arising from conflicts with ISO C23 (trying to modify const qualified types), MagickWand headers and package name, and outdated avcodec API usage.
 .
 lebiniou (3.67.0-2) unstable; urgency=medium
 .
   * Conform to ISO C23 by not attempting to modify const char *.
   * Switch from libmagickwand-dev to libmagickwand-7.q16-dev.
   * Change libmagickwand headers.
   * Use modern avcodec API.
Author: Alexander Toth <alexandertoth96@gmail.com>

---
The information above should follow the Patch Tagging Guidelines, please
checkout https://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: (upstream|backport|vendor|other), (<patch-url>|commit:<commit-id>)
Bug: <upstream-bugtracker-url>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: (no|not-needed|<patch-forwarded-url>)
Applied-Upstream: <version>, (<commit-url>|commit:<commid-id>)
Reviewed-By: <name and email of someone who approved/reviewed the patch>
Last-Update: 2026-02-25

--- lebiniou-3.67.0.orig/plugins/main/video/video.c
+++ lebiniou-3.67.0/plugins/main/video/video.c
@@ -260,9 +260,6 @@ create(Context_t *ctx)
   if (NULL == packet) {
     xerror("%s: %s av_packet_alloc failed\n", __FILE__, __func__);
   }
-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 133, 100)
-  av_init_packet(packet);
-#endif
   // create frame
   frame = av_frame_alloc();
   if (NULL == frame) {
@@ -429,9 +426,6 @@ thread_loop(void *arg)
     if (NULL == packet) {
       xerror("%s: %s av_packet_alloc failed\n", __FILE__, __func__);
     }
-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 133, 100)
-    av_init_packet(packet);
-#endif
   }
 
   if (NULL == frame) {
--- lebiniou-3.67.0.orig/src/bulfius_preview.c
+++ lebiniou-3.67.0/src/bulfius_preview.c
@@ -17,11 +17,7 @@
  *  along with lebiniou. If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef MAGICKWAND7
 #include <MagickWand/MagickWand.h>
-#else
-#include <wand/magick_wand.h>
-#endif
 #include "bulfius.h"
 #include "context.h"
 
--- lebiniou-3.67.0.orig/src/bulfius_vui_callback.c
+++ lebiniou-3.67.0/src/bulfius_vui_callback.c
@@ -70,10 +70,8 @@ get_filename_ext(const char *path)
   if ((NULL == dot) || (dot == path)) {
     return "*";
   }
-  if (NULL != strchr(dot, '?')) {
-    *strchr(dot, '?') = '\0';
-  }
 
+  // return without modification
   return dot;
 }
 
@@ -144,7 +142,23 @@ callback_vui_get_static(const struct _u_
       length = ftell(f);
       fseek(f, 0, SEEK_SET);
 
-      content_type = content_type_from_ext(get_filename_ext(file_path));
+      // handle ?query here instead of in get_filename_ext
+      {
+        const char *ext = get_filename_ext(file_path);
+        const char *q = strchr(ext, '?');
+
+        if (q) {
+          char extbuf[64];
+          size_t n = (size_t)(q - ext);
+          if (n >= sizeof(extbuf)) n = sizeof(extbuf) - 1;
+          memcpy(extbuf, ext, n);
+          extbuf[n] = '\0';
+          content_type = content_type_from_ext(extbuf);
+        } else {
+          content_type = content_type_from_ext(ext);
+        }
+      }
+
       ulfius_add_header_to_response(response, "Content-Type", content_type);
       ulfius_add_header_to_response(response, "Cache-Control", "no-cache,no-store,must-revalidate");
       ulfius_add_header_to_response(response, "Pragma", "no-cache");
--- lebiniou-3.67.0.orig/src/screenshot.c
+++ lebiniou-3.67.0/src/screenshot.c
@@ -17,11 +17,7 @@
  *  along with lebiniou. If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifdef MAGICKWAND7
 #include <MagickWand/MagickWand.h>
-#else
-#include <wand/magick_wand.h>
-#endif
 #include "context.h"
 
 #define DIRECTORY      "/screenshots/"
