Commit Graph

109258 Commits

Author SHA1 Message Date
Michael Niedermayer
74b6ac7ebb
avcodec/ffv1dec: restructure slice coordinate reading a bit
Fixes: signed integer overflow: -1094995528 * 8224 cannot be represented in type 'int'
Fixes: 53508/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFV1_fuzzer-474551033462784

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-11-28 21:20:56 +01:00
Michael Niedermayer
1fdb65d2b7
avcodec/pictordec: Check that the image fits in the input
Fixes: Timeout
Fixes: 53438/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PICTOR_fuzzer-5458939919859712

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpe
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-11-28 21:20:56 +01:00
Michael Niedermayer
5185d5656b
avcodec/dts2pts_bsf: Eliminate some 64bit corner cases
Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
Fixes: 53364/clusterfuzz-testcase-minimized-ffmpeg_BSF_DTS2PTS_fuzzer-4693772269387776

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-11-28 20:58:06 +01:00
Michael Niedermayer
aa79560de5
avcodec/mlpdec: Check max matrix instead of max channel in noise check
This is a regression since: adaa06581c
Before this, max_channel and  max_matrix_channel where compared for equality

Fixes: out of array access
Fixes: 53340/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEHD_fuzzer-514959011885875

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-11-28 20:58:05 +01:00
Michael Niedermayer
7792825ad6
avutil/tx: Use unsigned in ff_tx_fft_sr_combine() to avoid undefined behavior
Fixes: signed integer overflow: -1284837070 - 982101618 cannot be represented in type 'int'
Fixes: 53105/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_FIXED_fuzzer-4848015827664896

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-11-28 20:58:05 +01:00
Lynne
90c17a05aa
x86/tx_float: fix stray change in 15xM FFT and replace imul->lea
Thanks to rorgoroth for bisecting and kurosu for the lea suggestion.
2022-11-28 16:58:12 +01:00
Niklas Haas
48c385fb4c avfilter/vf_libplacebo: support more output formats
Rather than hard-coding AV_PIX_FMT_VULKAN, expand this to the full list
of formats supported by <libplacebo/utils/libav.h>. We re-use the
existing `format` option to allow selecting specific software formats in
addition to specific vulkan hwframe formats.

Some minor changes are necessary to account for the fact that
`ff_vk_filter_config_output` is now only called optionally, the fact
that the output format must now be parsed before `query_format` gets
called, and the fact that we need to call a different function to
retrieve data from the `pl_frame` in the non-hwaccel case.

Signed-off-by: Niklas Haas <git@haasn.dev>
2022-11-28 16:05:36 +01:00
Anton Khirnov
becbb22eb0 fftools/ffmpeg: cosmetics
Reindent after previous commit and break/split some lines as
appropriate.
2022-11-28 10:28:14 +01:00
Anton Khirnov
d04ec7efe3 fftools/ffmpeg: remove a useless inner block
adjust_frame_pts_to_encoder_tb() is so small that this serves no useful
purpose.
2022-11-28 10:28:14 +01:00
Anton Khirnov
d60d6d819d fftools/ffmpeg: drop an always-false check 2022-11-28 10:28:14 +01:00
Anton Khirnov
8ee4365ad8 fftools/ffmpeg: only convert video frame pts if we have a frame
Calling adjust_frame_pts_to_encoder_tb() with a NULL frame does not
perform a meaningful action.
2022-11-28 10:28:14 +01:00
Anton Khirnov
617ea07c22 fftools/ffmpeg: call check_recording_time() with actual frame pts
Not its estimated value that will not necessarily be used.
2022-11-28 10:28:14 +01:00
Anton Khirnov
86a71d6b3c fftools/ffmpeg: stop calling adjust_frame_pts_to_encoder_tb() for audio
Almost none of that function's complexity is useful for audio, it can
be replaced by a simple av_rescale_q().
2022-11-28 10:28:14 +01:00
Anton Khirnov
a186360f27 fftools/ffmpeg: set AVFrame.time_base after filtering
Makes it easier to track what timebase are the frame timestamps in and
allows to stop accessing filters in code that shouldn't deal with
filtering.
2022-11-28 10:28:14 +01:00
Anton Khirnov
d9534ec84e fftools/ffmpeg: move logging filtered frame timestamps
Do it right after the frame is received from the filtergraph. This is a
more logical place for this and will simplify future commits.
2022-11-28 10:28:14 +01:00
Anton Khirnov
2fa2e146cc fftools/ffmpeg: avoid storing full forced keyframe spec
It is not needed after the spec is parsed. Also avoids ugly string
comparisons for each video frame.
2022-11-28 10:28:14 +01:00
Anton Khirnov
334e52e094 fftools/ffmpeg: parse forced keyframes in of_open()
Allows to remove the ugly of_get_chapters() wrapper.
2022-11-28 10:28:14 +01:00
Anton Khirnov
efe4423627 fftools/ffmpeg: store forced keyframe pts in AV_TIME_BASE_Q
Rather than the encoder timebase. Since the times are parsed as
microseconds, this will not reduce precision, except possibly when
chapter times are used and the chapter timebase happens to be better
aligned with the encoder timebase, which is unlikely.

This will allow parsing the keyframe times earlier (before encoder
timebase is known) in future commits.
2022-11-28 10:28:14 +01:00
Anton Khirnov
b1143330c8 fftools/ffmpeg: move force-keyframe-related vars to a separate struct
There are 8 of them and they are typically used together. Allows to pass
just this struct to forced_kf_apply(), which makes it clear that the
rest of the OutputStream is not accessed there.
2022-11-28 10:28:14 +01:00
Anton Khirnov
630fbdcc52 fftools/ffmpeg: stop explicitly closing decoders
It serves no purpose, they will be closed and freed in
avcodec_free_context() called from ist_free().
2022-11-28 10:28:14 +01:00
Paul B Mahol
e8e9950f2a avcodec/amrwbdec: update .p.sample_fmts to planar variant 2022-11-28 09:11:38 +01:00
Paul B Mahol
2324b917fc avfilter/avf_avectorscope: simplify code a little 2022-11-27 19:53:16 +01:00
James Almer
1009396953 avcodec/mjpegenc: take into account component count when writing the SOF header size
Fixes ticket #10069

