Anton Khirnov
54754eec1e
lavfi: add a new struct for private link properties
...
Specifically those that should be visible to filters, but hidden from
API callers. Such properties are currently located at the end of the
public AVFilterLink struct, demarcated by a comment marking them as
private. However it is generally better to hide them explicitly, using
the same pattern already employed in avformat or avcodec.
The new struct is currently trivial, but will become more useful in
following commits.
2024-08-15 19:27:01 +02:00
Anton Khirnov
426e33c758
lavfi: set AVFilterLink.graph on link creation
...
There is no reason to delay this.
2024-08-15 19:27:01 +02:00
James Almer
41307ff3e9
avfilter/video: don't zero allocated buffers if memory poisoning is used
...
Same as in avcodec/get_buffer.c
Should help in debugging use of uninitialized memory.
Signed-off-by: James Almer <jamrial@gmail.com>
2024-08-12 11:41:38 -03:00
Michael Niedermayer
b98125e5a5
avfilter/vf_xfade: Compute w2, h2 with float
...
Fixes: CID1458148 Result is not floating-point
Fixes: CID1458149 Result is not floating-point
Fixes: CID1458150 Result is not floating-point
Fixes: CID1458151 Result is not floating-point
Fixes: CID1458152 Result is not floating-point
Fixes: CID1458154 Result is not floating-point
Fixes: CID1458155 Result is not floating-point
Fixes: CID1458156 Result is not floating-point
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-11 13:21:14 +02:00
Michael Niedermayer
f802d65de0
avfilter/vf_v360: Assert that vf was initialized
...
Maybe helps: CID1504571 Uninitialized scalar variable
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-11 13:21:13 +02:00
Michael Niedermayer
9229587c2d
avfilter/vf_unsharp_opencl: Use AV_VIDEO_MAX_PLANES
...
Related: CID1423281 Out-of-bounds read
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-11 13:21:13 +02:00
Michael Niedermayer
e5c0f56ca0
avfilter/vf_tonemap_opencl: Dereference after NULL check
...
Fixes: CID1437472 Dereference before null check
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-11 13:21:13 +02:00
Michael Niedermayer
22ee55a1da
avfilter/af_surround: Check output format
...
Fixes: CID1516994 Out-of-bounds access
Fixes: CID1516996 Out-of-bounds access
Fixes: CID1516999 Out-of-bounds access
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-11 13:21:12 +02:00
Michael Niedermayer
43b62b7e0c
avfilter/vf_xfade_opencl: Check ff_inlink_consume_frame() for failure
...
Fixes: CID1458127 Unchecked return value
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-08-11 13:21:12 +02:00
Lynne
12080ff040
nlmeans_vulkan: fix uninitialized reads
2024-08-11 05:13:17 +02:00
Lynne
12f868cab5
vulkan_shaderc: add debug information to shaders
2024-08-11 05:13:13 +02:00
Lynne
2f7dfb0d15
vulkan_shaderc: fix error reporting for certain errors
...
The issue is that shaderc_result_get_num_errors may sometime
return 0 even when shaderc_result_get_compilation_status returns
a non-zero error code.
Since we use the result from the former, override the status
if it returned 0.
2024-08-11 05:13:12 +02:00
Rémi Denis-Courmont
f30e5bf1f5
lavfi/riscv: depend on RVB and simplify accordingly
2024-08-05 21:16:26 +03:00
Anton Khirnov
43f702a253
lavfi/framesync: avoid forcing frame writability unnecessarily
...
Callers of ff_framesync_get_frame() generally do not expect the result
to be writable, those that do (e.g. ff_framesync_dualinput_get_writable())
ensure writability themselves.
Significantly reduces memory consumption in complex graphs with
framesync-based filters (e.g. scale, ssim).
Reported-By: Mark Shwartzman
2024-07-31 11:12:45 +02:00
Rémi Denis-Courmont
b5c111272b
lavfi/riscv: add forward-edge CFI landing pads
2024-07-25 23:10:14 +03:00
Rémi Denis-Courmont
9108f3e5e1
lavfi/riscv: require B or zba explicitly
2024-07-25 18:55:48 +03:00
Michael Niedermayer
73ca4e75eb
avfilter/vf_xfade: Check ff_inlink_consume_frame() for failure
...
Fixes: CID1458043 Unchecked return value
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 17:02:14 +02:00
Michael Niedermayer
2a8fb3c2cc
avfilter/vf_scale: Check ff_scale_adjust_dimensions() for failure
...
Helps: CID1513722 Operands don't affect result
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:34:31 +02:00
Michael Niedermayer
ad9df8bcfe
avfilter/scale_eval: Use 64bit, check values in ff_scale_adjust_dimensions()
...
Found by reviewing CID1513722 Operands don't affect result
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:34:30 +02:00
Michael Niedermayer
6db4e326c2
avfilter/vf_neighbor_opencl: Use AV_PIX_MAX_PLANES
...
Fix/Robustness/whatever: CID1439575 Out-of-bounds read
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:34:29 +02:00
Michael Niedermayer
ace2e25720
avfilter/vf_lut3d: Check av_scanf()
...
Fixes: CID1604398 Unchecked return value
Fixes: CID1604542 Unchecked return value
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:34:28 +02:00
Michael Niedermayer
64aa233a88
avfilter/vf_fftfilt: Remove dead depth code
...
Fixes: CID1509373 Logically dead code
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:34:27 +02:00
Michael Niedermayer
2af95b9214
avfilter/vf_elbg: Use unsigned for shifting into the top bit
...
Fixes: part of CID1355110 Overflowed constant
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 16:34:25 +02:00
Michael Niedermayer
05e21b8902
avfilter/vf_premultiply: Use AV_PIX_MAX_PLANES
...
Helps: CID1435164 Out-of-bounds read
Helps: CID1435165 Out-of-bounds read
Helps: CID1435167 Out-of-bounds read
Helps: CID1435169 Out-of-bounds read
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 15:57:43 +02:00
Michael Niedermayer
9385847af4
avfilter/vf_deshake_opencl: Ensure that the first iteration initializes the best variables
...
Fixes: CID1452759 Uninitialized scalar variable
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 15:52:09 +02:00
Michael Niedermayer
c37dc63c7d
avfilter/vf_deshake_opencl: Use AV_VIDEO_MAX_PLANES
...
Fixes: CID1452758 Out-of-bounds read (actual out of bounds access depends on a frame with more than 3 planes)
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-21 15:52:08 +02:00
Michael Niedermayer
a7f5845a6c
avfilter: Free out on error
...
CID1197065 Resource leak
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-15 01:59:41 +02:00
Michael Niedermayer
19a5a8997c
avfilter/vf_convolution_opencl: Assert that the filter name is one of the filters
...
Helps with: CID1439572 Uninitialized pointer read
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-15 01:59:40 +02:00
Michael Niedermayer
ec18ec9fc1
avfilter/vf_bm3d: Dont round MSE2SSE to an integer
...
Fixes: CID1439581 Result is not floating-point
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-15 01:59:39 +02:00
Michael Niedermayer
ffba528bc6
avfilter/vf_avgblur_opencl: Use AV_VIDEO_MAX_PLANES
...
Fixes: CID1437470 Out-of-bounds read (out of bounds read would only occur with a pixel format of more than 4 planes)
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-15 01:59:39 +02:00
Marvin Scholz
613c85a8f5
avfilter/af_channelsplit: fix mixed declaration and code
...
Fix a "mixing declarations and code is incompatible with standards
before C99" warning.
2024-07-14 15:43:01 -04:00
Michael Niedermayer
20e59af07e
avfilter/vf_tiltandshift: Free dst on error
...
Fixes: CID1559901 Resource leak
Sponsored-by: Sovereign Tech Fund
Reviewed-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-12 21:58:50 +02:00
James Almer
0b6c5e9df4
avfilter/vf_crop: prevent integer overflows when calculating SAR
...
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-11 10:22:47 -03:00
Marvin Scholz
6d9c4bd69e
lavfi/perlin: Fix out of bounds stack buffer write
...
An incorrect calculation in ff_perlin_init causes a write to the
stack array at index 256, which is out of bounds.
Fixes: CID1608711
Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-10 18:10:08 +02:00
Niklas Haas
0deb301ba9
avfilter/vf_scale: test return code of scale_frame()
...
Instead of testing the returned frame against NULL, test the return code
itself, going more in line with the usual behavior of such functions.
2024-07-10 11:38:44 +02:00
Niklas Haas
084e0b364d
avfilter/vf_scale: fix frame lifetimes
...
scale_frame() inconsistently handled the lifetime of `in`. Fixes a
possible double free and a possible memory leak.
The new code always has `scale_frame` take over ownership of the input
frame. I first tried writing this code in a way where the calling code
retains ownership, but this is nontrivial due to the presence of the
no-op short-circuit condition in which the input frame is directly
returned. (As an alternative, we could use av_frame_clone() instead, but
I wanted to avoid touching the original behavior in this commit)
2024-07-10 11:38:44 +02:00
Michael Niedermayer
382e9e79f3
avfilter/af_aderivative: Free out on error
...
Fixes: CID1197065 Resource leak
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:30 +02:00
Michael Niedermayer
62d4414d54
avfilter/af_amerge: Cleanup on av_channel_layout_copy() failure
...
Fixes: CID1503088 Resource leak
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:29 +02:00
Michael Niedermayer
a5c815f937
avfilter/af_afir: Assert format
...
Maybe helps: CID1516805 Uninitialized scalar variable
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:29 +02:00
Michael Niedermayer
8f9a6c4ea8
avfilter/af_afftdn: Assert format
...
Maybe helps: CID1515514 Uninitialized scalar variable
Maybe helps: CID1515517 Uninitialized scalar variable
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:29 +02:00
Michael Niedermayer
5fe8bf4aa5
avfilter/af_pan: check nb_output_channels before use
...
Fixes: CID1500281 Out-of-bounds write
Fixes: CID1500331 Out-of-bounds write
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:28 +02:00
Michael Niedermayer
2d0d502ff1
avfilter/af_mcompand: compute half frequency in double
...
Fixes: CID1422217 Result is not floating-point
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:28 +02:00
Michael Niedermayer
cef720ab42
avfilter/af_channelsplit: Assert that av_channel_layout_channel_from_index() succeeds
...
Maybe Helps: CID1503077 Bad bit shift operation
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:28 +02:00
Michael Niedermayer
7a0ea15c7a
avfilter/af_aresample: Cleanup on av_channel_layout_copy() failure
...
Fixes: CID1503078 Resource leak
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-07 23:36:27 +02:00
James Almer
a528a54ee1
avfilter/vf_tiltandshift: fix buffer offset for yuv422p input
...
Fixes ticket #10950 .
Signed-off-by: James Almer <jamrial@gmail.com>
2024-07-06 10:50:55 -03:00
Jun Zhao
03c2e9d77e
lavf/scdet: minor fix
...
Change dbl to i64 for bool type
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2024-07-05 18:06:14 +08:00
Michael Niedermayer
c296d4fdec
avfilter/vf_avgblur: Check plane instead of AVFrame
...
Fixes: CID1551694 Use after free (false positive based on assuming that out == in and one is freed and one used)
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:25 +02:00
Michael Niedermayer
34f821e448
avfilter/drawutils: Fix depthb computation
...
Fixes: CID1496940 Logically dead code
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:24 +02:00
Michael Niedermayer
aab0c344c5
avfilter/avf_showcwt: Check av_parse_video_rate() for failure
...
Fixes: CID1539147 Unused value
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-07-02 21:57:24 +02:00
Andrew Sayers
5d54a25eea
avfilter/af_afade: fix opt_type for nb_samples/ns
...
The actual value is an int64_t, and is accessed elsewhere as AV_OPT_TYPE_INT64.
2024-07-01 23:16:44 +02:00