1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

103091 Commits

Author SHA1 Message Date
Andreas Rheinhardt
c2d853c1aa avformat/mov: Fix crash with too big STSZ atoms
mov_read_stsz() did not ensure that every bit of a buffer is addressable
by an int as is required by the get_bits API, leading to a crash in
ticket #9344. Fix this by restricting the size more thoroughly.

The file from said ticket will then be considered invalid; in the
future, we might read and process the data in chunks to actually support
such files.

Fixes ticket #9344.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-28 22:26:54 +02:00
Michael Niedermayer
f0ed8de1d6 tools/target_dec_fuzzer: Adjust threshold for VP6F
Fixes: Timeout
Fixes: 34791/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP6F_fuzzer-4571038838030336

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-07-28 19:15:26 +02:00
Michael Niedermayer
46e8778300 tools/target_dec_fuzzer: Adjust the threshold for VP5
Fixes: Timeout
Fixes: 35793/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP5_fuzzer-6492854393372672

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-07-28 19:15:26 +02:00
Michael Niedermayer
cce928e941 tools/target_dec_fuzzer: Adjust the threshold for VP3
Fixes: Timeout
Fixes: 35855/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP3_fuzzer-4851183540895744

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-07-28 19:15:26 +02:00
Michael Niedermayer
200406d930 avformat/mov: Fix incorrect overflow detection in mov_read_sidx()
Fixes: signed integer overflow: 9223372036854775807 + 1442840321 cannot be represented in type 'long'
Fixes: 33670/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6644379491106816

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-07-28 19:15:26 +02:00
Michael Niedermayer
54b798638e tools/target_dec_fuzzer: Fix extradata duplication
Fixes: out of array access
Fixes: 36340/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5872546875572224.fuzz

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-07-28 19:15:26 +02:00
Thierry Foucu
fc300613be libavcodec/mpeg12dec.c: Switch to init_get_bits8 and checks return value
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-07-28 19:15:26 +02:00
Paul B Mahol
0068b3d0f0 avfilter/avf_showcqt: switch to TX FFT from avutil 2021-07-27 21:16:28 +02:00
Paul B Mahol
925d41ebd4 avfilter/af_afftdn: switch to TX FFT from avutil 2021-07-27 20:48:40 +02:00
Paul B Mahol
51c22f6621 avfilter/avf_concat: fix EOF timestamp 2021-07-27 20:19:52 +02:00
Haihao Xiang
f2feb31b78 qsvenc: Value '0' is not a valid value for parameter GopOptFlag
The accepted values for GopOptFlag are MFX_GOP_CLOSED (1) and
MFX_GOP_STRICT (2).

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
Signed-off-by: Zhong Li <zhongli_dev@126.com>
2021-07-27 23:48:53 +08:00
James Almer
487dfa9f04 avformat/concat: check the terminating character returned by av_get_token()
Don't attempt to increase the cursor pointer if it was \0.
Fixes invalid reads.

Reviewed-by: Marton Balint <cus@passwd.hu>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-07-27 12:13:32 -03:00
Paul B Mahol
bc5faacc3f avfilter/vf_pseudocolor: add three more presets 2021-07-26 22:49:02 +02:00
James Almer
f7958d0883 avcodec/h264_sei: honor the Film Grain Characteristics cancel flag
Film Grain persistence is cancelled when it's true.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-07-25 23:54:10 -03:00
Paul B Mahol
da6975f022 avfilter/af_silenceremove: make window also depends on input sample format 2021-07-25 22:48:25 +02:00
Jan Ekström
4c694093be ffmpeg: fix order between field order autodetection and override
Having the override before autodetection meant that the overridden
value got overwritten by the autodetected result each time,
effectively disabling the ability to utilize the `-top` option
for override purposes.

Somehow I missed this in fbb44bc51a ,
even though the lines were within the context. Probably the code
originally being after this logic had something to do with it,
but previously it only touched the avformat context's codecpar,
which did not affect the encoder codec context whatsoever.

