]> git.sesse.net Git - ffmpeg/log
ffmpeg
3 years agoavcodec/adpcm_swf: set block_align when encoding
Zane van Iperen [Fri, 16 Oct 2020 03:51:58 +0000 (13:51 +1000)]
avcodec/adpcm_swf: set block_align when encoding

Allows it to be muxed to WAVs.

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
3 years agoavcodec/adpcm_swf: support decoding multiple fixed-sized blocks at once
Zane van Iperen [Fri, 16 Oct 2020 03:14:25 +0000 (13:14 +1000)]
avcodec/adpcm_swf: support decoding multiple fixed-sized blocks at once

For incoming packets from WAV.

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
3 years agoavformat/riff: prevent muxing adpcm_swf with a variable block size
Zane van Iperen [Thu, 15 Oct 2020 14:02:18 +0000 (00:02 +1000)]
avformat/riff: prevent muxing adpcm_swf with a variable block size

Prefer to error than to create a broken file. Closes ticket #5829.

Effectively disables remuxing adpcm_swf from flv -> wav.

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
3 years agoavfilter: add audio frequency and phase shift filters
Paul B Mahol [Sat, 17 Oct 2020 18:34:08 +0000 (20:34 +0200)]
avfilter: add audio frequency and phase shift filters

3 years agoavfilter/avf_aphasemeter: add out of phase and mono detection
Romane Lafon [Mon, 12 Oct 2020 17:01:17 +0000 (19:01 +0200)]
avfilter/avf_aphasemeter: add out of phase and mono detection

Extend aphasemeter to detect out of phase or mono sequences in
stereo streams.

Signed-off-by: Romane Lafon <romane@nomalab.com>
3 years agoavcodec/notchlc: Revert incorrect compression bound
Michael Niedermayer [Tue, 20 Oct 2020 15:18:11 +0000 (17:18 +0200)]
avcodec/notchlc: Revert incorrect compression bound

Revert "avcodec/notchlc: Check uncompressed size against input for LZ4"

Found-by: durandal_1707
This reverts commit 51002362c4ed301e54cea1597666cd5cc9a134f3.

3 years agoavcodec/decode/ff_get_buffer: Check for overflow in FFALIGN()
Michael Niedermayer [Tue, 13 Oct 2020 21:01:38 +0000 (23:01 +0200)]
avcodec/decode/ff_get_buffer: Check for overflow in FFALIGN()

Fixes: signed integer overflow: 2147483647 + 64 cannot be represented in type 'int'
Fixes: 26218/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CRI_fuzzer-5734075396259840
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/cri: Check for end of image in unpack_10bit()
Michael Niedermayer [Wed, 14 Oct 2020 21:21:03 +0000 (23:21 +0200)]
avcodec/cri: Check for end of image in unpack_10bit()

Fixes: out of array write
Fixes: 26242/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CRI_fuzzer-5161495882891264
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agolibavformat/utils: Fix misleading indent
Chris Miceli [Tue, 13 Oct 2020 04:59:06 +0000 (15:59 +1100)]
libavformat/utils: Fix misleading indent

6f69f7a8bf6a0d013985578df2ef42ee6b1c7994 introduced this and it was part
of a very large merging of refactoring. Current behaviour is what is
reflected by this indenting change, however my understanding of timing
is such that this correct behaviour.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/adpcm: Check channels before use for ADPCM_PSX
Michael Niedermayer [Thu, 15 Oct 2020 20:09:10 +0000 (22:09 +0200)]
avcodec/adpcm: Check channels before use for ADPCM_PSX

Fixes: division by zero
Fixes: 26293/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_PSX_fuzzer-5176665237618688
Fixes: 26331/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_PSX_fuzzer-5632330364092416
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/mobiclip: Avoid signed integer overflows in idct()
Michael Niedermayer [Fri, 16 Oct 2020 15:55:26 +0000 (17:55 +0200)]
avcodec/mobiclip: Avoid signed integer overflows in idct()

Fixes: signed integer overflow: 536870912 + 1610612736 cannot be represented in type 'int'
Fixes: 26288/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MOBICLIP_fuzzer-6194364759670784
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/exr: Check limits to avoid overflow in delta computation
Michael Niedermayer [Fri, 16 Oct 2020 16:08:37 +0000 (18:08 +0200)]
avcodec/exr: Check limits to avoid overflow in delta computation

Fixes: signed integer overflow: 553590816 - -2145378049 cannot be represented in type 'int'
Fixes: 26315/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5938755121446912
Fixes: 26340/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5644316208529408
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/boadec: Check that channels and block_align are set
Michael Niedermayer [Fri, 16 Oct 2020 17:09:37 +0000 (19:09 +0200)]
avformat/boadec: Check that channels and block_align are set

Fixes: Infinite loop
Fixes: 26381/clusterfuzz-testcase-minimized-ffmpeg_dem_BOA_fuzzer-5745789089087488
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/av1dec: Fix padding in obu_get_packet()
Michael Niedermayer [Fri, 16 Oct 2020 07:30:39 +0000 (09:30 +0200)]
avformat/av1dec: Fix padding in obu_get_packet()

