]> git.sesse.net Git - ffmpeg/log
ffmpeg
4 years agoavfilter/vf_v360: do not ignore return value of allocate_plane()
Paul B Mahol [Tue, 23 Jun 2020 19:53:39 +0000 (21:53 +0200)]
avfilter/vf_v360: do not ignore return value of allocate_plane()

4 years agoavcodec/ccaption_dec: add support for background colors
Paul B Mahol [Sun, 21 Jun 2020 12:21:46 +0000 (14:21 +0200)]
avcodec/ccaption_dec: add support for background colors

4 years agolavc: Lower MediaFoundation audio encoder priority.
Carl Eugen Hoyos [Tue, 23 Jun 2020 18:41:46 +0000 (20:41 +0200)]
lavc: Lower MediaFoundation audio encoder priority.

The actual encoders may not be available.
Fixes ticket #8699.

4 years agodoc/general: mention BT20 decoder
Paul B Mahol [Tue, 23 Jun 2020 14:04:31 +0000 (16:04 +0200)]
doc/general: mention BT20 decoder

4 years agodoc/general: merge dupe ProRes entries
Paul B Mahol [Tue, 23 Jun 2020 13:53:45 +0000 (15:53 +0200)]
doc/general: merge dupe ProRes entries

While here add missing fourcc.

4 years agodoc/general: mention NotchLC
Paul B Mahol [Tue, 23 Jun 2020 13:51:13 +0000 (15:51 +0200)]
doc/general: mention NotchLC

4 years agoavfilter/vf_v360: add orthographic projection support
Paul B Mahol [Mon, 22 Jun 2020 18:16:22 +0000 (20:16 +0200)]
avfilter/vf_v360: add orthographic projection support

4 years agoavfilters/vf_v360: add equisolid projection support
Paul B Mahol [Mon, 22 Jun 2020 12:39:35 +0000 (14:39 +0200)]
avfilters/vf_v360: add equisolid projection support

4 years agoavfilter/vf_showpalette: Don't pretend disp_palette can fail
Andreas Rheinhardt [Mon, 15 Jun 2020 18:01:07 +0000 (20:01 +0200)]
avfilter/vf_showpalette: Don't pretend disp_palette can fail

It can't fail, yet it returns an int and other code checks whether it
failed; yet if it did fail, an AVFrame would leak. One could of course
add an av_frame_free for this (that compilers could optimize away), yet
it is easier to simply stop pretending that disp_palette could fail.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/sccdec: Avoid variable that is always zero
Andreas Rheinhardt [Sun, 14 Jun 2020 19:27:54 +0000 (21:27 +0200)]
avformat/sccdec: Avoid variable that is always zero

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/pjsdec: Avoid variable that is always zero
Andreas Rheinhardt [Sun, 14 Jun 2020 19:27:35 +0000 (21:27 +0200)]
avformat/pjsdec: Avoid variable that is always zero

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/mpl2dec: Avoid variable that is always zero
Andreas Rheinhardt [Sun, 14 Jun 2020 19:27:00 +0000 (21:27 +0200)]
avformat/mpl2dec: Avoid variable that is always zero

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/mov: Cosmetics
Andreas Rheinhardt [Sun, 14 Jun 2020 19:26:16 +0000 (21:26 +0200)]
avformat/mov: Cosmetics

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/mov: Avoid allocation when reading ddts atom
Andreas Rheinhardt [Sun, 14 Jun 2020 19:18:23 +0000 (21:18 +0200)]
avformat/mov: Avoid allocation when reading ddts atom

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/mov: Use ffio_read_size where appropriate
Andreas Rheinhardt [Sun, 14 Jun 2020 19:12:56 +0000 (21:12 +0200)]
avformat/mov: Use ffio_read_size where appropriate

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/mov: Avoid allocation+copy when moving extradata
Andreas Rheinhardt [Sun, 14 Jun 2020 19:04:36 +0000 (21:04 +0200)]
avformat/mov: Avoid allocation+copy when moving extradata

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/mov: Read attached pics directly into st->attached_pic
Andreas Rheinhardt [Sun, 14 Jun 2020 07:39:17 +0000 (09:39 +0200)]
avformat/mov: Read attached pics directly into st->attached_pic

