[vlc-commits] [Git][videolan/vlc][3.0.x] 4 commits: contrib: openjpeg: apply upstream patch

Steve Lhomme (@robUx4) gitlab at videolan.org
Sat Jul 4 15:46:01 UTC 2026



Steve Lhomme pushed to branch 3.0.x at VideoLAN / VLC


Commits:
a7094b8c by Steve Lhomme at 2026-07-04T14:20:49+00:00
contrib: openjpeg: apply upstream patch

To fix CVE-2026-6192 [^1].

[^1]: https://app.opencve.io/cve/CVE-2026-6192

(cherry picked from commit d52fe31b907fa3c1972637622ec16689eaf0c920)
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>

- - - - -
e4f3f0e0 by Steve Lhomme at 2026-07-04T14:20:49+00:00
contrib: caca: allow building in UWP

The console API's have been allowed for a while.

The patches have been sent upstream.

(cherry picked from commit c3b8dcaa5dd8a3f4016707a1c569c69885f05cf2)
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>

- - - - -
540d6cc3 by Steve Lhomme at 2026-07-04T14:20:49+00:00
contrib: caca: fix htons/htonl used without declaration

(cherry picked from commit 0a06eea97201b01a54528919e9131cdb662cebfc)
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>

- - - - -
7bd230d9 by Steve Lhomme at 2026-07-04T14:20:49+00:00
contrib: caca: apply upstream patch

To fix CVE-2026-42046 [^1].

[^1]: https://app.opencve.io/cve/CVE-2026-42046

(cherry picked from commit 5888febf7e4c3f824dc2c8f23dbacc019e861c11)
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>

- - - - -


10 changed files:

- + contrib/src/caca/0001-win32-don-t-for-_WIN32_WINNT-to-Win2K.patch
- + contrib/src/caca/0002-win32-don-t-redefine-GetCurrentConsoleFont-with-ming.patch
- + contrib/src/caca/0003-win32-use-ANSI-calls-explicitly.patch
- + contrib/src/caca/0004-win32-use-CreateFile2-when-compiling-for-Win8.patch
- + contrib/src/caca/0005-canvas-use-GetCurrentProcessId-on-Windows.patch
- + contrib/src/caca/0006-stubs-include-winsock2.h-to-get-htons-htonl-declarat.patch
- + contrib/src/caca/fb77acff9ba6bb01d53940da34fb10f20b156a23.patch
- contrib/src/caca/rules.mak
- + contrib/src/openjpeg/839936aa33eb8899bbbd80fda02796bb65068951.patch
- contrib/src/openjpeg/rules.mak


Changes:

=====================================
contrib/src/caca/0001-win32-don-t-for-_WIN32_WINNT-to-Win2K.patch
=====================================
@@ -0,0 +1,27 @@
+From 93b558f26b53f4a677bd1b5afaf60a8849292afc Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Thu, 8 Jun 2023 09:07:01 +0200
+Subject: [PATCH 1/5] win32: don't for _WIN32_WINNT to Win2K
+
+If the system allows newer API's we should downversion it.
+---
+ caca/driver/win32.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/caca/driver/win32.c b/caca/driver/win32.c
+index 439b8dc..53ff881 100644
+--- a/caca/driver/win32.c
++++ b/caca/driver/win32.c
+@@ -19,7 +19,9 @@
+ 
+ #if defined(USE_WIN32)
+ 
++#if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x500 /* _WIN32_WINNT_WIN2K */
+ #define _WIN32_WINNT 0x500 /* Require WinXP or later */
++#endif
+ #define WIN32_LEAN_AND_MEAN
+ #include <windows.h>
+ 
+-- 
+2.37.3.windows.1
+