Fixes: stack buffer overflow (read)
Fixes: 26369/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVIDAS_fuzzer-5721057325219840
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/notchlc: Check uncompressed size against input for LZ4
Michael Niedermayer [Tue, 13 Oct 2020 20:44:21 +0000 (22:44 +0200)]
avcodec/notchlc: Check uncompressed size against input for LZ4

Fixes: OOM
Fixes: 26168/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_NOTCHLC_fuzzer-6019839015256064
Equation is based on LZ4_COMPRESSBOUND from lz4.h
Suggested-by: Paul
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/asfdec_f: Check name_len for overflow
Michael Niedermayer [Thu, 15 Oct 2020 20:04:56 +0000 (22:04 +0200)]
avformat/asfdec_f: Check name_len for overflow

Fixes: signed integer overflow: -1172299744 * 2 cannot be represented in type 'int'
Fixes: 26258/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5672758488596480
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/h264idct_template: Fix integer overflow in ff_h264_chroma422_dc_dequant_idct()
Michael Niedermayer [Thu, 15 Oct 2020 19:35:43 +0000 (21:35 +0200)]
avcodec/h264idct_template: Fix integer overflow in ff_h264_chroma422_dc_dequant_idct()

Fixes: signed integer overflow: 241173056 + 1953511200 cannot be represented in type 'int'
Fixes: 26086/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-5068366420901888
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavfilter/af_asubboost: use transposed II form
Paul B Mahol [Tue, 20 Oct 2020 11:45:14 +0000 (13:45 +0200)]
avfilter/af_asubboost: use transposed II form

3 years agoavfilter/af_crossfeed: use transposed II form
Paul B Mahol [Tue, 20 Oct 2020 11:32:25 +0000 (13:32 +0200)]
avfilter/af_crossfeed: use transposed II form

3 years agoavformat/hlsenc: Fix check for SPS
Andreas Rheinhardt [Tue, 20 Oct 2020 11:00:04 +0000 (13:00 +0200)]
avformat/hlsenc: Fix check for SPS

Check all the six bits, not only the two bits that are set for SPS.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/hlsenc: Fix mixed declaration and code
Andreas Rheinhardt [Tue, 20 Oct 2020 10:55:22 +0000 (12:55 +0200)]
avformat/hlsenc: Fix mixed declaration and code

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/hlsenc: Don't use uninitialized buffer in av_stristr()
Andreas Rheinhardt [Tue, 20 Oct 2020 10:52:49 +0000 (12:52 +0200)]
avformat/hlsenc: Don't use uninitialized buffer in av_stristr()

Introduced in a2b1dd0ce301450a47c972745a6b33c4c273aa5d.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/hlsenc: Fix extradata length check
Andreas Rheinhardt [Tue, 20 Oct 2020 10:16:27 +0000 (12:16 +0200)]
avformat/hlsenc: Fix extradata length check

Commit a2b1dd0ce301450a47c972745a6b33c4c273aa5d added support for
parsing annex B HEVC extradata to extract profile and level information.
Yet it only checks for there to be enough data left for the startcode
and the first byte of the NAL unit header and not for the full NAL unit
header; it simply presumes the second byte of the NAL unit header to be
present and skips it. Then the remaining size of the extradata is calculated
which ends up negative if the second byte of the NAL unit header is not
present. Yet when calling ff_nal_unit_extract_rbsp() it
will be converted to an uint32_t and end up as UINT32_MAX which
will cause mayhem.

This is solved by making sure that there is always enough remaining
extradata that could (pending 0x03 escapes) contain the data that we
are interested in.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/sbgdec: Check for timestamp overflow in parse_time_sequence()
Michael Niedermayer [Mon, 19 Oct 2020 14:24:58 +0000 (16:24 +0200)]
avformat/sbgdec: Check for timestamp overflow in parse_time_sequence()

Fixes: signed integer overflow: 3458015007900000256 + 6425686373040000000 cannot be represented in type 'long'
Fixes: 26430/clusterfuzz-testcase-minimized-ffmpeg_dem_BRSTM_fuzzer-5761175004119040
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>
3 years agoavformat/hlsenc: support CODECS Attribute in hevc EXT-X-STREAM-INF
Steven Liu [Tue, 13 Oct 2020 07:05:59 +0000 (15:05 +0800)]
avformat/hlsenc: support CODECS Attribute in hevc EXT-X-STREAM-INF

fix ticket: 8904
parse the SPS from extradata and get profile_tier_level
write the profile_tier_level info into CODECS Attribute

HLS CODECS Attribute reference to :https://developer.apple.com/documentation/http_live_streaming/hls_authoring_specification_for_apple_devices/hls_authoring_specification_for_apple_devices_appendixes

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: liuqi05 <liuqi05@kuaishou.com>
3 years agoavformat/hlsenc: compute video_keyframe_size after write keyframe
Steven Liu [Fri, 18 Sep 2020 01:53:27 +0000 (09:53 +0800)]
avformat/hlsenc: compute video_keyframe_size after write keyframe