Given that av_get_packet returns a blank packet on error, the only
difference to the current approach (that uses intermediate AVPackets on
the stack) is that st->attached_pic will be properly initialized on error
(i.e. the timestamps are AV_NOPTS_VALUE) whereas right now st->attached_pic
is only zeroed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/mov: Check earlier whether reel_name string is empty
Andreas Rheinhardt [Sun, 14 Jun 2020 18:50:29 +0000 (20:50 +0200)]
avformat/mov: Check earlier whether reel_name string is empty

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavcodec, avformat: Remove unnecessary initializations of side data size
Andreas Rheinhardt [Sun, 21 Jun 2020 04:50:03 +0000 (06:50 +0200)]
avcodec, avformat: Remove unnecessary initializations of side data size

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/avformat: Improve documentation of av_stream_get_side_data
Andreas Rheinhardt [Sun, 21 Jun 2020 04:47:23 +0000 (06:47 +0200)]
avformat/avformat: Improve documentation of av_stream_get_side_data

Document that it also sets the size in case the desired side data is
absent (if the pointer has been supplied).

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavcodec/packet: Improve documentation of av_packet_get_side_data
Andreas Rheinhardt [Sun, 21 Jun 2020 04:40:19 +0000 (06:40 +0200)]
avcodec/packet: Improve documentation of av_packet_get_side_data

Document that it also sets the size in case the desired side data is
absent (if the pointer has been supplied).

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/flvdec: Cosmetics
Andreas Rheinhardt [Sun, 21 Jun 2020 06:36:08 +0000 (08:36 +0200)]
avformat/flvdec: Cosmetics

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavcodec/nellymoserdec: Don't use invalid AVPacketSideDataType
Andreas Rheinhardt [Sun, 21 Jun 2020 03:17:08 +0000 (05:17 +0200)]
avcodec/nellymoserdec: Don't use invalid AVPacketSideDataType

Commits 957a593cd95b15a5dcb2f50306fbac59f09d8e9e and
11828b8885cc1d87ffc7b1b4bbe642ce9720b194 made the flv demuxer export
a certain flag as side data to be used by the nellymoser decoder for
mid-stream sample rate changes. It used a custom side data type 'F' that
was never officially documented.

Yet since 2215c39e94e01f57b3191a29e0e51d7e230daf49 (merged in commit
52c522c72090233edeeb0486a9bd8bee925a710a) this information is exported
via the properly documented AV_PKT_DATA_PARAM_CHANGE side data.
The merge commit therefore stopped exporting the 'F' sidedata; yet the
changes in the Nellymoser decoder (which are now dead code (and would
become dangerous if lots of new side data types were added)) have not
been removed. This commit does this.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/dashenc: Calculate average bitrate for adaptation sets in static manifest
Przemysław Sobala [Wed, 17 Jun 2020 11:50:12 +0000 (13:50 +0200)]
avformat/dashenc: Calculate average bitrate for adaptation sets in static manifest

If stream's bitrate is not specified:
- for static manifest: an average bitrate will be calculated and used,
- for dynamic manifest: first segment's bitrate will be calculated and used, as before,
for bandwidth setting in adaptation sets.

4 years agoRevert "avformat/dashenc: use AVStream timebase when computing missing bitrate"
Przemysław Sobala [Tue, 16 Jun 2020 12:32:03 +0000 (14:32 +0200)]
Revert "avformat/dashenc: use AVStream timebase when computing missing bitrate"

This reverts commit 2a9ffd89fcb09bd69b2130da039ad2caba79cf33 as duration is always in AV_TIME_BASE units

4 years agoavfilter/af_ladspa: check return value of getenv()
Paul B Mahol [Sun, 21 Jun 2020 19:34:18 +0000 (21:34 +0200)]
avfilter/af_ladspa: check return value of getenv()

4 years agoavfilter/af_ladspa: add latency compensation
Paul B Mahol [Sun, 21 Jun 2020 19:25:56 +0000 (21:25 +0200)]
avfilter/af_ladspa: add latency compensation

4 years agoavfilter/af_ladspa: check another directory for plugins
Paul B Mahol [Sun, 21 Jun 2020 12:46:29 +0000 (14:46 +0200)]
avfilter/af_ladspa: check another directory for plugins

4 years agoavcodec/hcadec: get intensity from correct channel
summertriangle.dev@gmail.com [Wed, 17 Jun 2020 21:45:07 +0000 (14:45 -0700)]
avcodec/hcadec: get intensity from correct channel

