Commit Graph

98368 Commits

Author SHA1 Message Date
Andreas Rheinhardt 1884d887ba avformat/hevc: Defer initializations in ff_isom_write_hvcc()
Saves initialization of an HEVCDecoderConfigurationRecord when
the data is already in ISOBMFF-format or if it is plainly invalid.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-07-02 02:09:59 +02:00
Wang Cao 297d5a110b avcodec/libaomenc: Add command-line options for intra-coding tools
Signed-off-by: Wang Cao <wangcao@google.com>
Signed-off-by: James Zern <jzern@google.com>
2020-07-01 11:55:04 -07:00
Wang Cao aa5c6f382b avcodec/libaomenc: Add command-line options to control the use of partition tools
This patch adds the control for enabling rectangular partitions, 1:4/4:1
partitions and AB shape partitions.

Signed-off-by: Wang Cao <wangcao@google.com>
Signed-off-by: James Zern <jzern@google.com>
2020-07-01 11:54:56 -07:00
Timo Rothenpieler 3223f6b32d avcodec/nvenc: add new h264 levels from Video SDK 10
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2020-07-01 16:10:00 +02:00
Roman Arzumanyan 9115d77222 avcodec/nvenc: add new Video SDK 10 features
1. new Nvenc presets
2. new multipass encode modes
3. low delay key frame scale

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2020-07-01 16:10:00 +02:00
Zhao Zhili f3dc38a186 avformat/mov: fix memleaks
Fix two cases of memleaks:
1. The leak of dv_demux
2. The leak of dv_fctx upon dv_demux allocate failure

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-07-01 15:28:03 +02:00
Andreas Rheinhardt 61f5c6ab06 libavformat/mov: Fix memleaks when demuxing DV audio
The code for demuxing DV audio predates the introduction of refcounted
packets and when the latter was added, changes to the former were
forgotten. This meant that when avpriv_dv_produce_packet initialized the
packet containing the AVBufferRef, the AVBufferRef as well as the
underlying AVBuffer leaked; the actual packet data didn't leak: They
were directly freed, but not via their AVBuffer's free function.

https://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket4671/dir1.tar.bz2
contains samples for this (enable_drefs needs to be enabled for them).

Moreover, errors in avpriv_dv_produce_packet were ignored; this has been
changed, too.

Furthermore, in the hypothetical scenario that the track has a palette,
this would leak, too, so reorder the code so that the palette code
appears after the DV audio code.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-07-01 15:12:49 +02:00
Michael Niedermayer 42b28565aa avutil/avsscanf: Add () to avoid integer overflow in scanexp()
Fixes: signed integer overflow: 2147483610 + 52 cannot be represented in type 'int'
Fixes: 23260/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PBM_fuzzer-5187871274434560

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-01 11:41:35 +02:00
Michael Niedermayer 10cc82c35b avformat/utils: reorder duration computation to avoid overflow
Fixes: signed integer overflow: 8 * 9223372036854774783 cannot be represented in type 'long'
Fixes: 23381/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-4818340509122560

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-01 11:41:35 +02:00
Michael Niedermayer 65b1ba680f avcodec/pngdec: Check for fctl after idat
Fixes: out of array access
Fixes: 23554/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APNG_fuzzer-4796622520451072.fuzz

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-01 11:41:35 +02:00
Michael Niedermayer b5e39880fb avformat/hls: Pass a copy of the URL for probing
The segments / url can be modified by the io read when reloading

This may be an alternative or additional fix for Ticket8673
as a further alternative the reload stuff could be disabled during
probing

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-01 11:41:35 +02:00
Zhao Zhili 1379bbc154 avformat/isom: add comment to mov_mdhd_language_map
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-07-01 11:41:35 +02:00
James Almer 52b9bd2c95 avcodec/mlpenc: free filter state buffers on allocation failure
Signed-off-by: James Almer <jamrial@gmail.com>
2020-07-01 00:24:25 -03:00
James Almer 4cdd2d6d4c avcodec/mlpenc: propagate proper error values
Signed-off-by: James Almer <jamrial@gmail.com>
2020-07-01 00:24:25 -03:00
James Almer 14f919515d avcodec/mlpenc: remove delay codec capability
The encoder has no delayed packets at the end of the encoding
process, so signaling this capability is unnecessary.

This also fixes an assertion failure introduced in 827d6fe73d, as
return values higher than 0 are not expected.

