Commit Graph

110529 Commits

Author SHA1 Message Date
Anton Khirnov 71d7e9bbec fftools/ffmpeg_filter: move InputFilter.displaymatrix to private data
It is not used outside of ffmpeg_filter.
2023-05-08 10:38:59 +02:00
Anton Khirnov e8df737cb2 fftools/ffmpeg_filter: move InputFilter.eof to private data
It is not used outside of ffmpeg_filter.
2023-05-08 10:38:59 +02:00
Anton Khirnov c7c73a3250 fftools/ffmpeg_filter: take fallback parameters from decoder, not demuxer
When an input stream terminates and no frames were successfully decoded,
filtering code will currently configure the filtergraph using demuxer
stream parameters. Use decoder parameters instead, which should be more
reliable. Also, initialize them immediately when an input stream is
bound to a filtergraph input, so that these parameters are always
available (if at all) and filtering code does not need to reach into the
decoder at some arbitrary later point.
2023-05-08 10:38:59 +02:00
Anton Khirnov 48d8d3549a fftools/ffmpeg_enc: stop configuring filter inputs from encoder flush
When no frames are ever seen by an encoder, encoder flush will do a
last-ditch attempt to configure its source filtergraph in order to at
least get the stream parameters. This involves extracting demuxer
parameters from filtergraph source inputs, which is
* a bad layering violation
* probably unreachable, because decoders are flushed before encoders,
  which should call ifilter_send_eof(), which will also set these
  parameters; however due to complex control flow it is hard to be
  entirely sure this code can never be triggered

Even if this code can actually be reached, it is probably better to
return an error as the comment above it says.
2023-05-08 10:38:59 +02:00
Anton Khirnov f5cfb2c5df fftools/ffmpeg: eliminate need_output()
Replace it by simply calling choose_output() earlier.
2023-05-08 10:38:58 +02:00
Anton Khirnov 5673da4797 fftools/ffmpeg: merge choose_output() and got_eagain()
These two functions are a part of a single logical action - determining
which, if any, output stream needs to be processed next. Keeping them
separate is a historical artifact that obscures what is actually being
done.
2023-05-08 10:38:58 +02:00
Jonathan Gilbert f009f84961 doc/filters/colorcorrect: fix bh option description 2023-05-07 23:23:48 +02:00
metamuffin 2dd9b4071c avdevice/lavfi: update documentation
lavfi not only supports video but also audio by now.
2023-05-07 17:29:00 +02:00
Paul B Mahol 1c8bf697ee avfilter/f_ebur128: export results into read-only options 2023-05-07 17:28:25 +02:00
Paul B Mahol 7153642992 avfilter/af_replaygain: export results into read-only options 2023-05-07 17:25:57 +02:00
Paul B Mahol 782ea8b2e5 avfilter/af_asetnsamples: add timeline support 2023-05-07 17:25:07 +02:00
Paul B Mahol 03800bcaf3 avfilter/af_asetnsamples: add commands support 2023-05-07 17:25:02 +02:00
Anton Khirnov 0e00d23510 fftools/ffmpeg: reduce -re to -readrate 1
They are exactly equivalent, so there is no point in maintaining a
separate flag for -re.
2023-05-07 15:49:27 +02:00
Anton Khirnov 007ec49db8 fftools/ffmpeg: use a non-zero default for -readrate_initial_burst
Use it to replace a hack added in 6f20685228.
2023-05-07 15:49:21 +02:00
Davy Durham 2ae16b05d6 fftools/ffmpeg: add ability to set a input burst time before readrate is enforced
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2023-05-07 15:48:15 +02:00
Anton Khirnov 6deaf1e409 lavf/demux: export codec-level framerate in avformat_find_stream_info() 2023-05-07 15:47:25 +02:00
Anton Khirnov c2ae8e30b7 lavc/codec_par: add AVCodecParameters.framerate
This corresponds to AVCodecContext.framerate.
2023-05-07 15:47:25 +02:00
Paul B Mahol 55ea1da1c0 avfilter/adynamicequalizer_template: remove empty lines 2023-05-06 17:50:05 +02:00
Paul B Mahol 0c91327210 avfilter/vsrc_gradients: fix several issues with !rgba output 2023-05-06 17:49:43 +02:00
Michael Niedermayer 722ff74055
avcodec/adpcm: Fix integer overflow in intermediate in ADPCM_XMD
Fixes: runtime error: signed integer overflow: 2140143616 + 254665816 cannot be represented in type 'int'
Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_XMD_fuzzer-6690181676924928