Fixes an issue with one output channel being slightly louder than
the other. The output now matches other public HCA decoders.

Signed-off-by: t <summertriangle.dev@gmail.com>
4 years agoavcodec/hcadec: fix decoding of hfr channels
summertriangle.dev@gmail.com [Wed, 17 Jun 2020 21:45:06 +0000 (14:45 -0700)]
avcodec/hcadec: fix decoding of hfr channels

I suspect this was originally broken by b7e5c8f , but even
then, it only worked because it read out of bounds from
intensity_ratio_table.

Signed-off-by: t <summertriangle.dev@gmail.com>
4 years agoavcodec/adpcmenc: remove forward declaration
Andriy Gelman [Sat, 20 Jun 2020 18:31:53 +0000 (14:31 -0400)]
avcodec/adpcmenc: remove forward declaration

Reviewed-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
4 years agoavcodec/mpeg12dec: do not discard older a53 captions
Paul B Mahol [Sat, 20 Jun 2020 13:02:48 +0000 (15:02 +0200)]
avcodec/mpeg12dec: do not discard older a53 captions

Fixes #6105.

4 years agoavcodec/ccaption_dec: use uint8_t type for prev_cmd array
Paul B Mahol [Fri, 19 Jun 2020 21:14:26 +0000 (23:14 +0200)]
avcodec/ccaption_dec: use uint8_t type for prev_cmd array

Commands are unsigned so be consistent.

4 years agoavcodec/ccaption_dec: do not modify packet data in case of parity error
Paul B Mahol [Fri, 19 Jun 2020 14:23:53 +0000 (16:23 +0200)]
avcodec/ccaption_dec: do not modify packet data in case of parity error

To dissallow similar errors in future, make pointers const.

4 years agoavcodec/ccaption_dec: allow selection of second field captions
Paul B Mahol [Fri, 19 Jun 2020 14:16:28 +0000 (16:16 +0200)]
avcodec/ccaption_dec: allow selection of second field captions

4 years agoavcodec/ccaption_dec: rework non-real-time mode with pop-on captions by delaying
Paul B Mahol [Wed, 17 Jun 2020 18:56:53 +0000 (20:56 +0200)]
avcodec/ccaption_dec: rework non-real-time mode with pop-on captions by delaying

So it give similar output as visual output of real-time mode.

4 years agodoc/encoders: fix the misleading usage of profile
Limin Wang [Fri, 19 Jun 2020 23:20:11 +0000 (07:20 +0800)]
doc/encoders: fix the misleading usage of profile

users are getting mislead by the integer, although profile
can support both const string and integer.
http://ffmpeg.org/pipermail/ffmpeg-user/2020-June/049025.html

Also fix the order of high and main, it's not my intention.

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavfilter: add D2TS, TS2D, TS2T as a common macro in internal.h
Limin Wang [Mon, 1 Jun 2020 16:14:45 +0000 (00:14 +0800)]
avfilter: add D2TS, TS2D, TS2T as a common macro in internal.h

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavformat/dvenc: return error code of dv_assemble_frame()
Limin Wang [Fri, 12 Jun 2020 13:06:25 +0000 (21:06 +0800)]
avformat/dvenc: return error code of dv_assemble_frame()

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavcodec/av1_parser: initialize avctx->pix_fmt
Manoj Bonda [Fri, 19 Jun 2020 07:01:22 +0000 (12:31 +0530)]
avcodec/av1_parser: initialize avctx->pix_fmt

Initialize avctx->pix_fmt in av1_parser.c
AV1 Chroma format is invalid when quering using below code if no AV1 decoder
is available:

iVideoStream = av_find_best_stream(fmtc, AVMEDIA_TYPE_VIDEO, -1, -1, NULL, 0);
eChromaFormat = (AVPixelFormat)fmtc->streams[iVideoStream]->codecpar->format;

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavcodec/av1_parser: add missing parsing for RGB pixel format signaling
James Almer [Fri, 19 Jun 2020 13:56:20 +0000 (10:56 -0300)]
avcodec/av1_parser: add missing parsing for RGB pixel format signaling

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavcodec/av1_parser: set context values outside the OBU parsing loop
James Almer [Fri, 19 Jun 2020 12:56:49 +0000 (09:56 -0300)]
avcodec/av1_parser: set context values outside the OBU parsing loop

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agofate: add yuv420p10 and yuv422p10 tests for overlay filter
Limin Wang [Fri, 5 Jun 2020 13:58:02 +0000 (21:58 +0800)]
fate: add yuv420p10 and yuv422p10 tests for overlay filter

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavfilter/vf_overlay: add yuv420p10 and yuv422p10 10bit format support
Limin Wang [Fri, 5 Jun 2020 13:58:01 +0000 (21:58 +0800)]
avfilter/vf_overlay: add yuv420p10 and yuv422p10 10bit format support

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavfilter/vf_overlay: support for 8bit and 10bit overlay with macro-based function
Limin Wang [Fri, 5 Jun 2020 13:58:00 +0000 (21:58 +0800)]
avfilter/vf_overlay: support for 8bit and 10bit overlay with macro-based function

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavcodec/libx265: Fix integer overflow in computation of max and avg bitrate
Limin Wang [Mon, 8 Jun 2020 11:51:33 +0000 (19:51 +0800)]
avcodec/libx265: Fix integer overflow in computation of max and avg bitrate

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavcodec/encode: restructure the old encode API
James Almer [Tue, 9 Jun 2020 21:35:00 +0000 (18:35 -0300)]
avcodec/encode: restructure the old encode API

Following the same logic as 061a0c14bb, this commit turns the old encode API
into a wrapper for the new one.

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavcodec/encode: restructure the core encoding code
James Almer [Tue, 9 Jun 2020 21:31:32 +0000 (18:31 -0300)]
avcodec/encode: restructure the core encoding code

This commit follows the same logic as 061a0c14bb, but for the encode API: The
new public encoding API will no longer be a wrapper around the old deprecated
one, and the internal API used by the encoders now consists of a single
receive_packet() callback that pulls frames as required.

amf encoders adapted by James Almer
librav1e encoder adapted by James Almer
nvidia encoders adapted by James Almer
MediaFoundation encoders adapted by James Almer
vaapi encoders adapted by Linjie Fu
v4l2_m2m encoders adapted by Andriy Gelman

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavformat: add MCC demuxer
Paul B Mahol [Sat, 13 Jun 2020 13:07:41 +0000 (15:07 +0200)]
avformat: add MCC demuxer

Fixes #7680

4 years agoavformat/sccdec: make splitting more robust
Paul B Mahol [Wed, 17 Jun 2020 08:24:05 +0000 (10:24 +0200)]
avformat/sccdec: make splitting more robust

4 years agolavf/dashdec: Add missed side data/disposition
Jun Zhao [Thu, 4 Jun 2020 14:00:48 +0000 (22:00 +0800)]
lavf/dashdec: Add missed side data/disposition

dash demuxer get the stream info from sub-stream, but missed side
data/disposition part, e,g, missed the DOVI side data when the
stream is Dolby Vision streams

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agolavf/hls: Add missed side data/disposition
vacingfang [Thu, 4 Jun 2020 13:59:43 +0000 (21:59 +0800)]
lavf/hls: Add missed side data/disposition

hls demuxer get the stream info from sub-stream, but missed side
data/disposition part, e,g, missed the DOVI side data when the
stream is Dolby Vision streams.

Reviewed-by <liuqi05@kuaishou.com>
Signed-off-by: vacingfang <vacingfang@tencent.com>
4 years agofftools/ffmpeg_filter: add -autoscale to disable/enable the default scale
Linjie Fu [Mon, 8 Jun 2020 08:58:05 +0000 (16:58 +0800)]
fftools/ffmpeg_filter: add -autoscale to disable/enable the default scale

Currently, ffmpeg inserts scale filter by default in the filter graph
to force the whole decoded stream to scale into the same size with the
first frame. It's not quite make sense in resolution changing cases if
user wants the rawvideo without any scale.

Using autoscale/noautoscale as an output option to indicate whether auto
inserting the scale filter in the filter graph:
    -noautoscale or -autoscale 0:
    disable the default auto scale filter inserting.

ffmpeg -y -i input.mp4 out1.yuv -noautoscale out2.yuv -autoscale 0 out3.yuv

Update docs.