Signed-off-by: James Almer <jamrial@gmail.com>
2022-11-26 09:54:01 -03:00
Andreas Rheinhardt
0c5af908c1 avcodec/pngdec: Mark damaged frames as finished
Fixes the deadlock reported in ticket #10071.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-11-25 22:46:33 +01:00
Paul B Mahol
e0bc798ce5 avfilter/f_ebur128: fix crash when using vflip filter 2022-11-25 19:50:17 +01:00
Paul B Mahol
4c1a79eb80 avfilter/avf_showcqt: fix crash when using vflip filter 2022-11-25 19:40:11 +01:00
Paul B Mahol
9d2b5762d3 avfilter/avf_a3dscope: fix crash when using vflip filter 2022-11-25 19:40:11 +01:00
Paul B Mahol
9c8b977c1e avfilter/avf_avectorscope: fix crash when using vflip filter 2022-11-25 19:40:11 +01:00
Paul B Mahol
f2ea508e16 avfilter/avf_showcqt: remove invalid line 2022-11-25 19:40:11 +01:00
Paul B Mahol
5d7f3b2639 avcodec/apac: stop adding samples if we run out of bits on EOF 2022-11-25 18:37:34 +01:00
Andreas Rheinhardt
1a7efafd33 avutil/tx: Use proper deallocator
May fix the FATE failures on x64 Windows here:
https://fate.ffmpeg.org/report.cgi?slot=x86_64-msvc17-windows-native&time=20221125130443

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-11-25 15:54:33 +01:00
Paul B Mahol
2ad199ae31 avformat/wavenc: w64 muxer supports only 1 stream 2022-11-25 10:23:19 +01:00
Andreas Rheinhardt
1ff9c07fa6 swscale/utils: Fix indentation
Forgotten after c1eb3e7fec.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-11-24 21:02:57 +01:00
Andreas Rheinhardt
b2d1a25816 swscale/utils: Derive range from YUVJ-pix-fmt only once
Currently, it is done once per slice-thread, leading to
one warning per slice-thread in case a YUVJ pixel format
has been originally used.

This also fixes the anomaly that said parameter are only
updated for the user-facing context (whose values are retrievable
via av_opt_get()) if slice-threading is not in use.

Fixes ticket #9860.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-11-24 20:59:03 +01:00
Andreas Rheinhardt
ff39dcb129 swscale/utils: Move functions to avoid forward declarations
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-11-24 20:58:21 +01:00
Andreas Rheinhardt
baccc1c541 swscale/utils: Avoid calling ff_thread_once() unnecessarily
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-11-24 20:58:21 +01:00
Andreas Rheinhardt
8ee0711228 swscale/utils: Don't allocate AVFrames for slice contexts
Only the parent context's AVFrames are ever used.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-11-24 20:58:21 +01:00
Andreas Rheinhardt
64ed1d40df swscale/utils: Factor initializing single slice context out
Initializing slice threads currently uses the function
(sws_init_context()) that is also used for initializing
user-facing contexts with the only difference being that
nb_threads is set to one before initializing the slice contexts.

Yet sws_init_context() also initializes lots of stuff
that is not slice-dependent, i.e. (src|dst)Range. This
currently only works because the code sets these fields
to the same values for all slice contexts. This is not
nice; even worse, it entails that log messages are printed
once per slice context (and therefore fill the screen).

This commit lays the groundwork to fix this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-11-24 20:58:21 +01:00
Lynne
e97368eba5
lavu: bump minor and add APIchanges entry for lavu/tx DCT 2022-11-24 15:58:36 +01:00
Lynne
ca8aaf24df
binkaudio: convert to lavu/tx 2022-11-24 15:58:36 +01:00
Lynne
a56d7e0ca3
lavu/tx: add DCT-III implementation 2022-11-24 15:58:36 +01:00
Lynne
504b7bec1a
lavu/tx: add DCT-II implementation 2022-11-24 15:58:35 +01:00
Lynne
93c30bd6f0
lavu/tx: clarify stride for RDFT transforms 2022-11-24 15:58:35 +01:00
Lynne
43d285a40f
lavu/tx: fix last coefficient scaling for R2C transforms
This was a typo.
2022-11-24 15:58:35 +01:00
Lynne
8547123f3b
lavu/tx: generalize PFA FFTs
This commit permits any stacking of FFTs of any size.
2022-11-24 15:58:34 +01:00
Lynne
7f019e7758
lavu/tx: add length decomposition function
Rather than using a list of lengths supported, this goes a step beyond
and uses all registered codelets to come up with a good decomposition.
2022-11-24 15:58:34 +01:00
Lynne
87bae6b018
lavu/tx: refactor to explicitly track and convert lookup table order
Necessary for generalizing PFAs.
2022-11-24 15:58:34 +01:00
Lynne
1c8d77a2bf
lavu/tx: refactor and separate codelet list and prio code 2022-11-24 15:58:33 +01:00
Lynne
958b3760b5
lavu/tx: improve transform tree logging
Now prints the actual codelet size used, as well as the number of
allowed factors.
2022-11-24 15:58:33 +01:00
Lynne
6ddd10c3e2
lavu/tx: allow codelets to specify a minimum number of matching factors 2022-11-24 15:58:33 +01:00