Commit Graph

99940 Commits

Author SHA1 Message Date
Limin Wang
ab072de419 avfilter/vf_fade: config_props -> config_input
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-11-19 22:39:30 +08:00
Limin Wang
2399a7795b avfilter/vf_fade: simplify code to use pts timebase for time check
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-11-19 22:39:30 +08:00
Paul B Mahol
c417f1a76c avfilter/vf_xfade: add squeeze transitions 2020-11-19 14:57:41 +01:00
Gil Pedersen
7ac1dc2364 avutil/frame: fix potential leaks in av_frame_ref()
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-11-19 10:12:58 -03:00
Gil Pedersen
2b6b19dd9b avutil/frame: use av_buffer_replace() to simplify code
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Gil Pedersen <git@gpost.dk>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-11-19 10:09:47 -03:00
Gil Pedersen
abcca6a055 avcodec/wavpack: use av_buffer_replace() to simplify code
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Gil Pedersen <git@gpost.dk>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-11-19 10:04:41 -03:00
Paul B Mahol
381ab69042 avfilter/vf_frei0r: add support for commands 2020-11-19 11:55:47 +01:00
Paul B Mahol
17a0dfebf5 avfilter/vf_despill: add support for commands 2020-11-18 18:03:15 +01:00
Paul B Mahol
e3081d6f4f avfilter/af_afade: add sinc curve types 2020-11-18 11:36:53 +01:00
Martin Storsjö
284560baa7 fate: Convert the musepack8 test to an oneoff test
This fixes tests if built for x86 with x87 FPU.

Signed-off-by: Martin Storsjö <martin@martin.st>
2020-11-17 23:47:31 +02:00
Paul B Mahol
bb7bb440c2 avfilter/af_anlmdn: support all options as commands 2020-11-17 13:49:38 +01:00
Paul B Mahol
96f1b45b8c avfilter/af_anlmdn: allow to change smooth/m at runtime 2020-11-17 12:48:46 +01:00
Andrew Rodland
04340e5e01 lavfi/frei0r: Remove duplicated pix_fmt entry
Fixes e.g. 'ffmpeg -i input.mp4 -vf frei0r=pixeliz0r output.mp4':

    [Parsed_frei0r_0 @ 0x5585b8093280] Duplicated pixel format
    Error reinitializing filters!
    Failed to inject frame into filter network: Invalid argument
    Error while processing the decoded data for stream #0:0
    Conversion failed!

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2020-11-16 19:32:32 +00:00
Andreas Rheinhardt
33996444ee avcodec/mobiclip: Use get_ue_golomb_31() where possible
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-15 19:00:57 +01:00
Andreas Rheinhardt
96443ab4b0 avformat/asfdec_o: Remove code duplication
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-15 18:20:59 +01:00
Andreas Rheinhardt
33870a6aa7 avformat/asfdec_o: Don't reset twice
A variable has been assigned a value twice consecutively; essentially
the same happens when one performs av_init_packet on an AVPacket after
a call to av_packet_unref.

