Commit Graph

99957 Commits

Author SHA1 Message Date
Michael Niedermayer cb59cd3466 tools/target_dec_fuzzer: Call avcodec_flush_buffers() in a fuzzer choosen pattern
This should increase coverage

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-11-20 12:43:51 -03:00
James Almer 40dfb4328d tools/target_dem_fuzzer: use avio_context_free() to free the fuzzer's AVIOContext
The doxy for avio_alloc_context() states it must be used for this.

Signed-off-by: James Almer <jamrial@gmail.com>
2020-11-20 12:43:51 -03:00
Anton Khirnov 8918a3dfa2 lavfi/src_movie: switch to new decoding API 2020-11-20 15:25:26 +01:00
Anton Khirnov ce0f5397a8 doc/examples/transcoding: switch to the new encoding API 2020-11-20 15:20:24 +01:00
Anton Khirnov 29f33c1076 doc/examples/transcoding: stop constantly allocating AVFrames
Allocate just one and reuse it.
2020-11-20 15:20:24 +01:00
Anton Khirnov 800feae5d6 lavu: add missing stddef.h includes for size_t. 2020-11-20 15:20:24 +01:00
Anton Khirnov e1c4a3ea7d lavfi/lavfutils: switch to the new decoding API 2020-11-20 15:20:24 +01:00
Anton Khirnov 65c4d5d72e tools/enum_options: fix build and add to Makefile 2020-11-20 15:20:24 +01:00
Steve Lhomme 5bd870a212 avformat/matroskadec: only use the track duration if it exists
No need to multiplying/dividing when we know it's zero.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2020-11-20 15:20:24 +01:00
Steve Lhomme 3a2b786db0 avformat/matroskadec: adjust the cluster time to the track timebase
The Block timestamp read in matroska_parse_block() is in track timebase and is
passed on as such to the AVPacket which uses this timebase.

In the normal case the Cluster and Track timebases are the same because the
track->time_scale is 1.0. But when it is not the case, the values in Cluster
timebase need to be transformed in Track timebase so they can be added
together.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2020-11-20 15:20:24 +01:00
Steve Lhomme b00d2210e4 avformat/matroskadec: add a warning when the track TimestampScale won't be used
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2020-11-20 15:20:24 +01:00
Mark Reid e366797ad3 avfilter/vf_lut3d: fix sanitizef INF handling
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2020-11-20 15:20:24 +01:00
Mark Reid dd03d65540 avcodec/exr: use lookuptable for alpha if there is no trc_func
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2020-11-20 15:20:24 +01:00
Martin Storsjö 104e5233f0 http: Check for AVERROR_EOF in the check for premature end
When the check was added (in 3668701f96, in 2015), some IO
functions returned 0 on EOF (in particular, the TCP protocol
did, but the TLS protocol returned AVERROR_EOF). Since
0e1f771d22 in 2017, the TCP protocol also returns AVERROR_EOF
instead of 0, making the check for premature end never have the
intended effect.

Signed-off-by: Martin Storsjö <martin@martin.st>
2020-11-20 10:37:24 +02:00
Marton Balint bf19833ae2 avformat/mpegts: make sure mpegts_read_header always stops at the first pmt
mpegts_read_header stops parsing the file at the first PMT. However the check
that ensured this was wrong because streams can also be added before the first
PMT is received (e.g. EIT).

So let's make sure we are in the header reading phase by checking if ts->pkt is
unset instead of checking if the number of streams found so far is 0.

Signed-off-by: Marton Balint <cus@passwd.hu>
2020-11-19 21:22:07 +01:00
Limin Wang 3871326910 avformat/dvenc: check the format before vst and ast[i] are initialized
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-11-19 22:39:30 +08:00
Limin Wang da0faf10a3 avformat/dvenc: s->streams[i] -> st
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-11-19 22:39:30 +08:00
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