Signed-off-by: James Almer <jamrial@gmail.com>
2020-07-01 00:23:02 -03:00
James Almer 6b57d4d9eb avcodec/internal: remove unused out_frame field from DecodeSimpleContext
It was introduced in 061a0c14bb but apparently never used

Signed-off-by: James Almer <jamrial@gmail.com>
2020-07-01 00:00:51 -03:00
Michael Niedermayer e409262837 avutil/common: Fix integer overflow in av_ceil_log2_c()
Fixes: left shift of 1913647649 by 1 places cannot be represented in type 'int'
Fixes: 23572/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-5082619795734528

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-06-30 20:35:23 +02:00
Michael Niedermayer 21598d711d avcodec/wmalosslessdec: fix overflow with pred in revert_cdlms
Fixes: signed integer overflow: 2048 + 2147483646 cannot be represented in type 'int'
Fixes: 23538/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-5227567073460224

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-06-30 20:35:23 +02:00
Gautam Ramakrishnan 579ac96a04 libavcodec/jpeg2000.c: Precinct size check removed
This patch removes a check which throws an error if
the log2 precinct width/height is 0. The standard allows
the first component to have 0 as the log2 width/height.
However, to ensure proper intialization of coding style,
an extra check has been added.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-06-30 20:35:23 +02:00
Timo Rothenpieler 9aef4ae975 avcodec/nvenc: rename tc option to something more unique
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2020-06-30 19:03:56 +02:00
Timo Rothenpieler b11ed97599 avcodec/nvenc: add a53cc option for hevc_nvenc
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2020-06-30 19:01:54 +02:00
Andreas Rheinhardt e365076c10 avformat/dump: Use intermediate pointer for access to programs array
Improves readability.

Reviewed-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-06-30 17:11:12 +02:00
Andreas Rheinhardt 0179ef7eac avformat/dump: Use const where appropriate
Also switch to using a pointer to access stream side data instead of
copying the stream's AVPacketSideData.

Reviewed-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-06-30 16:45:35 +02:00
Andreas Rheinhardt b146a61c22 avcodec/smacker: Add FF_CODEC_CAP_INIT_CLEANUP
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-06-30 11:59:54 +02:00
Limin Wang b6f505ce0a avcodec/mpeg12dec: Fix uninitialized data in fate-sub-cc-scte20
The issue is introduced in a705bcd763, please tested with below command line:
make V=1 fate-sub-cc-scte20 TARGET_EXEC="valgrind --error-exitcode=1"

Reported-by:   Martin Storsjö <martin@martin.st>
Reviewed-by:   Martin Storsjö <martin@martin.st>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-06-30 11:08:39 +08:00
Andreas Rheinhardt 5005b41ad6 fate: Update fate refs after cca982ee01
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-06-29 17:58:00 +02:00
Paul B Mahol cca982ee01 avfilter/vf_colorbalance: remove wrong addition 2020-06-29 14:52:37 +02:00
Lou Logan 4cfcfb3677 MAINTAINERS: remove myself as Twitter maintainer
Signed-off-by: Lou Logan <lou@lrcd.com>
2020-06-28 12:37:55 -08:00
Derek Buitenhuis d5247fb1da lavf/movenc: Use a dynamic buffer when writing the mfra box
When doing streamed output, with e.g. +dash, if the mfra box ended
up being larger than the AVIOContext write buffer, the (unchecked)
seeking back to update the box size would silently fail and produce
an invalid mfra box.

This is similar to how other boxes are written in fragmented mode.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2020-06-28 20:16:29 +01:00
Limin Wang fdead2a31a avcodec/nvenc: support for HEVC timecode passthrough
Reviewed-by:   Timo Rothenpieler <timo@rothenpieler.org>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-06-28 21:40:49 +08:00
Limin Wang 4ef766e73c avcodec/nvenc: add more sei data support
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-06-28 21:00:52 +08:00
Limin Wang 9294f5b497 avcodec/utils: add ff_alloc_timecode_sei() for hevc timecode sei
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-06-28 21:00:52 +08:00
Limin Wang 5151f6d295 avcodec/hevcdec: create AVFrame side data from HEVC timecodes like H.264
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-06-28 21:00:52 +08:00
Limin Wang 78f787c2e7 avcodec/hevc_sei: support HEVC timecode decode
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-06-28 21:00:52 +08:00
Limin Wang acca2aecb0 avcodec/h264_slice: use av_timecode_get_smpte()
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-06-28 21:00:52 +08:00
Limin Wang 79723c2a87 avutil/timecode: add function av_timecode_get_smpte()
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-06-28 21:00:52 +08:00
Limin Wang 12c42c709e avfilter/vf_showinfo: add a \n for end of ERROR and WARNNING log
Note for info level, one extra \n will be print after the log.