As a sideeffect this simplifies the equation, the high bits are different after this but only
the low 16bits are stored and used in later steps.

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-05-06 00:32:29 +02:00
Michael Niedermayer 8f0e200a12
avcodec/dpcm: fix undefined interger overflow in wady
Fixes: signed integer overflow: -2147375930 + -133875 cannot be represented in type 'int'
Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WADY_DPCM_fuzzer-6703727013920768

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-05-06 00:22:27 +02:00
Michael Niedermayer 6e98cf0280
avcodec/tiff: add a zero DNG_LINEARIZATION_TABLE check
Fixes: index 4294967295 out of bounds for type 'uint16_t [65536]'
Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5950405086674944
Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-6666195176914944

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-05-06 00:22:26 +02:00
Michael Niedermayer 19b66b89da
avcodec/tak: Check remaining bits in ff_tak_decode_frame_header()
Fixes: out of array access
Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TAK_fuzzer-6682195323650048

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-05-06 00:22:26 +02:00
Michael Niedermayer 2632e90493
avcodec/sonic: Fix two undefined integer overflows
Fixes: signed integer overflow: 2147483372 - -148624 cannot be represented in type 'int'
Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SONIC_fuzzer-5477177805373440
Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SONIC_fuzzer-6681622236233728

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-05-06 00:22:26 +02:00
Michael Niedermayer 34056a94ea
avcodec/utils: the IFF_ILBM implementation assumes that there are a multiple of 16 allocated
Fixes: out of array access
Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5124452659888128
Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-6362836707442688

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-05-06 00:22:25 +02:00
Michael Niedermayer fd7352660b
avcodec/flacdec: Fix signed integre overflow
Fixes: signed integer overflow: 3011809745540902265 + 6323452730883571725 cannot be represented in type 'long'
Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FLAC_fuzzer-6687553022722048

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-05-06 00:22:25 +02:00
Michael Niedermayer 885ff3b879
avcodec/exr: Cleanup befor return
Fixes: leaks
Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-6703454090559488

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-05-06 00:22:25 +02:00
Michael Niedermayer d31d4f3228
avcodec/pngdec: Do not pass AVFrame into global header decode
The global header should not contain a frame, and decoding it
would result in leaks

Fixes: memleak
Fixes: 45982/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APNG_fuzzer-6603443149340672

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-05-06 00:22:24 +02:00
Michael Niedermayer 7117b380a7
avcodec/pngdec: remove AVFrame argument from decode_iccp_chunk()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-05-06 00:22:24 +02:00
Michael Niedermayer 6b1f68ccb0
avformat/hls: fail on probing non hls/m3u8 file extensions
Its unexpected that a .avi or other "standard" file turns into a playlist.
The goal of this patch is to avoid this unexpected behavior and possible
privacy or security differences.

Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-05-06 00:22:24 +02:00
Michael Niedermayer 5cc378cc46
avcodec/pdvdec: Check previous frame before using it
Fixes: load of null pointer of type 'uint8_t' (aka 'unsigned char')
Fixes: 58256/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PDV_fuzzer-4776436325285888

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-05-06 00:22:23 +02:00
James Almer ed3691338b doc/examples/transcode_aac: use av_samples_alloc_array_and_samples to allocate the input samples buffer and pointers
Fixes -Wuse-after-free warnings and simplifies code.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-05 15:28:28 -03:00
James Almer 09b2ca93b4 avcodec/libdav1d: support parsing multiple ITU-T T.35 entries in a picture
This requires the newest libdav1d release.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-05 14:26:52 -03:00
Paul B Mahol 24f16b798e avfilter/af_join: set output frame duration 2023-05-05 17:20:14 +02:00
Paul B Mahol 67ca64c24b avfilter/af_adelay: fix frame pts and set frame duration 2023-05-05 17:20:14 +02:00
Paul B Mahol 217bb59f2e avfilter/af_amerge: set output frame duration 2023-05-05 17:20:13 +02:00
Paul B Mahol 6f1c82fd5b avfilter/af_biquads: reduce double type usage 2023-05-05 17:20:13 +02:00
Rémi Denis-Courmont 2919027936 MAINTAINERS: add vanitous self to maintain RISC-V
Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-05 11:54:34 -03:00
Anton Khirnov 60ecf44b03 lavf/av1dec: stop setting codec context framerate
Demuxers are not supposed to do this.
2023-05-05 14:49:40 +02:00
Anton Khirnov e43be84c0f lavf/av1dec: mark as notimestamps 2023-05-05 14:49:40 +02:00
Anton Khirnov 2850584876 lavf/rawdec: stop setting codec context framerate
Demuxers are not supposed to do this.
2023-05-05 14:49:40 +02:00
Anton Khirnov e38e9f3d54 lavf/demux: use avg_frame_rate for packet durations for notimestamps formats
avg_frame_rate, if set, should be more reliable than stream timebase in
this case.
2023-05-05 14:49:40 +02:00
Anton Khirnov a59b4ac713 lavc/tak: do not store invalid values in stream info
When tak_get_nb_samples() fails, it will currently write
AVERROR_INVALIDDATA as TAKStreamInfo.frame_samples. The parser will then
use this negative value as a frame duration, which leads to various
breakage.

Avoid this by returning the error code from tak_parse_streaminfo()
directly; never store negative values in the parsed header.
2023-05-05 10:36:08 +02:00
Anton Khirnov ecdf1ac267 lavc/tak: make ff_tak_parse_streaminfo static
It is not used outside of tak.c
2023-05-05 10:35:08 +02:00
James Almer 6febb2a5ff avfilter/vf_coreimage: add missing semicolon
Fixes compilation after af8db9106c.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-04 22:38:47 -03:00
James Almer 0fc9c1f682 avutil/version: bump minor after recent changes
Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-04 19:20:06 -03:00
James Almer 3e06f6f040 avutil/frame: deprecate key_frame
Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-04 19:20:03 -03:00
James Almer c7a8681860 fftools: use the new AVFrame keyframe flag
Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-04 19:19:18 -03:00
James Almer af8db9106c avfilter: use the new AVFrame key_frame flag in all filters
Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-04 19:19:13 -03:00
James Almer dc7bd7c5a5 avcodec: use the new AVFrame key_frame flag in all decoders and encoders
Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-04 18:48:22 -03:00