fix ticket: 8636
When write keyframe and the keyframe is the frist packet of the segment,
then compute the size of the keyframe which have been write into segment
first packet. and set the start position of the segment, should not use
avio_tell(vs->out) to get the keyframe position, because it can be set
to 0 if close at above of the workflow, that maybe inaccurate, but the
start_pos can be used here, because start_pos is set after write
the previous packet.

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: liuqi05 <liuqi05@kuaishou.com>
3 years agoavformat/dashdec: check the root url length
Steven Liu [Mon, 17 Aug 2020 12:30:18 +0000 (20:30 +0800)]
avformat/dashdec: check the root url length

if the length of the root url is 0, unnecessary process the root_url

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: liuqi05 <liuqi05@kuaishou.com>
3 years agoavformat/hlsenc: process hls_time value too small sence
Steven Liu [Tue, 18 Aug 2020 02:44:11 +0000 (10:44 +0800)]
avformat/hlsenc: process hls_time value too small sence

The target duration will be a negative value when there are
some b frames after prevous frame, the pts after current packet
is large than the pts of current packet, so the target duration
will compute as 0.040000 - 0.080000, then the value of the target
duration will be -0.040000. so hls muxer should check the pts after
current packet minus the pts of current packet, hls muxer can split
the stream as a segment if the target duration is neither negative nor
zero, hls muxer cannot split the stream as a segment if the
target duration is either negative or zero then get the next packet
until the target duration is not negative or zero.

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Suggested-by: Zhili Zhao <quinkblack@foxmail.com>
Signed-off-by: liuqi05 <liuqi05@kuaishou.com>
3 years agoavcodec/movtextenc: Cleanup generically on init failure
Andreas Rheinhardt [Sat, 17 Oct 2020 05:47:43 +0000 (07:47 +0200)]
avcodec/movtextenc: Cleanup generically on init failure

Reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/movtextenc: Remove redundant function parameters
Andreas Rheinhardt [Fri, 16 Oct 2020 03:02:34 +0000 (05:02 +0200)]
avcodec/movtextenc: Remove redundant function parameters

It makes no sense to call the functions to write styl, hlit or hclr boxes
with a different box name than "styl", "hlit" or "hclr". Therefore this
commit inlines these values in the functions, removes the function
parameter containing the box's name and removes the (non obsolete) box
names from the list of boxes.

Reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/movtextenc: Simplify writing to AVBPrint
Andreas Rheinhardt [Thu, 15 Oct 2020 13:29:13 +0000 (15:29 +0200)]
avcodec/movtextenc: Simplify writing to AVBPrint

The mov_text encoder uses an AVBPrint to assemble the subtitles;
yet mov_text subtitles are not pure text; they also have a binary
portion that was mostly handled as follows:

    uint32_t size = /* calculation */;
    size = AV_RB32(&size);
    av_bprint_append_data(bprint, (const char*)&size, 4);

Here AV_RB32() is a no-op on big-endian systems and a LE-BE swap
on little-endian systems, making the output endian-independent.

Yet this is ugly and unclean: On LE systems, the variable size from
the snippet above won't contain the correct value any more. Furthermore,
using this pattern leads to lots of small writes to the AVBPrint.

This commit therefore changes this to using a temporary buffer instead:

    uint8_t buf[4];
    AV_WB32(buf, /* size calculation */);
    av_bprint_append_data(bprint, buf, 4);

This method also allows to use bigger buffers holding more than one
element, saving calls to av_bprint_append_data() and reducing codesize.

Reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/movtextenc: Fix undefined left shifts outside the range of int
Andreas Rheinhardt [Sat, 17 Oct 2020 03:00:13 +0000 (05:00 +0200)]
avcodec/movtextenc: Fix undefined left shifts outside the range of int

Reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/movtextenc: Fix memleak on (re)allocation error
Andreas Rheinhardt [Sat, 17 Oct 2020 01:35:08 +0000 (03:35 +0200)]
avcodec/movtextenc: Fix memleak on (re)allocation error

Up until now, the mov_text encoder used the dynamic array API for its
list of style attributes; it used the (horrible) av_dynarray_add() which
works with an array of pointers; on error it frees its array but not
the buffers referenced by the pointers said array contains. It also
returns no error code, encouraging not to check for errors.

These properties imply that this function may only be used if the buffers
referenced by the list either need not be freed at all or if they are
freed by other means (i.e. if the list contains non-ownership pointers).

In this case, the style attributes are owned by the pointers of the
dynamic list. Ergo the old style attributes leak on a subsequent
reallocation failure. But given that the (re)allocation isn't checked
for success, the style attribute intended to be added to the list also
leaks because the only pointer to it gets overwritten in the belief that
it is now owned by the list.

This commit fixes this by switching to av_fast_realloc() and an array
containing the styles directly instead of pointers to individually
allocated style attributes. The current style attributes are now no longer
individually allocated, instead they are part of the context.

Furthermore, av_fast_realloc() allows to easily distinguish between
valid and allocated elements, thereby allowing to reuse the array
(which up until now has always been freed after processing an
AVSubtitleRect).

Reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/movtextenc: Don't presume every style to have a font
Andreas Rheinhardt [Fri, 16 Oct 2020 14:33:23 +0000 (16:33 +0200)]
avcodec/movtextenc: Don't presume every style to have a font

Fixes segfaults in the absence of fonts; this can happen because the
file didn't contain any or because the allocation of the font-string
failed.

Reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/movtextenc: Reset array counter after freeing array
Andreas Rheinhardt [Fri, 16 Oct 2020 11:47:56 +0000 (13:47 +0200)]
avcodec/movtextenc: Reset array counter after freeing array

Otherwise the mov_text encoder can segfault when given subtitles with more
than one AVSubtitleRect if one of the first nb_rects - 1 rects contained
a style attribute.

Reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/movtextenc: Fix potential use of uninitialized value
Andreas Rheinhardt [Thu, 15 Oct 2020 12:12:21 +0000 (14:12 +0200)]
avcodec/movtextenc: Fix potential use of uninitialized value

Background colour was never initialized if no style was available.
Use a sane default of zero (i.e. completely transparent).

Fixes Coverity issue #1461471.

Reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavfilter/af_aiir: remove unused argument
Paul B Mahol [Mon, 19 Oct 2020 16:38:43 +0000 (18:38 +0200)]
avfilter/af_aiir: remove unused argument

3 years agoavfilter/af_aiir: fix sp2zp mapping
Paul B Mahol [Mon, 19 Oct 2020 16:34:50 +0000 (18:34 +0200)]
avfilter/af_aiir: fix sp2zp mapping

3 years agotools/target_dec_fuzzer: remove calls to avcodec_register*()
James Almer [Sat, 10 Oct 2020 03:32:04 +0000 (00:32 -0300)]
tools/target_dec_fuzzer: remove calls to avcodec_register*()

They are no longer needed.

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agotools/target_dem_fuzzer: switch to the iterate API
James Almer [Sat, 10 Oct 2020 02:59:40 +0000 (23:59 -0300)]
tools/target_dem_fuzzer: switch to the iterate API

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavformat/options: use the iterate API in format_child_class_next()
James Almer [Sat, 10 Oct 2020 02:52:28 +0000 (23:52 -0300)]
avformat/options: use the iterate API in format_child_class_next()

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavdevice/alldevices: stop using deprecated linked list API
James Almer [Fri, 9 Oct 2020 14:58:37 +0000 (11:58 -0300)]
avdevice/alldevices: stop using deprecated linked list API

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agodnn_backend_tf.c: add option sess_config for tf backend
Guo, Yejun [Mon, 12 Oct 2020 07:52:26 +0000 (15:52 +0800)]
dnn_backend_tf.c: add option sess_config for tf backend

TensorFlow C library accepts config for session options to
set different parameters for the inference. This patch exports
this interface.

The config is a serialized tensorflow.ConfigProto proto, so we need
two steps to use it:
1. generate the serialized proto with python (see script example below)
the output looks like: 0xab...cd
where 0xcd is the least significant byte and 0xab is the most significant byte.

2. pass the python script output into ffmpeg with
dnn_processing=options=sess_config=0xab...cd

The following script is an example to specify one GPU. If the system contains
3 GPU cards, the visible_device_list could be '0', '1', '2', '0,1' etc.
'0' does not mean physical GPU card 0, we need to try and see.
And we can also add more opitions here to generate more serialized proto.

script example to generate serialized proto which specifies one GPU:
import tensorflow as tf
gpu_options = tf.GPUOptions(visible_device_list='0')
config = tf.ConfigProto(gpu_options=gpu_options)
s = config.SerializeToString()
b = ''.join("%02x" % int(ord(b)) for b in s[::-1])
print('0x%s' % b)

3 years agodoc: Add dev_community/community.md for general assembly and main elections process.
Thilo Borgmann [Mon, 19 Oct 2020 12:35:14 +0000 (14:35 +0200)]
doc: Add dev_community/community.md for general assembly and main elections process.

3 years agoavcodec/movtextdec: Reindentation
Andreas Rheinhardt [Sat, 17 Oct 2020 17:39:21 +0000 (19:39 +0200)]
avcodec/movtextdec: Reindentation

Reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/movtextdec: Use bytestream API
Andreas Rheinhardt [Sat, 17 Oct 2020 17:34:15 +0000 (19:34 +0200)]
avcodec/movtextdec: Use bytestream API

Improves readability.

Reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/movtextdec: Avoid loop when writing UTF-8 character to AVBPrint
Andreas Rheinhardt [Sat, 17 Oct 2020 17:26:35 +0000 (19:26 +0200)]
avcodec/movtextdec: Avoid loop when writing UTF-8 character to AVBPrint

Reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/movtextdec: Remove unnecessary variable
Andreas Rheinhardt [Sat, 17 Oct 2020 17:19:35 +0000 (19:19 +0200)]
avcodec/movtextdec: Remove unnecessary variable

style_active doesn't do anything any more: It is already assured
that style_active is one when one reaches the end of a style.

Reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/movtextdec: Fix immediately adjacent styles
Andreas Rheinhardt [Sat, 17 Oct 2020 16:42:54 +0000 (18:42 +0200)]
avcodec/movtextdec: Fix immediately adjacent styles

The checks for whether a style should be opened/closed at the current
character position are as follows: A variable entry contained the index
of the currently active or potentially next active style. If the current
character position coincided with the start of style[entry], the style
was activated; this was followed by a check whether the current
character position coincided with the end of style[entry]; if so, the
style was deactivated and entry incremented. Afterwards the char was
processed.

The order of the checks leads to problems in case the endChar of style A
coincides with the startChar of the next style (say B): Style B was never
opened. When we are at said common position, the currently active style
is A and so the start pos check does not succeed; but the end pos check
does and it closes the currently active style A and increments entry.
At the next iteration of the loop, the current character position is
bigger than the start position of style B (which is style[entry]) and
therefore the style is not activated.

The solution is of course to first check for whether a style needs to be
closed (and increment entry if it does) before checking whether the next
style needs to be opened.

Reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/movtextdec: Skip empty styles
Andreas Rheinhardt [Sat, 17 Oct 2020 15:48:54 +0000 (17:48 +0200)]
avcodec/movtextdec: Skip empty styles

They would either lead to unnecessary ASS tags being emitted (namely
tags that are reset immediately thereafter) or would lead to problems
when parsing: e.g. if a zero-length style immediately follows another
style, the current code will end the preceding style and set the
zero-length style as the next potentially active style, but it is only
tested for activation when the next character is parsed at which point
the current offset is already greater than both the starting as well
as the end offset of the empty style. It will therefore neither be
opened nor closed and all subsequent styles will be ignored.

Reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/movtextdec: Fix leaks on (re)allocation failure
Andreas Rheinhardt [Sat, 17 Oct 2020 13:18:00 +0000 (15:18 +0200)]
avcodec/movtextdec: Fix leaks on (re)allocation failure

Up until now, the 3GPP Timed Text decoder used av_dynarray_add()
for a list of style entries. Said entries are individually allocated
and owned by the pointers in the dynamic array and are therefore
unsuitable for av_dynarray_add() which simply frees the array,
but not the entries on error. In this case the intended new entry
also leaks because it has been forgotten to free it.