Found via PVS-Studio (see ticket #8156).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-15 18:20:59 +01:00
Andreas Rheinhardt
bf4909f0a3 avformat/asfdec_o: Export metadata that applies to the whole file
The ASF specification of Metadata Objects' stream number is as follows:

"Specifies whether the entry applies to a specific digital media stream
or whether it applies to the whole file. A value of 0 in this field
indicates that it applies to the whole file; otherwise, the entry
applies only to the indicated stream number and must be between 1 and
127."

Yet the asf_o demuxer (the one originating from Libav) has always
treated such metadata as if it applied to a stream even though no stream
with a stream number may exist in a valid ASF file. This is fixed in
this commit; it affected e.g. the file
wma_with_metadata_library_object_tag_trimmed.wma from the FATE suite.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-15 18:20:54 +01:00
Andreas Rheinhardt
e83f27a21a avformat/asfdec_o: Don't segfault with lots of attached pics
The ASF file format has a limit of 127 streams and the "asf_o" demuxer
(the ASF demuxer from Libav) has an array of pointers for a structure
called ASFStream that is allocated on demand for every stream. Attached
pictures are not streams in the sense of the ASF specification, yet the
demuxer created an ASFStream for them; and in one codepath it also
forgot to check whether the array of ASFStreams is already full. The
result is a write beyond the end of the array and a segfault lateron.

Fixing this is easy: Don't create ASFStreams for attached picture
streams.

(Other results of the current state of affairs are unnecessary allocations
(of ASFStreams structures), the misparsing of valid files (there might not
be enough ASFStreams left for the valid streams if attached pictures take
up too many); furthermore, the ASFStreams created for attached pictures all
have the stream number 0, an invalid stream number (the valid range is
1-127). This means that invalid data (packets for a stream with stream
number 0) won't get rejected lateron.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-15 18:17:36 +01:00
Paul B Mahol
9f20e5d281 avfilter: add speechnorm filter 2020-11-15 12:59:40 +01:00
Carl Eugen Hoyos
46e362b765 lsws/x86/yuv2rgb: Fix compilation with mmxext or ssse3 disabled.
Fixes ticket #8986.
2020-11-14 15:37:57 +01:00
Limin Wang
5bb313e723 avformat/rtsp: av_rescale -> av_rescale_q
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-11-14 09:09:28 +08:00
James Almer
0cccb5fb14 avcodec/cbs_av1: remove dead code
The other branch already covers cases where enable_order_hint is true
and frame is of type Inter.
Regression since ddb0e4fecd

Fixes Coverity issues #1469194 and #1469195.

Signed-off-by: James Almer <jamrial@gmail.com>
2020-11-13 20:36:06 -03:00
Michael Niedermayer
c7e775f712 avcodec/vp3dsp: Use unsigned constant to avoid undefined integer overflow in ff_vp3dsp_set_bounding_values()
Fixes: signed integer overflow: 64 * 33686018 cannot be represented in type 'int'
Fixes: 26911/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_THEORA_fuzzer-4904975073017856

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-11-13 18:01:54 +01:00
Michael Niedermayer
b33233bd53 avformat/icodec: Check for zero streams and stream creation failure
Fixes: NULL pointer dereference
Fixes: 26814/clusterfuzz-testcase-minimized-ffmpeg_dem_ICO_fuzzer-5758487797432320

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-11-13 17:46:47 +01:00
Michael Niedermayer
27ee67c00f avformat/icodec: Factor failure code out in read_header()
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-11-13 17:46:47 +01:00
James Almer
f9eec62983 avcodec/nvdec_av1: fix setting film grain parameters for frames with update_grain == 0
The spec in section 6.8.20 states the parameters should be loaded from a
reference frame indexed by film_grain_params_ref_idx.

Signed-off-by: James Almer <jamrial@gmail.com>
2020-11-13 10:38:18 -03:00
James Almer
5d4a6bbd4b avcodec/av1dec: remove order_hint from AV1Frame
We now have access to the raw frame header, so use that

Signed-off-by: James Almer <jamrial@gmail.com>
2020-11-13 10:38:18 -03:00
James Almer
f5517be32a avcodec/av1dec: add a reference to the raw frame header to AV1Frames
Signed-off-by: James Almer <jamrial@gmail.com>
2020-11-13 10:38:18 -03:00
Hendrik Leppkes
8f4aec719e avcodec/dxva2: add AV1 decode support
Signed-off-by: Hendrik Leppkes <h.leppkes@gmail.com>
2020-11-12 15:55:16 +01:00
Martin Storsjö
3fcfde2cea aviobuf: Increase the default SHORT_SEEK_THRESHOLD to 32 KB
The previous threshold, 4 KB, maybe was reasonable when it was set
(in 2010), but in today's settings and with typical network speeds
and data sizes, it's pretty small. 32 KB probably is a more reasonable
default now, regardless of input.

This changes the test references for two seek tests.

When using the normal seek function, which boils down to the lseek(2)
function, a seek to an out of bounds position doesn't return an error,
but that condition is only reported when doing the subsequent read
(which returns EOF). When doing more seeks by fast forwarding, the
fact that the seeked to destination is out of bounds is noticed and
reported sooner in these cases.

Signed-off-by: Martin Storsjö <martin@martin.st>
2020-11-12 14:05:43 +02:00
Andreas Rheinhardt
454bee5be0 avcodec/adpcmenc: Fix leak of trellis buffer with ADPCM_IMA_AMV
Fixes Coverity ID 1469181.

Reviewed-by: Zane van Iperen <zane@zanevaniperen.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-12 07:23:06 +01:00
Timo Rothenpieler
ac5b45abab avcodec/nvdec: add av1 hwaccel
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
Co-authored-by: James Almer <jamrial@gmail.com>
2020-11-11 18:36:09 +01:00
Timo Rothenpieler
72982f8cb5 avcodec/nvdec: add support for separate reference frame
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2020-11-11 18:36:09 +01:00
Timo Rothenpieler
5868f1c66b avcodec/av1dec: expose coded_lossless
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
Co-authored-by: James Almer <jamrial@gmail.com>
2020-11-11 18:36:09 +01:00
Timo Rothenpieler
e1efff8906 avcodec/av1dec: expose skip mode frame index
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
Co-authored-by: James Almer <jamrial@gmail.com>
2020-11-11 18:36:09 +01:00
Michael Niedermayer
f6dc285fb5 avformat/bintext: Check width
Fixes: division by 0
Fixes: 26780/clusterfuzz-testcase-minimized-ffmpeg_dem_ADF_fuzzer-5117945027756032
Fixes: 26998/clusterfuzz-testcase-minimized-ffmpeg_dem_ADF_fuzzer-5119352359354368

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-11-11 17:05:24 +01:00
Michael Niedermayer
9ef60a66f1 avformat/sbgdec: Check that end is not before start
Fixes: signed integer overflow: -9223372036854775808 + -5279949906739200 cannot be represented in type 'long'
Fixes: 26908/clusterfuzz-testcase-minimized-ffmpeg_dem_SBG_fuzzer-6329610851319808

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-11-11 17:05:24 +01:00
James Almer
a876bc9c17 avcodec/cbs_av1: add a range check to tg_end
Section 6.10.1 of the AV1 spec states:

It is a requirement of bitstream conformance that the value of tg_start is
equal to the value of TileNum at the point that tile_group_obu is invoked.
It is a requirement of bitstream conformance that the value of tg_end is
greater than or equal to tg_start.

Signed-off-by: James Almer <jamrial@gmail.com>
2020-11-11 10:23:01 -03:00
James Almer
ddb0e4fecd avcodec/cbs_av1: infer ref_order_hint when not coded in the bitstream
Signed-off-by: James Almer <jamrial@gmail.com>
2020-11-11 10:17:24 -03:00
Limin Wang
89429cf2f2 avformat/rtspdec: return proper error code
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-11-11 18:32:56 +08:00
Limin Wang
aa1fab6934 avformat/rtsp: check return value of ffurl_read_complete
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-11-11 18:32:56 +08:00
Limin Wang
001ccbc5cc avformat/rtsp: prefer to use variable instead of type
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-11-11 18:32:56 +08:00
Limin Wang
9e2872bc67 avformat/rtspdec: use SDP_MAX_SIZE for sdp array
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-11-11 18:32:56 +08:00
Limin Wang
33f6bb7828 avformat/rtsp: move SDP_MAX_SIZE macro definition to header file
move comments for the size of SDP_MAX_SIZE here:
Some SDP lines, particularly for Realmedia or ASF RTSP streams,
contain long SDP lines containing complete ASF Headers (several
kB) or arrays of MDPR (RM stream descriptor) headers plus
"rulebooks" describing their properties. Therefore, the SDP line
buffer is large.
The Vorbis FMTP line can be up to 16KB - see xiph_parse_sdp_line
in rtpdec_xiph.c.

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-11-11 18:32:56 +08:00
Limin Wang
5439460016 avformat/rtsp: 16384 -> SDP_MAX_SIZE
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-11-11 18:32:56 +08:00
Michael Niedermayer
b1d99ab14f avformat/lvfdec: Check stream_index before use
Fixes: assertion failure
Fixes: 26905/clusterfuzz-testcase-minimized-ffmpeg_dem_LVF_fuzzer-5724267599364096.fuzz

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>
2020-11-10 16:37:37 +01:00
Michael Niedermayer
d16974c3dd avformat/au: cleanup on EOF return in au_read_annotation()
Fixes: memleak
Fixes: 26841/clusterfuzz-testcase-minimized-ffmpeg_dem_AU_fuzzer-5174166309044224
Regression since: e680d50eb4
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-11-10 16:37:37 +01:00
Thierry Foucu
1c57b8ae3b libavformat/avidec: Extract more metadata from the header
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-11-10 16:37:37 +01:00
Paul B Mahol
ee4a046540 avfilter/af_asoftclip: add oversampling support 2020-11-10 15:25:18 +01:00
Andreas Rheinhardt
7e8306dd2d avcodec/gdv: Remove dead check
At the end of its decode function, the decoder sets *got_frame to 1 and
then checks whether ret is < 0; if so, it is returned, otherwise
avpkt->size is. But it is impossible for ret to be < 0 here and if it
were, it would be nonsense to set *got_frame to 1 before this. Therefore
just return avpkt->size unconditionally.

Fixes Coverity issue #1439730.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-11-10 02:14:29 +01:00