Fixes #9320
Fixes #9339
2021-07-25 22:40:49 +03:00
Paul B Mahol
a1f7d25cef avformat/yuv4mpegenc: add support for yuva444p 2021-07-25 17:08:35 +02:00
Paul B Mahol
d08deb11d2 avfilter/af_silenceremove: add support for more sample formats 2021-07-25 16:42:58 +02:00
Paul B Mahol
6f0f7bc7fe avfilter/f_ebur128: fix video output regression 2021-07-25 13:16:58 +02:00
Paul B Mahol
274112c88d avfilter/f_ebur128: add all sample rates support
The magic constants come from the unofficial "ITU-R BS.1770-1 filter
specifications"¹ by Raiden (libebur128) which relies on "Parameter
Quantization in Direct-Form Recursive Audio Filters"² by Brian
Neunaber.

The constants seem to include a quantization bias, for example:
- Vb is supposed to be exactly √Vh in a high shelf filter
- the Pre-filter Gain should likely be 4dB
- Pre Q and RLB Q are respectively very close to √½ and ½

Those are not adjusted to prevent the values from drifting away from
the official specifications.

An alternative to this approach would be to requantize on the fly as
proposed by pbelkner³, where the 48kHz code path would use the exact
specifications constants while derivating constants for other
frequencies.

[1]: https://www.scribd.com/document/49991813/ITU-R-BS-1770-1-filters
[2]: https://www.scribd.com/document/6531763/Direct-Form-Filter-Parameter-Quantization
[3]: https://hydrogenaud.io/index.php?topic=86116.msg740092#msg740092
2021-07-25 12:15:29 +02:00
Paul B Mahol
a2a7547b2f avfilter/af_afwtdn: add forgotten break statement 2021-07-25 11:47:47 +02:00
Paul B Mahol
207e9b1760 avfilter/vf_threshold: add support for commands 2021-07-25 11:24:18 +02:00
Paul B Mahol
6210cc8c7e avfilter/af_anlmdn: add longer names of filter options 2021-07-25 10:23:30 +02:00
Valerii Zapodovnikov
fdd45ebf55 lavfi/signature: fix always true expression
Otherwise since "==" has higher precedence, mode is never checked.

Reviewed-by: Jai Luthra <me@jailuthra.in>
2021-07-25 05:10:33 +05:30
Paul B Mahol
6fcb082b7a avfilter/vf_pseudocolor: add solar preset
Useful to emphasize bandings in video.
2021-07-24 23:12:13 +02:00
Paul B Mahol
d5c76450f8 avfilter/vf_fillborders: add another mode 2021-07-24 20:23:58 +02:00
Paul B Mahol
94c90b3261 avfilter/avf_showspectrum: fix not rendering all channels with fscale=log:mode=separate 2021-07-24 17:30:58 +02:00
Paul B Mahol
60e2348e27 configure: remove sofalizer triggering of avcodec dependency 2021-07-24 17:01:20 +02:00
Paul B Mahol
e5c860cd29 avfilter/avf_showspectrum: fix hz scale with legend enabled 2021-07-24 16:56:51 +02:00
Paul B Mahol
014ace8f98 avfilter/avf_showspectrum: switch to TX FFT from avutil 2021-07-24 16:49:53 +02:00
Paul B Mahol
88b6342c2b avfilter/af_headphone: switch to TX FFT from avutil 2021-07-24 12:24:40 +02:00
Paul B Mahol
f6aeb94d72 avfilter/af_sofalizer: switch to TX FFT from avutil 2021-07-24 12:24:40 +02:00
Paul B Mahol
6846d48fa6 avfilter: add afwtdn filter 2021-07-24 12:24:40 +02:00
Andreas Rheinhardt
c253b180cb tools/graph2dot: Don't use sizeof(AVFilterGraph), check allocation
Use avfilter_graph_alloc() instead of av_mallocz(sizeof(AVFilterGraph))
to allocate an AVFilterGraph; this also properly allocates the graph's
internal. The current code just happened to work because it did not
make any use of said internal.