Reviewed-by:   Paul B Mahol <onemda@gmail.com>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-06-28 09:00:28 +08:00
Andreas Rheinhardt d7ad70e33b avcodec/bitstream: Avoid allocation when creating VLC tables
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-06-27 23:31:34 +02:00
Andreas Rheinhardt 5e196dac22 avcodec/bitstream: Don't check for undefined behaviour after it happened
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-06-27 23:30:54 +02:00
Andreas Rheinhardt 3129897c05 avformat/smoothstreaming: Add deinit function
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-06-27 23:19:58 +02:00
Andreas Rheinhardt 76a413d961 avformat/smoothstreaming: Don't write trailer of subcontext
Nothing written in avformat_write_trailer() for the submuxers will be
output anyway because the AVIOContexts used for actual output have been
closed before the call. Writing the trailer of the subcontext has probably
only been done in order to free the memory allocated by the submuxer.
And this job has been taken over by the deinit functions.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-06-27 23:17:07 +02:00
Michael Niedermayer b6fbbe08c3 avformat/mvdec: Fix integer overflow with billions of channels
Fixes: signed integer overflow: 1394614304 * 2 cannot be represented in type 'int'
Fixes: 23491/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5697377020411904

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-06-27 12:43:51 +02:00
Gautam Ramakrishnan 42fdf402a7 libavcodec/jpeg2000dec.c Fixed WRITE_FRAME and tile co-ordinates:
libopenjpeg2000 uses ceiling division while dividing tile
co-ordinates with the sample separation. Also, corrections
were made to the WRITE_FRAME macro.

Improves: p1_01.j2k and p1_07.j2k

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-06-27 12:44:09 +02:00
Gautam Ramakrishnan 2760de16bc libavcodec/jpeg2000dec.c: Modify image dimensions
Reduce image size of the image if all components have
a non zero sample separation. This is to replicate the
output of opj_decompress.

Improves: p1_01.j2k

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-06-27 12:43:51 +02:00
Zane van Iperen b35968e060 avcodec/adpcm_ima_apm: support new extradata format
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-06-26 21:47:13 +02:00
Limin Wang a705bcd763 avcodec/mpeg12dec: switch to AVBufferRef buffer for a53 caption
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2020-06-26 21:48:02 +08:00
Andreas Rheinhardt a0b6df0a39 avformat/avc, mxfenc: Avoid allocation of H264 SPS structure, fix memleak
Up until now, ff_avc_decode_sps would parse a SPS and return some
properties from it in a freshly allocated structure. Yet said structure
is very small and completely internal to libavformat, so there is no
reason to use the heap for it. This commit therefore changes the
function to return an int and to modify a caller-provided structure.
This will also allow ff_avc_decode_sps to return better error codes in
the future.

It also fixes a memleak in mxfenc: If a packet contained multiple SPS,
only the SPS structure belonging to the last SPS would be freed, the
other ones would leak when the pointer is overwritten to point to the
new SPS structure. Of course, without allocations there are no leaks.
This is Coverity issue #1445194.

Furthermore, the SPS structure has been renamed from
H264SequenceParameterSet to H264SPS in order to avoid overlong lines.

Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-06-26 12:13:43 +02:00
Andreas Rheinhardt 264ba34808 avformat/avc: Don't use ff_ prefix for static function
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-06-26 12:04:49 +02:00
Andreas Rheinhardt 7447045cc0 avformat/webvttdec: Accept \r as newline
After parsing the end timestamp of a WebVTT cue block, the current code
skips everything after the start of the timestamp that is not a \t, ' '
or \n and treats what is next as the start of a WebVTT cue settings list.
Yet if there is no such list, but a single \r, this will skip a part of
the cue payload (namely everything until the first occurence of \t, ' '
or \n) and treat what has not been skipped as the beginning of the
WebVTT cue settings list that extends until the next \r or \n (or the
end).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-06-26 07:48:10 +02:00
Andreas Rheinhardt 36fa84e7ac avformat/av1: Avoid using dynamic buffer when assembling av1c
Given that AV1 only has exactly one sequence header, it is unnecessary
to copy the content of said sequence header into an intermediate dynamic
buffer; instead the sequence header can be copied from where it is in
the input buffer.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-06-26 07:12:31 +02:00