From 1627f9407a014fcdc94b89f92107866275a0c5bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vasseur?= Date: Wed, 9 Sep 2026 16:18:19 +0200 Subject: [PATCH 1/3] upipe_x265: fix build against x265 4.x --- .github/workflows/test-suite.yaml | 2 +- lib/upipe-x265/upipe_x265.c | 36 ++++++++++++++++--------------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/.github/workflows/test-suite.yaml b/.github/workflows/test-suite.yaml index 0822755ad..51a3e1ee2 100644 --- a/.github/workflows/test-suite.yaml +++ b/.github/workflows/test-suite.yaml @@ -143,7 +143,7 @@ jobs: BREW_PREFIX="$(brew --prefix)" set-env HOST_CC "clang" set-env HOST_CXX "clang++" - set-env CFLAGS "-Wno-error=deprecated-declarations -Wno-error=unknown-pragmas -fsanitize=undefined -fsanitize=address -fsanitize-address-use-after-scope -fsanitize-recover=all -fno-omit-frame-pointer -fno-optimize-sibling-calls -I$BREW_PREFIX/include" + set-env CFLAGS "-Wno-error=deprecated-declarations -fsanitize=undefined -fsanitize=address -fsanitize-address-use-after-scope -fsanitize-recover=all -fno-omit-frame-pointer -fno-optimize-sibling-calls -I$BREW_PREFIX/include" set-env LDFLAGS "-fsanitize=undefined -fsanitize=address -L$BREW_PREFIX/lib" set-env DISABLE_VALGRIND "1" set-env ld_preload_san "$(clang --print-file-name libclang_rt.asan_osx_dynamic.dylib)" diff --git a/lib/upipe-x265/upipe_x265.c b/lib/upipe-x265/upipe_x265.c index 697fff268..6e0a65024 100644 --- a/lib/upipe-x265/upipe_x265.c +++ b/lib/upipe-x265/upipe_x265.c @@ -48,23 +48,25 @@ #include /* fix undef warnings in x265.h */ -#ifndef ENABLE_LIBVMAF -# define ENABLE_LIBVMAF 0 -#endif -#ifndef _MSC_VER -# define _MSC_VER 0 -#endif -#ifndef X265_DEPTH -# define X265_DEPTH 0 -#endif -#ifndef ENABLE_MULTIVIEW -# define ENABLE_MULTIVIEW 0 -#endif -#ifndef ENABLE_ALPHA -# define ENABLE_ALPHA 0 -#endif -#ifndef ENABLE_SCC_EXT -# define ENABLE_SCC_EXT 0 +#if X265_BUILD < 217 +# ifndef ENABLE_LIBVMAF +# define ENABLE_LIBVMAF 0 +# endif +# ifndef _MSC_VER +# define _MSC_VER 0 +# endif +# ifndef X265_DEPTH +# define X265_DEPTH 0 +# endif +# ifndef ENABLE_MULTIVIEW +# define ENABLE_MULTIVIEW 0 +# endif +# ifndef ENABLE_ALPHA +# define ENABLE_ALPHA 0 +# endif +# ifndef ENABLE_SCC_EXT +# define ENABLE_SCC_EXT 0 +# endif #endif #include From 9287e6d6de6baa917c80740d2f91c98bdbc83d03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vasseur?= Date: Wed, 9 Sep 2026 16:22:25 +0200 Subject: [PATCH 2/3] upipe_x265: fix uref leak on error path --- lib/upipe-x265/upipe_x265.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/upipe-x265/upipe_x265.c b/lib/upipe-x265/upipe_x265.c index 6e0a65024..093b2bfe0 100644 --- a/lib/upipe-x265/upipe_x265.c +++ b/lib/upipe-x265/upipe_x265.c @@ -670,6 +670,7 @@ static bool upipe_x265_open(struct upipe *upipe, int width, int height) const char *def = OUT_FLOW; if (unlikely(!ubase_check(uref_flow_set_def(flow_def_attr, def)))) { upipe_throw_fatal(upipe, UBASE_ERR_ALLOC); + uref_free(flow_def_attr); return false; } UBASE_FATAL(upipe, uref_flow_set_complete(flow_def_attr)) From e37982ae5431546b15a3c5b49ff69b24d51471e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vasseur?= Date: Wed, 9 Sep 2026 16:36:23 +0200 Subject: [PATCH 3/3] upipe_x265: fix check for incompatible flow def --- lib/upipe-x265/upipe_x265.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/upipe-x265/upipe_x265.c b/lib/upipe-x265/upipe_x265.c index 093b2bfe0..30738ca7c 100644 --- a/lib/upipe-x265/upipe_x265.c +++ b/lib/upipe-x265/upipe_x265.c @@ -1356,9 +1356,9 @@ static int upipe_x265_set_flow_def(struct upipe *upipe, struct urational fps; uint64_t hsize, vsize; - if (!ubase_check(uref_pic_flow_get_fps(flow_def, &fps) || + if (!ubase_check(uref_pic_flow_get_fps(flow_def, &fps)) || !ubase_check(uref_pic_flow_get_hsize(flow_def, &hsize)) || - !ubase_check(uref_pic_flow_get_vsize(flow_def, &vsize)))) { + !ubase_check(uref_pic_flow_get_vsize(flow_def, &vsize))) { upipe_err(upipe, "incompatible flow def"); uref_free(flow_def_check); return UBASE_ERR_INVALID;