=====================================
contrib/src/caca/0002-win32-don-t-redefine-GetCurrentConsoleFont-with-ming.patch
=====================================
@@ -0,0 +1,27 @@
+From ceed13243b729e8795a0897f432cbd8a021805bc Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Thu, 8 Jun 2023 09:08:12 +0200
+Subject: [PATCH 2/5] win32: don't redefine GetCurrentConsoleFont with
+ mingw-w64
+
+It's already defined properly.
+---
+ caca/driver/win32.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/caca/driver/win32.c b/caca/driver/win32.c
+index 53ff881..9509172 100644
+--- a/caca/driver/win32.c
++++ b/caca/driver/win32.c
+@@ -25,7 +25,7 @@
+ #define WIN32_LEAN_AND_MEAN
+ #include <windows.h>
+ 
+-#ifdef __MINGW32__
++#if defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)
+ /* This is missing from the MinGW headers. */
+ #   if (_WIN32_WINNT >= 0x0500)
+ BOOL WINAPI GetCurrentConsoleFont(HANDLE hConsoleOutput, BOOL bMaximumWindow,
+-- 
+2.37.3.windows.1
+


=====================================
contrib/src/caca/0003-win32-use-ANSI-calls-explicitly.patch
=====================================
@@ -0,0 +1,26 @@
+From 3b4670c82c650fb9aff07bdd9b98896821d6a2d0 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Thu, 8 Jun 2023 09:09:18 +0200
+Subject: [PATCH 3/5] win32: use ANSI calls explicitly
+
+If the environment forces the UNICODE define it will use the wrong call.
+---
+ caca/driver/win32.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/caca/driver/win32.c b/caca/driver/win32.c
+index 9509172..40aeeed 100644
+--- a/caca/driver/win32.c
++++ b/caca/driver/win32.c
+@@ -196,7 +196,7 @@ static int win32_end_graphics(caca_display_t *dp)
+ 
+ static int win32_set_display_title(caca_display_t *dp, char const *title)
+ {
+-    SetConsoleTitle(title);
++    SetConsoleTitleA(title);
+     return 0;
+ }
+ 
+-- 
+2.37.3.windows.1
+


=====================================
contrib/src/caca/0004-win32-use-CreateFile2-when-compiling-for-Win8.patch
=====================================
@@ -0,0 +1,49 @@
+From 43a0870bbb4cfba5d3c9472f04ea9a31dc39a527 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Thu, 8 Jun 2023 09:13:36 +0200
+Subject: [PATCH 4/5] win32: use CreateFile2 when compiling for Win8+
+
+The API is always available in Win8+ even in UWP builds, unlike CreateFileW.
+The API is pretty much the same. CONOUT is also supported [1].
+
+[1] https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfile2#consoles
+---
+ caca/driver/win32.c | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/caca/driver/win32.c b/caca/driver/win32.c
+index 40aeeed..0c84470 100644
+--- a/caca/driver/win32.c
++++ b/caca/driver/win32.c
+@@ -104,6 +104,9 @@ static int win32_init_graphics(caca_display_t *dp)
+     CONSOLE_CURSOR_INFO cci_screen;
+     SMALL_RECT rect;
+     COORD size;
++#if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
++    CREATEFILE2_EXTENDED_PARAMETERS createExParams;
++#endif
+ 
+     dp->drv.p = malloc(sizeof(struct driver_private));
+ 
+@@ -111,9 +114,18 @@ static int win32_init_graphics(caca_display_t *dp)
+     dp->drv.p->new_console = AllocConsole();
+ 
+     dp->drv.p->hin = GetStdHandle(STD_INPUT_HANDLE);
++#if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
++    ZeroMemory(&createExParams, sizeof(createExParams));
++    createExParams.dwSize = sizeof(CREATEFILE2_EXTENDED_PARAMETERS);
++    createExParams.dwFileAttributes = FILE_ATTRIBUTE_NORMAL;
++    dp->drv.p->hout = CreateFile2(L"CONOUT$", GENERIC_READ | GENERIC_WRITE,
++                                 FILE_SHARE_READ | FILE_SHARE_WRITE,
++                                 OPEN_EXISTING, &createExParams);
++#else
+     dp->drv.p->hout = CreateFile("CONOUT$", GENERIC_READ | GENERIC_WRITE,
+                                  FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
+                                  OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
++#endif
+     if(dp->drv.p->hout == INVALID_HANDLE_VALUE)
+         return -1;
+ 
+-- 
+2.37.3.windows.1
+


=====================================
contrib/src/caca/0005-canvas-use-GetCurrentProcessId-on-Windows.patch
=====================================
@@ -0,0 +1,43 @@
+From d78bdde484524c737c9285d5332cf5e7dbbf9a56 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Thu, 8 Jun 2023 09:15:53 +0200
+Subject: [PATCH 5/5] canvas: use GetCurrentProcessId() on Windows
+
+getpid() or _getpid() are not available in UWP builds [1] but we can use
+GetCurrentProcessId() instead.
+
+[1] https://learn.microsoft.com/en-us/cpp/cppcx/crt-functions-not-supported-in-universal-windows-platform-apps#unsupported-crt-functions
+---
+ caca/canvas.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/caca/canvas.c b/caca/canvas.c
+index 7beff5b..c7021d8 100644
+--- a/caca/canvas.c
++++ b/caca/canvas.c
+@@ -27,6 +27,10 @@
+ #       include <unistd.h>
+ #   endif
+ #endif
++#ifdef _WIN32
++#define WIN32_LEAN_AND_MEAN
++#include <windows.h>
++#endif
+ 
+ #include "caca.h"
+ #include "caca_internals.h"
+@@ -351,7 +355,11 @@ int caca_rand(int min, int max)
+ 
+     if(need_init)
+     {
++#ifdef _WIN32
++        srand(GetCurrentProcessId() + _caca_getticks(&timer));
++#else
+         srand(getpid() + _caca_getticks(&timer));
++#endif
+         need_init = 0;
+     }
+ 
+-- 
+2.37.3.windows.1
+


=====================================
contrib/src/caca/0006-stubs-include-winsock2.h-to-get-htons-htonl-declarat.patch
=====================================
@@ -0,0 +1,25 @@
+From 82ebd7474b72bb3743fb6e08972056c3e6843753 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Tue, 18 Jun 2024 07:04:41 +0200
+Subject: [PATCH 6/6] stubs: include winsock2.h to get htons/htonl declaration
+
+---
+ caca/caca_stubs.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/caca/caca_stubs.h b/caca/caca_stubs.h
+index bba3298..2cf0a59 100644
+--- a/caca/caca_stubs.h
++++ b/caca/caca_stubs.h
+@@ -34,6 +34,8 @@ static inline int geterrno(void) { return errno; }
+ #       include <arpa/inet.h>
+ #   elif defined HAVE_NETINET_IN_H
+ #       include <netinet/in.h>
++#   elif defined HAVE_WINSOCK2_H
++#       include <winsock2.h>
+ #   endif
+ #   define hton16 htons
+ #   define hton32 htonl
+-- 
+2.45.0.windows.1
+


=====================================
contrib/src/caca/fb77acff9ba6bb01d53940da34fb10f20b156a23.patch
=====================================
@@ -0,0 +1,37 @@
+From fb77acff9ba6bb01d53940da34fb10f20b156a23 Mon Sep 17 00:00:00 2001
+From: Pascal Terjan <pterjan at mageia.org>
+Date: Sun, 12 Apr 2026 19:06:08 +0000
+Subject: [PATCH] Prevent undefined behaviour in overflow check
+
+Fixes #86
+---
+ caca/canvas.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/caca/canvas.c b/caca/canvas.c
+index 7beff5b8..62b72b72 100644
+--- a/caca/canvas.c
++++ b/caca/canvas.c
+@@ -26,6 +26,7 @@
+ #   if defined(HAVE_UNISTD_H)
+ #       include <unistd.h>
+ #   endif
++#   include <limits.h>
+ #endif
+ 
+ #include "caca.h"
+@@ -368,12 +369,12 @@ int caca_resize(caca_canvas_t *cv, int width, int height)
+     int x, y, f, old_width, old_height, old_size;
+ 
+     /* Check for overflow */
+-    int new_size = width * height;
+-    if (new_size < 0 || (width > 0 && new_size / width != height))
++    if (width != 0 && height > INT_MAX / width)
+     {
+         seterrno(EOVERFLOW);
+         return -1;
+     }
++    int new_size = width * height;
+ 
+     old_width = cv->width;
+     old_height = cv->height;


=====================================
contrib/src/caca/rules.mak
=====================================
@@ -22,6 +22,13 @@ caca: libcaca-$(CACA_VERSION).tar.gz .sum-caca
 	$(UPDATE_AUTOCONFIG) && cd $(UNPACK_DIR) && mv config.guess config.sub .auto
 	$(APPLY) $(SRC)/caca/caca-fix-compilation-llvmgcc.patch
 	$(APPLY) $(SRC)/caca/caca-fix-pkgconfig.patch
+	$(APPLY) $(SRC)/caca/0001-win32-don-t-for-_WIN32_WINNT-to-Win2K.patch
+	$(APPLY) $(SRC)/caca/0002-win32-don-t-redefine-GetCurrentConsoleFont-with-ming.patch
+	$(APPLY) $(SRC)/caca/0003-win32-use-ANSI-calls-explicitly.patch
+	$(APPLY) $(SRC)/caca/0004-win32-use-CreateFile2-when-compiling-for-Win8.patch
+	$(APPLY) $(SRC)/caca/0005-canvas-use-GetCurrentProcessId-on-Windows.patch
+	$(APPLY) $(SRC)/caca/0006-stubs-include-winsock2.h-to-get-htons-htonl-declarat.patch
+	$(APPLY) $(SRC)/caca/fb77acff9ba6bb01d53940da34fb10f20b156a23.patch
 	$(call pkg_static,"caca/caca.pc.in")
 	$(MOVE)
 


=====================================
contrib/src/openjpeg/839936aa33eb8899bbbd80fda02796bb65068951.patch
=====================================
@@ -0,0 +1,31 @@
+From 839936aa33eb8899bbbd80fda02796bb65068951 Mon Sep 17 00:00:00 2001
+From: Even Rouault <even.rouault at spatialys.com>
+Date: Sun, 5 Apr 2026 13:25:27 +0200
+Subject: [PATCH] opj_pi_initialise_encode() (write code path): avoid potential
+ integer overflow leading to insufficient memory allocation
+
+Fixes #1619
+---
+ src/lib/openjp2/pi.c | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/src/lib/openjp2/pi.c b/src/lib/openjp2/pi.c
+index 15ac33142..4abb87af2 100644
+--- a/src/lib/openjp2/pi.c
++++ b/src/lib/openjp2/pi.c
+@@ -1694,9 +1694,12 @@ opj_pi_iterator_t *opj_pi_initialise_encode(const opj_image_t *p_image,
+     l_current_pi = l_pi;
+ 
+     /* memory allocation for include*/
+-    l_current_pi->include_size = l_tcp->numlayers * l_step_l;
+-    l_current_pi->include = (OPJ_INT16*) opj_calloc(l_current_pi->include_size,
+-                            sizeof(OPJ_INT16));
++    l_current_pi->include = NULL;
++    if (l_step_l <= UINT_MAX / l_tcp->numlayers) {
++        l_current_pi->include_size = l_tcp->numlayers * l_step_l;
++        l_current_pi->include = (OPJ_INT16*) opj_calloc(l_current_pi->include_size,
++                                sizeof(OPJ_INT16));
++    }
+     if (!l_current_pi->include) {
+         opj_free(l_tmp_data);
+         opj_free(l_tmp_ptr);


=====================================
contrib/src/openjpeg/rules.mak
=====================================
@@ -16,6 +16,7 @@ openjpeg: openjpeg-$(OPENJPEG_VERSION).tar.gz .sum-openjpeg
 	$(UNPACK)
 	$(APPLY) $(SRC)/openjpeg/5e258319332800f7a9937dc0b8b16b19a07dea8f.patch
 	$(APPLY) $(SRC)/openjpeg/7b508bb00f7fc5e7b61a6035fc4e2622d4ddff0d.patch
+	$(APPLY) $(SRC)/openjpeg/839936aa33eb8899bbbd80fda02796bb65068951.patch
 	$(call pkg_static,"./src/lib/openjp2/libopenjp2.pc.cmake.in")
 	$(MOVE)
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/fbe4f357b1bc0bdaf78336abe1b262829d214781...7bd230d919508bac08265600192af27f64a7b692

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/fbe4f357b1bc0bdaf78336abe1b262829d214781...7bd230d919508bac08265600192af27f64a7b692
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list