Also check the allocation; this fixes Coverity #1292528.

Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-24 05:35:10 +02:00
James Almer
4ff73add5d avcodec/h264_sei: parse and export Film Grain Characteristics SEI messages
Signed-off-by: James Almer <jamrial@gmail.com>
2021-07-23 11:06:45 -03:00
James Almer
e3b5ff17c2 avutil/film_grain_params: add support for H.274 Film Grain Characteristics
Used by codecs like H.264, HEVC, and VVC.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-07-23 11:06:31 -03:00
James Almer
41d1dba4d2 cbs_h264: add support for Film Grain Characteristics SEI messages
Signed-off-by: James Almer <jamrial@gmail.com>
2021-07-23 11:05:04 -03:00
Andreas Rheinhardt
c4042fc1e3 avfilter/vf_shufflepixels: Check ff_get_video_buffer()
There would be a segfault in case of (likely memory allocation) failure.
Fixes Coverity issue #1322338.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-23 15:06:21 +02:00
Andreas Rheinhardt
046cbd255e avformat/yuv4mpegdec: Use table instead of repeated "else if"
The code savings more than offset the size of the table
(1936B vs 768B with GCC 10.3 at -O3).

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-23 15:05:39 +02:00
Andreas Rheinhardt
5be809fed9 avcodec/tableprint_vlc: Fix building with hardcoded tables
This has been broken in 25c8507818,
because the hacks for headers that are incompatible with building
for the host in libavcodec/tableprint_vlc.h have not been adjusted.

Moving AV_INPUT_BUFFER_PADDING_SIZE to defs.h which is valid for
both the target as well as the host allowed to remove some of the hacks.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-23 14:43:52 +02:00
Michael Niedermayer
69aa2488fc tools/target_dec_fuzzer: Adjust threshold for libvorbis
Fixes: Timeout
Fixes: 33513/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LIBVORBIS_fuzzer-6481006635909120

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-07-22 23:33:26 +02:00
Michael Niedermayer
7666d588ba avformat/mov: Avoid undefined overflow in time_offset calculation
Fixes: signed integer overflow: 8511838621821575200 - -3954125146725285889 cannot be represented in type 'long'
Fixes: 33414/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6610119325515776

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-07-22 23:33:26 +02:00
Andreas Rheinhardt
25c8507818 Remove/replace some unnecessary avcodec.h inclusions
Also remove other unnecessary headers and include headers directly while
at it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-22 15:29:46 +02:00
Andreas Rheinhardt
e3023e9015 avcodec/g729postfilter.h: Include acelp_pitch_delay.h
Needed for PITCH_DELAY_MAX.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-22 15:02:46 +02:00
Andreas Rheinhardt
e0b4fe0efa avcodec: Remove some unnecessary mpegvideo.h inclusions
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-22 15:02:46 +02:00
Andreas Rheinhardt
2934a4b9a5 Remove unnecessary avassert.h inclusions
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-22 15:02:30 +02:00
Andreas Rheinhardt
4608f7cc6a Remove unnecessary mem.h inclusions
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-22 14:47:57 +02:00
Andreas Rheinhardt
e7bd47e657 Remove obsolete version.h inclusions
These have mostly been added because of FF_API_*; yet when these were
removed, removing the header has been forgotten.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-22 14:34:31 +02:00
Andreas Rheinhardt
2c05ee092b avutil/internal, swresample/audioconvert: Remove cpu.h inclusions
These inclusions are not necessary, as cpu.h is already included
wherever it is needed (via direct inclusion or via the arch-specific
headers).
Also remove other unnecessary cpu.h inclusions from ordinary
non-headers.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-22 14:33:45 +02:00
Andreas Rheinhardt
f6f85d9582 avcodec/lossless_videodsp: Improve included headers
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-22 13:00:11 +02:00