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

103625 Commits

Author SHA1 Message Date
Michael Niedermayer
9a222f140e avformat/mov: Check for duplicate clli
Fixes: memleak
Fixes: 35261/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-4869656287510528

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-14 17:34:33 +02:00
Michael Niedermayer
8f4c36553c tools/target_dec_fuzzer: Adjust threshold for WMV3
Fixes: Timeout clearing images
Fixes: 37726/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMV3_fuzzer-4604669570187264

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-14 17:34:33 +02:00
Michael Niedermayer
7dfa8040d6 avcodec/jpeg2000_parser: Check state!=0
Fixes: out of array read
Fixes: 37664/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JPEG2000_fuzzer-5893420460146688

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>
2021-09-14 17:34:33 +02:00
Michael Niedermayer
4d81550df9 avformat/utils: Ignore negative duration in codec_info_duration computation
Fixes: signed integer overflow: -5994697211974418462 + -3255307777713450286 cannot be represented in type 'long'
Fixes: 35332/clusterfuzz-testcase-minimized-ffmpeg_dem_MATROSKA_fuzzer-5868035117285376

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-14 16:51:29 +02:00
Andreas Rheinhardt
bbc24363f1 avcodec/bsf: Unref the packet when flushing
The documentation does not require the packet to be blank in this case
(i.e. it can now contain opaque_ref), but it does contain that the
contents will be reset upon success.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-14 13:41:34 +02:00
Andreas Rheinhardt
b99fb4df42 avcodec/bsf: Use null-bsf for passthrough when available
When an empty list bsf is used for passthrough, there is a check
for every packet in bsf_list_filter() before ff_bsf_get_packet_ref()
is called. Directly using the null bsf avoids that.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-14 13:41:26 +02:00
Andreas Rheinhardt
b2793a9462 tools/target_bsf_fuzzer: Make it const-correct
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-14 13:36:31 +02:00
Andreas Rheinhardt
a1292895cb configure: Remove null_bsf dependency
Unneeded since c96904f525
(a bsf-list with zero bsfs is used since that commit).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-14 13:36:19 +02:00
Michael Niedermayer
989febfbd0 avformat/jacosubdec: Check for min in t overflow in get_shift()
Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
Fixes: 34651/clusterfuzz-testcase-minimized-ffmpeg_dem_JACOSUB_fuzzer-5157941012463616

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-13 22:48:10 +02:00
Michael Niedermayer
3dd5a8a135 avformat/mxfdec: check channel number in mxf_get_d10_aes3_packet()
Fixes: Out of array access
Fixes: 37030/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5387719147651072

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-13 21:13:05 +02:00
Andreas Rheinhardt
441b292592 avfilter/internal: Add AVFILTER_DEFINE_CLASS_EXT
This macro will allow to share options between AVClasses without
having to redefine the option name (as is currently done) and will
also allow to share the AVClasses itself (which is possible now
that AVClass.child_class_next is gone).

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-13 16:08:29 +02:00
Andreas Rheinhardt
142f41a060 avfilter/vf_maskedminmax: Simplify init
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-13 16:08:12 +02:00
Andreas Rheinhardt
dc2279a4f2 avfilter/avfilter: Remove unused count
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-13 16:05:15 +02:00
Paul B Mahol
db2514a5dc avfilter/af_speechnorm: improve EOF timestamp precision 2021-09-12 23:47:32 +02:00
Paul B Mahol
f78d0f67be avfilter/af_dynaudnorm: improve EOF timestamp precision 2021-09-12 23:47:32 +02:00
bnnm
19802d170a avcodec/wmadec: fix WMA gapless playback
Fixes trac issue #7473.

Removes encoder delay (skip samples) and writes remaining frame samples after EOF to get correct sample count.

Output is now accurate vs players that use Microsoft's codecs (Windows Media Format Runtime).

Tested vs encode>decode WMAv2 with MS's codecs and most sample rate/bit rate/channel/mode combinations in ASF/XWMA.
WMAv1 appears to use the same delay, from FFmpeg samples.

Signed-off-by: bnnm <bananaman255@gmail.com>
2021-09-12 22:23:35 +02:00
Paul B Mahol
d1971d69c7 avformat/dv: always set audio packet duration
If audio packet is present in DV stream it have duration of 1 in DV timebase units.
2021-09-12 22:23:35 +02:00
Haihao Xiang
6803d8b440 ffmpeg_hw: make hardware selection for filters more user friendly
When a device is derived from a source device, there are at least 2
devices, and usually the derived device is the expected device, so let's
pick the last device if user doesn't specify the filter device with
filter_hw_device option

After applying this patch, the command below can work:

$> ffmpeg -init_hw_device vaapi=va:/dev/dri/renderD128 -init_hw_device
qsv=hw@va -f lavfi -i yuvtestsrc  -vf
format=nv12,hwupload=extra_hw_frames=64 -c:v h264_qsv -y out.h264

Reviewed-by: Soft Works <softworkz@hotmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-12 13:33:50 -03:00
Paul B Mahol
cd4e6e404b avfilter/vf_extractplanes: fix regression
Report & solution provided by Andreas Rheinhardt.
2021-09-12 17:06:21 +02:00
Niklas Haas
a543d075cd avcodec/h274: trim unnecessarily large array
We only ever read to idx+3, so 256 values are overkill.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-12 11:07:40 -03:00
Niklas Haas
52c35d648c avcodec/h274: don't read from uninitialized array members
This bug flew under the radar because, in practice, these values are
0-initialized for the first invocation. But for subsequent invocations
(with different h/v values), reading from the uninitialized parts of
`out` is undefined behavior.