This commit fixes this. It is now allocated in one go and not
reallocated multiple times (and it won't be overallocated any more).
After all, the final number of elements (pending errors) is already
known in advance.

Furthermore, the style entries are now the entries of the new array,
i.e. they are no longer allocated separately. This also removes one
level of indirection.

Reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/movtextdec: Simplify finding default font
Andreas Rheinhardt [Sat, 17 Oct 2020 11:33:07 +0000 (13:33 +0200)]
avcodec/movtextdec: Simplify finding default font

There is no need to walk through the list of fonts twice.

Reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/movtextdec: Simplify checking for invalid extradata
Andreas Rheinhardt [Sat, 17 Oct 2020 11:13:23 +0000 (13:13 +0200)]
avcodec/movtextdec: Simplify checking for invalid extradata

Every font entry occupies at least three bytes, so checking early
whether there is that much data available is a low-effort way to exclude
invalid extradata. Doing so leads to an overall simplification.

Reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/movtextdec: Fix leaks of strings upon reallocation failure
Andreas Rheinhardt [Sat, 17 Oct 2020 10:32:54 +0000 (12:32 +0200)]
avcodec/movtextdec: Fix leaks of strings upon reallocation failure

Up until now, the 3GPP Timed Text decoder used av_dynarray_add()
for a list of font entries, a structure which contains an allocated
string. The font entries are owned by the pointers in the dynamic array
and are therefore unsuitable for av_dynarray_add() which simply frees
the array, but not the font entries and of course not the strings. The
latter all leak if reallocating the dynamic array fails.

This commit fixes this. It stops reallocating the array altogether:
After all, the final number of elements (pending errors) is already
known in advance.

Furthermore, the font entries are now the entries of the new array,
i.e. the font entries are no longer allocated separately. This also
removes one level of indirection.

Reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/movtextdec: Reset counter of fonts when freeing them
Andreas Rheinhardt [Sat, 17 Oct 2020 08:15:29 +0000 (10:15 +0200)]
avcodec/movtextdec: Reset counter of fonts when freeing them

If allocating fonts fails when reading the header, all fonts are freed,
yet the counter of fonts is not reset and no error is returned; when
subtitles are decoded lateron, the inexistent list of fonts is searched
for the matching font for this particular entry which of course leads to
a segfault.

Reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavfilter/af_aiir: remove unused variable
Paul B Mahol [Sun, 18 Oct 2020 20:51:55 +0000 (22:51 +0200)]
avfilter/af_aiir: remove unused variable

3 years agoavcodec/aacdec_fixed: Limit index in vector_pow43()
Michael Niedermayer [Mon, 12 Oct 2020 15:11:27 +0000 (17:11 +0200)]
avcodec/aacdec_fixed: Limit index in vector_pow43()

Fixes: out of array access
Fixes: 26087/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-5724825462767616
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/kvag: Fix integer overflow in bitrate computation
Michael Niedermayer [Sat, 10 Oct 2020 15:31:50 +0000 (17:31 +0200)]
avformat/kvag: Fix integer overflow in bitrate computation

Fixes: signed integer overflow: 1077952576 * 4 cannot be represented in type 'int'
Fixes: 26152/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5674758518341632
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/h264_slice: fix undefined integer overflow with POC in error concealment
Michael Niedermayer [Wed, 7 Oct 2020 21:22:59 +0000 (23:22 +0200)]
avcodec/h264_slice: fix undefined integer overflow with POC in error concealment

Alternatively the POC could be changed to 64bit. the large values seem to be within what is allowed.

Fixes: signed integer overflow: 2147483646 + 2 cannot be represented in type 'int'
Fixes: 26076/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-5711127201447936
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/decode: Consider discarded samples in max_samples
Michael Niedermayer [Fri, 25 Sep 2020 21:17:13 +0000 (23:17 +0200)]
avcodec/decode: Consider discarded samples in max_samples

Fixes: Timeout (several minutes -> 3 sec)
Fixes: 25246/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5943400661254144
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agotools/target_dec_fuzzer: assume that discarded audio packets produced max samples
Michael Niedermayer [Fri, 25 Sep 2020 22:14:46 +0000 (00:14 +0200)]
tools/target_dec_fuzzer: assume that discarded audio packets produced max samples

We do not know how many samples these produce as its not exported.
Alternatively we could export that but as long as its not we better
assume its more than 0 as otherwise the thresholds would not work

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agotools/target_dec_fuzzer: Correct maxsamples_per_frame if maxsamples has been changed
Michael Niedermayer [Fri, 25 Sep 2020 20:33:43 +0000 (22:33 +0200)]
tools/target_dec_fuzzer: Correct maxsamples_per_frame if maxsamples has been changed

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/mpeg12dec: Limit maximum A53 CC size
Michael Niedermayer [Mon, 21 Sep 2020 20:40:48 +0000 (22:40 +0200)]
avcodec/mpeg12dec: Limit maximum A53 CC size

This is more than 10 times the size of the largest i found. And also alot more
than our encoder could handle (our encoder is limited to max 31)
Without any limit megabyte+ sized blocks can be reallocated millions of times.
Sadly the SCTE-20 spec does not seem to contain any hard limit directly, so this limit here
is arbitrary

Fixes: Timeout (25sec -> 152ms)
Fixes: 25714/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG2VIDEO_fuzzer-5713633336885248
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/photocd: Use ff_set_dimensions()
Michael Niedermayer [Sun, 20 Sep 2020 19:29:15 +0000 (21:29 +0200)]
avcodec/photocd: Use ff_set_dimensions()

Fixes: out of memory
Fixes: 25588/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PHOTOCD_fuzzer-6612945080156160
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/ape: Remove seektable and bittable
Michael Niedermayer [Sat, 25 Jul 2020 17:21:41 +0000 (19:21 +0200)]
avformat/ape: Remove seektable and bittable

Suggested-by: Andreas
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/rmdec: sanity check coded_framesize
Michael Niedermayer [Sun, 16 Aug 2020 16:05:34 +0000 (18:05 +0200)]
avformat/rmdec: sanity check coded_framesize

Fixes: signed integer overflow: -14671840 * 8224 cannot be represented in type 'int'
Fixes: 24793/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5101884323659776
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavfilter/af_aiir: add analog transfer function format
Paul B Mahol [Sun, 18 Oct 2020 16:25:51 +0000 (18:25 +0200)]
avfilter/af_aiir: add analog transfer function format

3 years agoavfilter/af_mcompand: Remove redundant calls to AVFilter.uninit
Andreas Rheinhardt [Tue, 13 Oct 2020 01:44:37 +0000 (03:44 +0200)]
avfilter/af_mcompand: Remove redundant calls to AVFilter.uninit

uninit is already called automatically (even when configuring the filter
failed).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/asvenc: Avoid reversing output data twice
Andreas Rheinhardt [Tue, 13 Oct 2020 01:11:37 +0000 (03:11 +0200)]
avcodec/asvenc: Avoid reversing output data twice

The ASUS V2 format is designed for a little-endian bitstream reader, yet
our encoder used an ordinary big-endian bitstream writer to write it;
the bits of every byte were swapped at the end and some data (namely the
numbers not in static tables) had to be bitreversed before writing it at
all, so that it would be reversed twice.

This commit stops doing so; instead, a little-endian bitstream writer is
used. This also necessitated to switch certain static tables, which
required trivial modifications to the decoder (that uses the same
tables).

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/asvenc: Simplify flushing and padding packet
Andreas Rheinhardt [Mon, 12 Oct 2020 22:01:29 +0000 (00:01 +0200)]
avcodec/asvenc: Simplify flushing and padding packet

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/asvdec: Avoid reversing input data twice
Andreas Rheinhardt [Mon, 12 Oct 2020 10:38:59 +0000 (12:38 +0200)]
avcodec/asvdec: Avoid reversing input data twice

Up until now the ASV2 decoder used an ordinary big-endian bitreader to
read data actually destined for a little-endian bitreader; this is done
by reversing the whole input packet bitwise, using the big-endian
bigreader and reversing (and shifting) the result again. This commit
stops this and instead uses a little-endian bitreader directly.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/nvenc: update driver versions for SDK 11.0
Timo Rothenpieler [Sat, 17 Oct 2020 21:10:42 +0000 (23:10 +0200)]
avcodec/nvenc: update driver versions for SDK 11.0

3 years agoavfilter/af_aiir: use av_sscanf()
Paul B Mahol [Sat, 17 Oct 2020 16:30:27 +0000 (18:30 +0200)]
avfilter/af_aiir: use av_sscanf()

3 years agoavfilter/af_aiir: reverse order of biquads in serial processing
Paul B Mahol [Sat, 17 Oct 2020 16:23:35 +0000 (18:23 +0200)]
avfilter/af_aiir: reverse order of biquads in serial processing

This avoids most of clippings for fixed-point precision inputs.
Also add warning about filtering fixed-point precision with parallel processing.

3 years agoavformat/flvdec: Check for EOF in amf_parse_object()
Michael Niedermayer [Thu, 8 Oct 2020 18:44:23 +0000 (20:44 +0200)]
avformat/flvdec: Check for EOF in amf_parse_object()

Fixes: Timeout (too long -> 1ms)
Fixes: 26108/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5653887668977664
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/mv30: Fix multiple integer overflows
Michael Niedermayer [Sun, 4 Oct 2020 17:28:47 +0000 (19:28 +0200)]
avcodec/mv30: Fix multiple integer overflows

Fixes: signed integer overflow: -895002 * 2400 cannot be represented in type 'int'
Fixes: 26052/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MV30_fuzzer-5431812577558528
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/smacker: Check remaining bits in SMK_BLK_FULL
Michael Niedermayer [Fri, 2 Oct 2020 08:54:31 +0000 (10:54 +0200)]
avcodec/smacker: Check remaining bits in SMK_BLK_FULL

Fixes: out of array access
Fixes: 26047/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SMACKER_fuzzer-5083031667474432
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/cook: Check subpacket index against max
Michael Niedermayer [Sun, 27 Sep 2020 18:23:10 +0000 (20:23 +0200)]
avcodec/cook: Check subpacket index against max

Fixes: off by 1 error
Fixes: index 5 out of bounds for type 'COOKSubpacket [5]'
Fixes: 25772/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_COOK_fuzzer-5762459498184704.fuzz
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/utils: Check for overflow with ATRAC* in get_audio_frame_duration()
Michael Niedermayer [Fri, 16 Oct 2020 11:30:29 +0000 (13:30 +0200)]
avcodec/utils: Check for overflow with ATRAC* in get_audio_frame_duration()

Fixes: signed integer overflow: 1024 * 13129048 cannot be represented in type 'int'
Fixes: 26378/clusterfuzz-testcase-minimized-ffmpeg_dem_CODEC2RAW_fuzzer-5634018353348608
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/hevcpred_template: Fix diagonal chroma availability in 4:2:2 edge case in...
Michael Niedermayer [Fri, 16 Oct 2020 11:30:28 +0000 (13:30 +0200)]
avcodec/hevcpred_template: Fix diagonal chroma availability in 4:2:2 edge case in intra_pred

Fixes: pixel decode issue.ts
Fixes: raw frame.hevc
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/hevc_mvs: Cleanup ff_hevc_set_neighbour_available()
Michael Niedermayer [Fri, 16 Oct 2020 11:30:27 +0000 (13:30 +0200)]
avcodec/hevc_mvs: Cleanup ff_hevc_set_neighbour_available()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/icodec: Change order of operations to avoid NULL dereference
Michael Niedermayer [Fri, 16 Oct 2020 17:05:23 +0000 (19:05 +0200)]
avformat/icodec: Change order of operations to avoid NULL dereference

Fixes: SEGV on unknown address 0x000000000000
Fixes: 26379/clusterfuzz-testcase-minimized-ffmpeg_dem_ICO_fuzzer-5709011753893888
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoffmpeg: deduplicate init_output_stream usage logic
Jan Ekström [Thu, 10 Sep 2020 21:13:27 +0000 (00:13 +0300)]
ffmpeg: deduplicate init_output_stream usage logic

Adds a wrapper function, which handles any errors depending on how
fatal a failure would be.

3 years agoavcodec/adpcmenc: remove BLKSIZE #define
Zane van Iperen [Wed, 14 Oct 2020 12:56:49 +0000 (22:56 +1000)]
avcodec/adpcmenc: remove BLKSIZE #define

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
3 years agoavcodec/adpcm_ima_wav: support custom block size for encoding
Zane van Iperen [Wed, 14 Oct 2020 12:43:34 +0000 (22:43 +1000)]
avcodec/adpcm_ima_wav: support custom block size for encoding

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
3 years agoavcodec/adpcm_yamaha: support custom block size for encoding
Zane van Iperen [Wed, 14 Oct 2020 12:43:03 +0000 (22:43 +1000)]
avcodec/adpcm_yamaha: support custom block size for encoding

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
3 years agoavcodec/adpcm_ima_apm: support custom block size for encoding
Zane van Iperen [Wed, 14 Oct 2020 12:42:11 +0000 (22:42 +1000)]
avcodec/adpcm_ima_apm: support custom block size for encoding

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
3 years agoavcodec/adpcm_ima_ssi: support custom block size for encoding
Zane van Iperen [Wed, 14 Oct 2020 12:41:43 +0000 (22:41 +1000)]
avcodec/adpcm_ima_ssi: support custom block size for encoding

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
3 years agoavcodec/adpcm_ms: support custom block size for encoding
Zane van Iperen [Wed, 14 Oct 2020 12:21:30 +0000 (22:21 +1000)]
avcodec/adpcm_ms: support custom block size for encoding

Fixes tickets #6585 and #7109

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
3 years agoavcodec/adpcmenc: add "block_size" option
Zane van Iperen [Wed, 14 Oct 2020 12:16:53 +0000 (22:16 +1000)]
avcodec/adpcmenc: add "block_size" option

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
3 years agoavformat/mpegts: replace magic descriptor_tag values with defines
Brad Hards [Sat, 10 Oct 2020 06:04:30 +0000 (17:04 +1100)]
avformat/mpegts: replace magic descriptor_tag values with defines

This takes the used values from ISO/IEC 13818-1 Table 2-45 and adds
them to the mpegts.h header. No functional changes.

Signed-off-by: Brad Hards <bradh@frogmouth.net>
Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoavformat/udp: remove redundant setting of h->max_packet_size
Zhao Zhili [Wed, 23 Sep 2020 16:15:16 +0000 (00:15 +0800)]
avformat/udp: remove redundant setting of h->max_packet_size

h->max_packet_size is being reset in the following code.

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoRevert "aviobuf: Discard old buffered, previously read data in ffio_read_partial"
Marton Balint [Thu, 8 Oct 2020 22:18:07 +0000 (00:18 +0200)]
Revert "aviobuf: Discard old buffered, previously read data in ffio_read_partial"

This is unneeded after 2ca48e466675a8a3630061cd2c15325eab8eda97 and it breaks
ffio_ensure_seekback().

This reverts commit 53c25ee0736497b46bb76064cc2c84c976b2d295.

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoavformat/libsrt: fix cleanups on failed libsrt_open() and libsrt_setup()
Marton Balint [Fri, 9 Oct 2020 19:37:07 +0000 (21:37 +0200)]
avformat/libsrt: fix cleanups on failed libsrt_open() and libsrt_setup()

- Call srt_epoll_release() to avoid fd leak on libsrt_setup() error.
- Call srt_cleanup() on libsrt_open() failure.
- Fix return value and method on mode parsing failure.

Based on a patch by Nicolas Sugino <nsugino@3way.com.ar>.

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoavfilter/af_aiir: use transposed II form for biquad sections
Paul B Mahol [Fri, 16 Oct 2020 20:51:16 +0000 (22:51 +0200)]
avfilter/af_aiir: use transposed II form for biquad sections

3 years agoavfilter/af_aiir: implement parallel processing
Paul B Mahol [Thu, 15 Oct 2020 15:29:04 +0000 (17:29 +0200)]
avfilter/af_aiir: implement parallel processing

3 years agoavcodec/av1dec: add cur_frame.spatial_id and temporal_id to AV1Frame
James Almer [Fri, 16 Oct 2020 16:34:31 +0000 (13:34 -0300)]
avcodec/av1dec: add cur_frame.spatial_id and temporal_id to AV1Frame

Will be used by hwaccels, which have access to a frame's AV1RawFrameHeader but not
its AV1RawOBUHeader.

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agotools/target_dem_fuzzer: Set format independent of c
Michael Niedermayer [Fri, 16 Oct 2020 09:36:26 +0000 (11:36 +0200)]
tools/target_dem_fuzzer: Set format independent of c

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/movtextenc: cosmetics
Andriy Gelman [Wed, 14 Oct 2020 21:27:16 +0000 (17:27 -0400)]
avcodec/movtextenc: cosmetics

Change pointer position.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
3 years agoavcodec/movtextenc: fix writing to bytestream on BE arches
Andriy Gelman [Wed, 14 Oct 2020 04:38:22 +0000 (00:38 -0400)]
avcodec/movtextenc: fix writing to bytestream on BE arches

Fixes fate-binsub-movtextenc on PPC64

Currently tags are written in reverse order on BE arches. This is fixed
by using MKBETAG() and AV_RB32() to be arch agnostics.

Also s->font_count is of type int. On BE arches with 32bit int,
count = AV_RB16(&s->font_count) will read two most significant bytes
instead of the least significant bytes. This is fixed by assigning
s->font_count to count first.

The final change is modifying the type of len. On BE arches
the most significant byte of the int was written instead of the least
significant byte.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>