Suggested-by: Mark Thompson <sw@jkqxz.net>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Signed-off-by: Linjie Fu <linjie.fu@intel.com>
4 years agoavformat/apm: check codec tag in probe and add constant
Zane van Iperen [Fri, 12 Jun 2020 11:46:15 +0000 (11:46 +0000)]
avformat/apm: check codec tag in probe and add constant

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/movenc: Write 'av01' as a compatible brand when muxing AV1
Derek Buitenhuis [Wed, 17 Jun 2020 13:43:28 +0000 (14:43 +0100)]
avformat/movenc: Write 'av01' as a compatible brand when muxing AV1

This is a requirement of the AV1-ISOBMFF spec. Section 2.1.
General Requirements & Brands states:

    * It SHALL have the av01 brand among the compatible brands array of the FileTypeBox

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
4 years agomailmap: add entry for myself
Zhong Li [Wed, 17 Jun 2020 14:11:34 +0000 (22:11 +0800)]
mailmap: add entry for myself

Signed-off-by: Zhong Li <zhongli_dev@126.com>
4 years agodnn_backend_native: check operand index
Guo Yejun [Wed, 10 Jun 2020 05:36:11 +0000 (13:36 +0800)]
dnn_backend_native: check operand index

it fixed the issue in https://trac.ffmpeg.org/ticket/8716

4 years agodnn_backend_native.c: refine code for fail case
Guo Yejun [Wed, 10 Jun 2020 02:59:19 +0000 (10:59 +0800)]
dnn_backend_native.c: refine code for fail case

4 years agoavcodec/ccaption_dec: do not modify pkt data and stop removing parity bit twice
Paul B Mahol [Tue, 16 Jun 2020 22:35:37 +0000 (00:35 +0200)]
avcodec/ccaption_dec: do not modify pkt data and stop removing parity bit twice

4 years agoavformat/sccdec: simplify demuxer a little
Paul B Mahol [Tue, 16 Jun 2020 17:13:42 +0000 (19:13 +0200)]
avformat/sccdec: simplify demuxer a little

4 years agoavcodec/ccaption_dec: remove usage of extra buffer
Paul B Mahol [Tue, 16 Jun 2020 15:08:04 +0000 (17:08 +0200)]
avcodec/ccaption_dec: remove usage of extra buffer

4 years agoavcodec/ccaption_dec: fix some small style issues
Paul B Mahol [Tue, 16 Jun 2020 09:16:03 +0000 (11:16 +0200)]
avcodec/ccaption_dec: fix some small style issues

4 years agoavcodec/ccaption_dec: remove pts parameter from handle_char()
Paul B Mahol [Mon, 15 Jun 2020 22:10:57 +0000 (00:10 +0200)]
avcodec/ccaption_dec: remove pts parameter from handle_char()

4 years agoavcodec/tiff: Check stride for dng
Michael Niedermayer [Sun, 14 Jun 2020 21:45:46 +0000 (23:45 +0200)]
avcodec/tiff: Check stride for dng

Fixes: assertion failure
Fixes: 23422/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5746026064642048
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/sccdec: unbreak previous commits to this file
Paul B Mahol [Sun, 14 Jun 2020 19:16:57 +0000 (21:16 +0200)]
avformat/sccdec: unbreak previous commits to this file

4 years agoavformat/movenc: fix remuxing eia-608 into mov from other containers
Paul B Mahol [Sun, 14 Jun 2020 16:20:14 +0000 (18:20 +0200)]
avformat/movenc: fix remuxing eia-608 into mov from other containers

4 years agoavformat/mov: fix demuxing of eia-608
Paul B Mahol [Sun, 14 Jun 2020 12:19:56 +0000 (14:19 +0200)]
avformat/mov: fix demuxing of eia-608

Fixes #4616.

4 years agoavcodec/ccaption_dec: add support for colors
Paul B Mahol [Sun, 14 Jun 2020 10:39:31 +0000 (12:39 +0200)]
avcodec/ccaption_dec: add support for colors

4 years agoavformat/mov: Fix reel_name size check
Andreas Rheinhardt [Sun, 14 Jun 2020 18:54:46 +0000 (20:54 +0200)]
avformat/mov: Fix reel_name size check

Only read str_size bytes from offset 30 of extradata if the extradata is
indeed at least 30 + str_size bytes long.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/mov: Fix memleak upon encountering repeating tags
Andreas Rheinhardt [Sun, 14 Jun 2020 07:19:38 +0000 (09:19 +0200)]
avformat/mov: Fix memleak upon encountering repeating tags

