ffmpeg/libswscale
Niklas Haas 4ede75b5f4 swscale/graph: fix double-free when legacy pass fails initializing
If this function returns an error after ff_sws_graph_add_pass() has been
called, and the pass->free callback is therefore already set up to free the
context, the graph will end up freed twice: once by the pass->free callback
(during ff_sws_graph_free()), and once before that by failure path of the
caller (e.g. add_legacy_sws_pass(), or init_legacy_subpass() itself for
cascaded contexts.)

The solution is to redefine the ownership of SwsGraph to pass clearly from
the caller of add_legacy_sws_pass() to init_legacy_subpass(), which can then
deal with appropriately freeing the context conditional on whether or not the
pass was already registered in the pass list.

Reported-by: 김영민 <kunshim@naver.com>
Signed-off-by: Niklas Haas <git@haasn.dev>
2025-08-29 13:22:03 +00:00
..
aarch64 swscale/output: Implement yuv2nv12cx neon assembly 2025-08-12 09:05:00 +00:00
arm all: fix typos found by codespell 2025-08-03 13:48:47 +02:00
loongarch swscale: add support for new 10/12 bit MSB formats 2025-07-11 17:49:58 +02:00
ppc all: fix typos found by codespell 2025-08-03 13:48:47 +02:00
riscv swscale/range_convert: saturate output instead of limiting input 2024-12-05 21:10:29 +01:00
tests swscale: add support for new 10/12 bit MSB formats 2025-07-11 17:49:58 +02:00
x86 all: fix typos found by codespell 2025-08-03 13:48:47 +02:00
alphablend.c swscale/alphablend: don't overread alpha plane on subsampled odd size 2025-07-31 11:32:20 +00:00
bayer_template.c swscale/internal: constify SwsFunc 2024-10-07 19:51:34 +02:00
cms.c all: fix typos found by codespell 2025-08-03 13:48:47 +02:00
cms.h swscale/utils: split off format code into new file 2025-03-14 19:50:44 +01:00
csputils.c swscale/csputils: Remove unused ff_sws_matrix3x3_rmul() 2025-04-03 06:04:57 +02:00
csputils.h swscale/csputils: Remove unused ff_sws_matrix3x3_rmul() 2025-04-03 06:04:57 +02:00
format.c all: fix typos found by codespell 2025-08-03 13:48:47 +02:00
format.h swscale/graph: prefer bools to ints 2025-05-18 15:00:45 +02:00
gamma.c swscale: rename SwsContext to SwsInternal 2024-10-24 22:50:00 +02:00
graph.c swscale/graph: fix double-free when legacy pass fails initializing 2025-08-29 13:22:03 +00:00
graph.h swscale/graph: prefer bools to ints 2025-05-18 15:00:45 +02:00
half2float.c swscale/input: add rgbaf16 input support 2022-08-19 22:09:36 +02:00
hscale.c swscale/range_convert: fix mpeg ranges in yuv range conversion for non-8-bit pixel formats 2024-12-05 21:10:29 +01:00
hscale_fast_bilinear.c swscale: rename SwsContext to SwsInternal 2024-10-24 22:50:00 +02:00
input.c swscale/input: don't generate unused functions 2025-08-11 19:29:53 +00:00
libswscale.v build: Change structure of the linker version script templates 2016-05-29 16:43:11 +02:00
log2_tab.c lsws: duplicate ff_log2_tab 2014-08-12 20:52:21 +02:00
lut3d.c swscale/lut3d: remove unused function 2025-07-22 19:56:34 +02:00
lut3d.h swscale/utils: split off format code into new file 2025-03-14 19:50:44 +01:00
Makefile avutil: only duplicate hal2float and float2half in shared builds 2025-03-18 17:21:23 -03:00
options.c swscale/options: add -sws_dither none alias 2024-12-23 12:47:10 +01:00
output.c swscale/output: Fix all bilinear integer overflows 2025-08-02 16:26:33 +00:00
rgb2rgb.c swscale/swscale_unscaled: add unscaled x2rgb10le to packed RGB 2024-11-06 17:34:32 -03:00
rgb2rgb.h swscale/swscale_unscaled: add unscaled x2rgb10le to packed RGB 2024-11-06 17:34:32 -03:00
rgb2rgb_template.c swscale/swscale_unscaled: add unscaled conversion for AYUV/VUYA/UYVA 2024-11-02 15:01:31 -03:00
slice.c swscale/slice: fix init of 32 bpc planes 2024-12-16 12:21:55 +01:00
swscale.c swscale/swscale: Do not crash on floats 2025-04-10 03:01:32 +02:00
swscale.h all: fix typos found by codespell 2025-08-03 13:48:47 +02:00
swscale_internal.h swscale/swscale_internal: Use more precisse gamma 2025-08-18 19:12:46 +00:00
swscale_unscaled.c swscale/swscale_unscaled: use 8 line alignment for planarCopyWrapper with dithering 2025-08-12 21:56:09 +00:00
swscaleres.rc Add Windows resource file support for shared libraries 2013-12-05 23:42:07 +01:00
utils.c swscale: add support for new 10/12 bit MSB formats 2025-07-11 17:49:58 +02:00
version.c lib*/version: Use static_assert for static asserts 2024-03-31 00:08:42 +01:00
version.h Bump versions for master after release/8.0 2025-08-09 18:03:05 +02:00
version_major.h libs: bump major version for all libraries 2025-03-28 14:44:34 -03:00
vscale.c swscale/internal: group user-facing options together 2024-11-21 12:49:56 +01:00
yuv2rgb.c swscale/internal: group user-facing options together 2024-11-21 12:49:56 +01:00