Avoid this by simply adjusting the iteration range of the following
loops. Has the added benefit of being a minor speedup.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-12 11:07:40 -03:00
Paul B Mahol
c4973e2148 avfilter/vf_xfade: check default switch case 2021-09-12 15:06:08 +02:00
Paul B Mahol
1db828db8b avfilter/vf_xfade: add zoomin transition 2021-09-12 15:01:48 +02:00
Paul B Mahol
b35653d4c4 avfilter/vf_extractplanes: stop marking alphaextract filter as dynamic outputs 2021-09-12 13:50:01 +02:00
Paul B Mahol
882045f3dd avfilter/af_afftfilt: reindent after last commit 2021-09-12 13:28:12 +02:00
Paul B Mahol
485a52e618 avfilter/af_afftfilt: add timeline support 2021-09-12 13:28:12 +02:00
Paul B Mahol
94d4cc24c3 avfilter/af_asoftclip: rewrite oversampling
Fixes most aliasing issues.
2021-09-12 12:55:50 +02:00
Paul B Mahol
3e127b595a avfilter/vf_fieldmatch: initialize dst pointer to silence warning 2021-09-11 22:19:25 +02:00
Paul B Mahol
bf0f996c12 avfilter/f_segment: silence compiler warning 2021-09-11 22:19:25 +02:00
Paul B Mahol
0a8a0c96ae avfilter/f_loop: initialize ret to silence compiler warning 2021-09-11 22:19:25 +02:00
Paul B Mahol
d460a5f8ba avfilter/af_arnndn: initialize ret to silence compiler warning 2021-09-11 22:19:25 +02:00
Paul B Mahol
533ddd61e5 avfilter/af_afftdn: move i initialization to silence warning 2021-09-11 22:19:25 +02:00
Paul B Mahol
b53f9c5e68 avfilter/af_apsyclip: fix mixed declarations and code 2021-09-11 21:47:49 +02:00
Paul B Mahol
eeab62ad2d avfilter: add audio psychoacoustic clipper 2021-09-11 16:19:40 +02:00
Paul B Mahol
966fc3c070 avfilter/af_astats: add entropy stat 2021-09-11 10:54:20 +02:00
Paul B Mahol
463c71b3b3 avfilter/vf_convolution: add scharr operator 2021-09-10 18:43:51 +02:00
Paul B Mahol
0b4d009587 fate: fix silenceremove test 2021-09-09 23:45:52 +02:00
Paul B Mahol
abd24eaf68 avfilter/af_silenceremove: fix regression in output frame pts 2021-09-09 20:22:02 +02:00
Xu Guangxin
3bbe0c210b avcodec/qsv_enc: do not reuse enc_ctrl from previous frames
fixes #8857

If we do not clear the enc_ctrl, we will reuse previous frames' data like FrameType.

Reviewed-by: Xiang, Haihao <haihao.xiang@intel.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-09 12:53:25 -03:00
Andreas Rheinhardt
bb9141cc13 avcodec/mlpenc: Fix mixed declarations and code warning
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-09 12:07:06 +02:00
Peter Ross
20f9cfb3e3 avcodec/siren: decode_vector: remove unused parameter
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Peter Ross <pross@xvid.org>
2021-09-09 18:38:16 +10:00
Peter Ross
e8aec714d3 avcodec/siren: replace magic numbers with macro value
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Peter Ross <pross@xvid.org>
2021-09-09 18:38:16 +10:00
Adam Chelminski
715f63232f avcodec/libvpxenc: Apply codec options to alpha codec context
When encoding yuva420 (alpha) frames, the vpx encoder uses a second
vpx_codec_ctx to encode the alpha stream. However, codec options were
only being applied to the primary encoder. This patch updates
codecctl_int and codecctl_intp to also apply codec options to the alpha
codec context when encoding frames with alpha.

This is necessary to take advantage of libvpx speed optimizations
such as 'row-mt' and 'cpu-used' when encoding videos with alpha.
Without this patch, the speed optimizations are only applied to the
primary stream encoding, and the overall encoding is just as slow
as it would be without the options specified.

Signed-off-by: Adam Chelminski <chelminski.adam@gmail.com>
Signed-off-by: James Zern <jzern@google.com>
2021-09-08 18:48:00 -07:00
Andreas Rheinhardt
3008a93b4d avformat/rtpdec: Make ff_rtp_handler_iterate() static
Possible since 6197453761.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-08 22:59:14 +02:00
Andreas Rheinhardt
cd3d7b0f8f avformat/rawdec: Make ff_raw_data_read_header() static
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-08 22:59:14 +02:00
Andreas Rheinhardt
49916dafb9 avformat/mov_chan: Make ff_mov_get_channel_layout() static
Possible since 3bab7cd128.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-08 22:59:14 +02:00
Andreas Rheinhardt
41751e4aef avcodec/iirfilter: Make ff_iir_filter_flt() static
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-08 22:59:14 +02:00
Andreas Rheinhardt
854f7bab5a avcodec/snow_dwt: Make ff_snow_(horizont|vertic)al_compose97i static
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-08 22:59:14 +02:00
Andreas Rheinhardt
faa62773cb avcodec/jpeg2000: Make ff_tag_tree_size() static
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-08 22:59:14 +02:00
Andreas Rheinhardt
fc9cb7d51a avcodec/mqcenc: Make ff_mqc_flush() static
Only used as an auxiliary function for ff_mqc_flush_to() since
4624656797.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-08 22:59:14 +02:00