mov_read_custom tries to read three strings belonging to three different
tags. When an already encountered tag is encountered again, a new buffer
for the string to be read is allocated and stored in the pointer
destined for this particular tag. But in this scenario, said pointer
already holds the address of the string read earlier, leading to a leak.

This commit therefore aborts the reading process upon encountering
an already encountered tag.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/matroskaenc: Don't use NULL for %s format string
Andreas Rheinhardt [Sun, 14 Jun 2020 01:35:41 +0000 (03:35 +0200)]
avformat/matroskaenc: Don't use NULL for %s format string

The argument pertaining to a printf %s conversion specifier must not
be NULL, even if the precision (i.e. the number of characters to write)
is zero. If it is NULL, it is undefined behaviour.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/webvttdec: Fix memleak upon read header failure
Andreas Rheinhardt [Sun, 14 Jun 2020 01:29:17 +0000 (03:29 +0200)]
avformat/webvttdec: Fix memleak upon read header failure

The already parsed subtitles (contained in an FFDemuxSubtitlesQueue)
would leak if an error happened upon reading a subsequent subtitle.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/vplayerdec: Fix memleak upon read header failure
Andreas Rheinhardt [Sun, 14 Jun 2020 01:28:56 +0000 (03:28 +0200)]
avformat/vplayerdec: Fix memleak upon read header failure

The already parsed subtitles (contained in an FFDemuxSubtitlesQueue)
would leak if an error happened upon reading a subsequent subtitle.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/tedcaptionsdec: Fix memleak upon read header failure
Andreas Rheinhardt [Sun, 14 Jun 2020 01:27:43 +0000 (03:27 +0200)]
avformat/tedcaptionsdec: Fix memleak upon read header failure

The already parsed subtitles (contained in an FFDemuxSubtitlesQueue)
would leak if allocating the AVStream for the subtitles fails.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/subviewerdec: Fix memleak upon read header failure
Andreas Rheinhardt [Sun, 14 Jun 2020 01:27:11 +0000 (03:27 +0200)]
avformat/subviewerdec: Fix memleak upon read header failure

The already parsed subtitles (contained in an FFDemuxSubtitlesQueue)
would leak if an error happened upon reading a subsequent subtitle.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/subviewer1dec: Fix memleak upon read header failure
Andreas Rheinhardt [Sun, 14 Jun 2020 01:26:40 +0000 (03:26 +0200)]
avformat/subviewer1dec: Fix memleak upon read header failure

The already parsed subtitles (contained in an FFDemuxSubtitlesQueue)
would leak if an error happened upon reading a subsequent subtitle.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/stldec: Fix memleak upon read header failure
Andreas Rheinhardt [Sun, 14 Jun 2020 01:24:23 +0000 (03:24 +0200)]
avformat/stldec: Fix memleak upon read header failure

The already parsed subtitles (contained in an FFDemuxSubtitlesQueue)
would leak if an error happened upon reading a subsequent subtitle.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/srtdec: Fix memleak upon read header failure
Andreas Rheinhardt [Sun, 14 Jun 2020 01:23:27 +0000 (03:23 +0200)]
avformat/srtdec: Fix memleak upon read header failure

The already parsed subtitles (contained in an FFDemuxSubtitlesQueue)
would leak if an error happened upon reading a subsequent subtitle.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/sccdec: Fix memleak upon read header failure
Andreas Rheinhardt [Sun, 14 Jun 2020 01:22:32 +0000 (03:22 +0200)]
avformat/sccdec: Fix memleak upon read header failure

The already parsed subtitles (contained in an FFDemuxSubtitlesQueue)
would leak if an error happened upon reading a subsequent subtitle.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/samidec: Fix memleak upon read header failure
Andreas Rheinhardt [Sun, 14 Jun 2020 01:21:46 +0000 (03:21 +0200)]
avformat/samidec: Fix memleak upon read header failure

The already parsed subtitles (contained in an FFDemuxSubtitlesQueue)
would leak if an error happened upon reading a subsequent subtitle
or when creating extradata.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/pjsdec: Fix memleak upon read header failure
Andreas Rheinhardt [Sun, 14 Jun 2020 01:21:03 +0000 (03:21 +0200)]
avformat/pjsdec: Fix memleak upon read header failure

The already parsed subtitles (contained in an FFDemuxSubtitlesQueue)
would leak if an error happened upon reading a subsequent subtitle.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/mpsubdec: Fix memleak upon read header failure
Andreas Rheinhardt [Sun, 14 Jun 2020 01:20:09 +0000 (03:20 +0200)]
avformat/mpsubdec: Fix memleak upon read header failure

The already parsed subtitles (contained in an FFDemuxSubtitlesQueue)
would leak if an error happened upon creating an AVStream.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/mpl2dec: Fix memleak upon read header failure
Andreas Rheinhardt [Sun, 14 Jun 2020 01:19:32 +0000 (03:19 +0200)]
avformat/mpl2dec: Fix memleak upon read header failure

The already parsed subtitles (contained in an FFDemuxSubtitlesQueue)
would leak if an error happened upon reading a subsequent subtitle.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/microdvddec: Fix memleak upon read header failure
Andreas Rheinhardt [Sun, 14 Jun 2020 01:16:15 +0000 (03:16 +0200)]
avformat/microdvddec: Fix memleak upon read header failure

The already parsed subtitles (contained in an FFDemuxSubtitlesQueue)
would leak if an error happened upon reading a subsequent subtitle
or when allocating extradata.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/lrcdec: Fix memleak upon read header failure
Andreas Rheinhardt [Sun, 14 Jun 2020 01:12:00 +0000 (03:12 +0200)]
avformat/lrcdec: Fix memleak upon read header failure

The already parsed subtitles (contained in an FFDemuxSubtitlesQueue)
would leak if an error happened upon reading a subsequent subtitle.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/jacosubdec: Fix memleak upon read header failure
Andreas Rheinhardt [Sun, 14 Jun 2020 01:09:08 +0000 (03:09 +0200)]
avformat/jacosubdec: Fix memleak upon read header failure

The already parsed subtitles (contained in an FFDemuxSubtitlesQueue)
would leak if an error happened upon reading a subsequent subtitle.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/assdec: Fix memleak upon read header failure
Andreas Rheinhardt [Sun, 14 Jun 2020 01:07:28 +0000 (03:07 +0200)]
avformat/assdec: Fix memleak upon read header failure

The already parsed subtitles (contained in an FFDemuxSubtitlesQueue)
would leak if an error happened upon reading a subsequent subtitle
or if creating the extradata failed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/aqtitledec: Fix memleak upon read header failure
Andreas Rheinhardt [Sun, 14 Jun 2020 01:04:29 +0000 (03:04 +0200)]
avformat/aqtitledec: Fix memleak upon read header failure

The already parsed subtitles (contained in an FFDemuxSubtitlesQueue)
would leak if an error happened upon reading a subsequent subtitle.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/mov: Fix memleaks upon read_header failure
Andreas Rheinhardt [Sat, 13 Jun 2020 22:37:40 +0000 (00:37 +0200)]
avformat/mov: Fix memleaks upon read_header failure

By default, a demuxer's read_close function is not called automatically
if an error happens when reading the header; instead it is up to the
demuxer to clean up after itself in this case. The mov demuxer did this
by calling its read_close function when it encountered some errors when
reading the header. Yet for other errors (mostly adding side-data to
streams) this has been forgotten, so that all the internal structures
of the demuxer leak.

This commit fixes this by making sure mov_read_close is called when
necessary.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/omadec: Fix memleaks upon read_header failure
Andreas Rheinhardt [Sat, 13 Jun 2020 22:24:55 +0000 (00:24 +0200)]
avformat/omadec: Fix memleaks upon read_header failure

Fixes possible leaks of id3v2 metadata as well as an AVDES struct in
case the content is encrypted and an error happens lateron.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/matroskadec: Fix memleaks in WebM DASH manifest demuxer
Andreas Rheinhardt [Sat, 13 Jun 2020 21:58:32 +0000 (23:58 +0200)]
avformat/matroskadec: Fix memleaks in WebM DASH manifest demuxer

In certain error scenarios, the underlying Matroska demuxer was not
properly closed, causing leaks.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/matroskadec: Use right number of tracks
Andreas Rheinhardt [Fri, 30 Aug 2019 13:18:29 +0000 (15:18 +0200)]
avformat/matroskadec: Use right number of tracks

When demuxing a Matroska/WebM file, streams are added for tracks and for
attachments, so that the array containing the former can be NULL even
when the corresponding AVFormatContext has streams. So check for there
to be tracks in the MatroskaDemuxContext instead of just streams in the
AVFormatContext before dereferencing the pointer to the tracks.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/matroskadec: Fix handling gigantic durations
Andreas Rheinhardt [Tue, 3 Sep 2019 22:50:11 +0000 (00:50 +0200)]
avformat/matroskadec: Fix handling gigantic durations

matroska_parse_block currently asserts that the duration is not equal to
AV_NOPTS_VALUE, but there is nothing that actually guarantees this. It
is easy to create (spec-compliant) files which run into this assert;
so replace it and instead cap the duration to INT64_MAX, as the duration
field of an AVPacket is an int64_t.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/matroskadec: Move AVBufferRef instead of copying, fix memleak
Andreas Rheinhardt [Sat, 13 Jun 2020 20:34:19 +0000 (22:34 +0200)]
avformat/matroskadec: Move AVBufferRef instead of copying, fix memleak

EBML binary elements are already made reference-counted when read;
so when populating the AVStream.attached_pic, one does not need to
allocate a new buffer for the data; instead the current code just
creates a new reference to the underlying AVBuffer. But this can be
improved even further: Just move the already existing reference.

This also fixes a memleak that happens upon error because
matroska_read_close has not been called in this scenario.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agolavdevice: Add AudioToolbox output device.
Thilo Borgmann [Mon, 15 Jun 2020 13:09:33 +0000 (15:09 +0200)]
lavdevice: Add AudioToolbox output device.

4 years agoavformat/dashenc: Add hls_master_name option
Przemysław Sobala [Wed, 10 Jun 2020 11:14:36 +0000 (13:14 +0200)]
avformat/dashenc: Add hls_master_name option

4 years agoavformat/hlsenc: Always treat numbers as decimal
Andreas Rheinhardt [Mon, 15 Jun 2020 03:09:07 +0000 (05:09 +0200)]
avformat/hlsenc: Always treat numbers as decimal

c801ab43c36e8c4f88121aa09af26c77bcbd671b caused a regression: The stream
number is now parsed with strtoll without a fixed basis; as a
consequence, the "010" in a variant stream mapping like "a:010" is now
treated as an octal number (i.e. as eight, not ten). This was not
intended and may break some scripts, so this commit restores the old
behaviour.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavcodec/iirfilter: Fix memleak
Andreas Rheinhardt [Mon, 15 Jun 2020 01:33:13 +0000 (03:33 +0200)]
avcodec/iirfilter: Fix memleak

Commit 17e88bf0df21906633a7d36d9f2aeeeb5b6d3267 created a memleak by
removing a call to ff_iir_filter_free_coeffsp on error; this has been
found by Coverity (ID 1464159). This commit fixes the memleak by
readding the call to ff_iir_filter_free_coeffsp.

Notice that this is not a simple revert, because several macros that
were used before 17e88bf0df21906633a7d36d9f2aeeeb5b6d3267 were replaced
in commit 44863b2c2d5a31d82aafa71cdbd180d6bfbed5b4 and completely removed
in 2658680df4fc606522e5f65899afb9a98b47d287.

Reviewed-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavcodec/hevc_mp4toannexb_bsf: Check NAL size against available input
Andreas Rheinhardt [Wed, 27 May 2020 17:09:14 +0000 (19:09 +0200)]
avcodec/hevc_mp4toannexb_bsf: Check NAL size against available input

The hevc_mp4toannexb bsf does not explicitly check whether a NAL unit
is so big that it extends beyond the end of the input packet; it does so
only implicitly by using the checked version of the bytestream2 API.
But this has downsides compared to real checks: It can lead to huge
allocations (up to 2GiB) even when the input packet is just a few bytes.
And furthermore it leads to uninitialized data being output.
So add a check to error out early if it happens.

Also check directly whether there is enough data for the length field.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavcodec/h264: create user data unregistered SEI side data for H.264
Limin Wang [Thu, 11 Jun 2020 04:50:46 +0000 (12:50 +0800)]
avcodec/h264: create user data unregistered SEI side data for H.264

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>