]> git.sesse.net Git - ffmpeg/log
ffmpeg
3 years agoavformat/mxf: add platform local tag
Limin Wang [Mon, 1 Feb 2021 23:17:44 +0000 (07:17 +0800)]
avformat/mxf: add platform local tag

Please check the string of platform with below command:
./ffmpeg -i ../fate-suite/mxf/Sony-00001.mxf -c:v copy -c:a copy out.mxf
./ffmpeg -i out.mxf
....
application_platform: Lavf (linux)

Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
3 years agoavformat/mxfdec: set toolkit version metadata
Limin Wang [Mon, 1 Feb 2021 22:40:03 +0000 (06:40 +0800)]
avformat/mxfdec: set toolkit version metadata

Please check the string of toolkit version with below command:
./ffmpeg -i ../fate-suite/mxf/Sony-00001.mxf -c:v copy -c:a copy out.mxf
./ffmpeg -i out.mxf
....
toolkit_version : 58.65.101.0.0

Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
3 years agoavformat/cdxl: improve frame rate guessing for standard cdxl
Paul B Mahol [Thu, 4 Feb 2021 23:35:18 +0000 (00:35 +0100)]
avformat/cdxl: improve frame rate guessing for standard cdxl

Use audio size and sample rate to get real frame rate.
Also make seeking more robust.

3 years agoavfilter/af_arnndn: add support for commands
Paul B Mahol [Thu, 4 Feb 2021 21:47:26 +0000 (22:47 +0100)]
avfilter/af_arnndn: add support for commands

3 years agotools/target_dec_fuzzer: Adjust threshold for interplayacm
Michael Niedermayer [Sun, 22 Nov 2020 22:58:16 +0000 (23:58 +0100)]
tools/target_dec_fuzzer: Adjust threshold for interplayacm

Fixes: Timeout (long -> 1sec)
Fixes: 27439/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INTERPLAY_ACM_fuzzer-5145715814432768
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/4xm: Make audio_frame_count 64bit
Michael Niedermayer [Sun, 22 Nov 2020 19:41:56 +0000 (20:41 +0100)]
avformat/4xm: Make audio_frame_count 64bit

Fixes: signed integer overflow: 2099257366 * 2 cannot be represented in type 'int'
Fixes: 27486/clusterfuzz-testcase-minimized-ffmpeg_dem_FOURXM_fuzzer-5112179134824448
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/mov: Use av_mul_q() to avoid integer overflows
Michael Niedermayer [Sun, 22 Nov 2020 18:13:01 +0000 (19:13 +0100)]
avformat/mov: Use av_mul_q() to avoid integer overflows

Fixes: signed integer overflow: 538976288 * 538976288 cannot be represented in type 'int'
Fixes: 27473/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5758978289827840
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/vp9dsp_template: Fix integer overflows in itxfm_wrapper
Michael Niedermayer [Sun, 22 Nov 2020 16:55:12 +0000 (17:55 +0100)]
avcodec/vp9dsp_template: Fix integer overflows in itxfm_wrapper

Fixes: signed integer overflow: 2147483641 + 32 cannot be represented in type 'int'
Fixes: 27452/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VP9_fuzzer-5078752576667648
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/vf_blend: add support for commands
Paul B Mahol [Thu, 4 Feb 2021 20:42:38 +0000 (21:42 +0100)]
avfilter/vf_blend: add support for commands

3 years agoavcodec/utils: unbreak BINKAUDIO_DCT duration calculation
Paul B Mahol [Wed, 3 Feb 2021 00:37:21 +0000 (01:37 +0100)]
avcodec/utils: unbreak BINKAUDIO_DCT duration calculation

3 years agoavfilter/af_amix: add sum option
Paul B Mahol [Wed, 3 Feb 2021 19:39:35 +0000 (20:39 +0100)]
avfilter/af_amix: add sum option

3 years agoavformat: add binka demuxer
Paul B Mahol [Tue, 2 Feb 2021 19:19:22 +0000 (20:19 +0100)]
avformat: add binka demuxer

3 years agoavformat/rmdec: Reorder operations to avoid overflow
Michael Niedermayer [Wed, 2 Dec 2020 23:54:46 +0000 (00:54 +0100)]
avformat/rmdec: Reorder operations to avoid overflow

Fixes: signed integer overflow: -2147483648 - 14 cannot be represented in type 'int'
Fixes: 27659/clusterfuzz-testcase-minimized-ffmpeg_dem_RM_fuzzer-5697250168406016
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/mxpegdec: fix SOF counting
Michael Niedermayer [Wed, 2 Dec 2020 23:31:07 +0000 (00:31 +0100)]
avcodec/mxpegdec: fix SOF counting

Fixes: Timeout (>10sec -> 15ms)
Fixes: 27652/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MXPEG_fuzzer-5125920868007936
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/rscc: Check inflated_buf size whan it is used
Michael Niedermayer [Sat, 21 Nov 2020 23:31:47 +0000 (00:31 +0100)]
avcodec/rscc: Check inflated_buf size whan it is used

Fixes: out of array access
Fixes: 27434/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RSCC_fuzzer-5196757675540480
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
3 years agoavformat/mvdec: Sanity check SAMPLE_WIDTH
Michael Niedermayer [Tue, 2 Feb 2021 19:47:10 +0000 (20:47 +0100)]
avformat/mvdec: Sanity check SAMPLE_WIDTH

Fixes: signed integer overflow: 999999999 * 8 cannot be represented in type 'int'
Fixes: 30048/clusterfuzz-testcase-minimized-ffmpeg_dem_MV_fuzzer-5864289917337600
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/cabac_functions, x86/cabac: Include stddef.h
Andreas Rheinhardt [Wed, 3 Feb 2021 21:47:41 +0000 (22:47 +0100)]
avcodec/cabac_functions, x86/cabac: Include stddef.h

Fixes checkheaders after 8c01eb0a315fec8f09ba6210ce8b0296de6cc784.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/dashdec: Avoid segfault when URL template is unexpectedly missing
sfan5 [Thu, 4 Feb 2021 01:33:17 +0000 (09:33 +0800)]
avformat/dashdec: Avoid segfault when URL template is unexpectedly missing

This isn't supposed to happen, but unfinished support for non-templated
manifests and lack of e.g. presentationTimeOffset handling can provoke
such a situation even with well-formed input.

3 years agoavformat/dashdec: Fix missing NULL check
sfan5 [Thu, 4 Feb 2021 01:28:53 +0000 (09:28 +0800)]
avformat/dashdec: Fix missing NULL check

3 years agoavformat/dashdec: rename variable name for more readable
Steven Liu [Mon, 18 Jan 2021 06:22:08 +0000 (14:22 +0800)]
avformat/dashdec: rename variable name for more readable

Rename is_init_section_common_audio to is_init_section_common_subtitle
for is_common_init_section_exist(c->subtitles, c->n_subtitles).
Because it is checked to subtitles, not audio.

Signed-off-by: liuqi05 <liuqi05@kuaishou.com>
3 years agoavformat/dashdec: check init_section before use it.
Steven Liu [Mon, 18 Jan 2021 06:22:07 +0000 (14:22 +0800)]
avformat/dashdec: check init_section before use it.

because there have no Initialization in SegmentTemplate,
so it will have no init_section for init segment file.
but in the is_common_init_section_exist function it will be used for
check to url, url_offset and size, so check init_section
before use init_section.
And fix code style in is_common_init_section_exist,
make the code block short when it too long.

fix ticket: 9062

Signed-off-by: liuqi05 <liuqi05@kuaishou.com>
3 years agoavformat/cdxl: rework probe and fix sample rate and frame rate
Paul B Mahol [Wed, 3 Feb 2021 22:06:51 +0000 (23:06 +0100)]
avformat/cdxl: rework probe and fix sample rate and frame rate

3 years agoavformat/qtpalette: Use better headers
Andreas Rheinhardt [Fri, 29 Jan 2021 18:20:38 +0000 (19:20 +0100)]
avformat/qtpalette: Use better headers

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/rtsp: Fix build failure when RTP demuxers are disabled
Andreas Rheinhardt [Fri, 29 Jan 2021 17:53:43 +0000 (18:53 +0100)]
avformat/rtsp: Fix build failure when RTP demuxers are disabled

rtsp.c uses a check of the form "if (CONFIG_RTSP_DEMUXER && ...) {}"
with the intent to make the code compilable even though the part guarded
by this check contains calls to functions that don't exist when the RTSP
demuxer is disabled. Yet even then compilers still need a declaration of
all the functions in the dead code block and error out if not (due to
our usage of -Werror=implicit-function-declaration) and no such
declaration exists for a static function in rtsp.c. Simply adding a
declaration leads to a "used but never defined" warning, therefore this
commit resorts to an #if.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/Makefile: Only compile qtpalette.c when needed
Andreas Rheinhardt [Fri, 29 Jan 2021 17:36:07 +0000 (18:36 +0100)]
avformat/Makefile: Only compile qtpalette.c when needed

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/qtpalette: Move default palette to their only user
Andreas Rheinhardt [Fri, 29 Jan 2021 17:26:41 +0000 (18:26 +0100)]
avformat/qtpalette: Move default palette to their only user

Namely qtpalette.c itself.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/cutils, dvenc: Move ff_brktimegm to its only user
Andreas Rheinhardt [Fri, 29 Jan 2021 17:02:51 +0000 (18:02 +0100)]
avformat/cutils, dvenc: Move ff_brktimegm to its only user

This also allows to completely remove cutils.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/cdxl: add support for custom 24bit pal8 formats
Paul B Mahol [Wed, 3 Feb 2021 17:35:59 +0000 (18:35 +0100)]
avformat/cdxl: add support for custom 24bit pal8 formats

Also stop discarding half of audio samples and use planar pcm s8.

3 years agoavformat/mxfdec: Add missing const to mxf_mastering_display*
Tomas Härdin [Wed, 3 Feb 2021 15:00:23 +0000 (16:00 +0100)]
avformat/mxfdec: Add missing const to mxf_mastering_display*

3 years agoavcodec/xbmdec: get_nibble() minor speed increase, and binary reduction
Jose Da Silva [Mon, 1 Feb 2021 03:51:10 +0000 (19:51 -0800)]
avcodec/xbmdec: get_nibble() minor speed increase, and binary reduction

Replace av_isxdigit(*ptr) and convert(*ptr) with get_nibble(*ptr) which
returns a valid nibble=={0x00..0x0f} or false==255 for all other values.
This way we only need to work with *ptr once instead of twice.

Removing inline av_isxdigit(x) functions also shrinks executable size.

Signed-off-by: Joe Da Silva <digital@joescat.com>
3 years agoavcodec/xbmdec: convert() minor speed increase
Jose Da Silva [Mon, 1 Feb 2021 03:51:04 +0000 (19:51 -0800)]
avcodec/xbmdec: convert() minor speed increase

If we test for {0..9} first, we have tested for 10/16th of all possible
characters first and avoid testing the remaining 6/16th of all possible
characters, which can be either 6/16th lowercase or 6/16th uppercase.

Signed-off-by: Joe Da Silva <digital@joescat.com>
3 years agoavcodec/xbmenc: Pre-compute variables once for parse_str_int()
Jose Da Silva [Mon, 1 Feb 2021 03:50:57 +0000 (19:50 -0800)]
avcodec/xbmenc: Pre-compute variables once for parse_str_int()

Some compilers are very intuitive, and others are not so much, so let's
pre-compute the variables e and keylen outside the for loop. Ensuring a
minor speed increase regardless of if compiler is smart enough to solve
this improvement for itself, or not.

Signed-off-by: Joe Da Silva <digital@joescat.com>
3 years agoavcodec/xbmenc: substitute end instead of recalculating end
Jose Da Silva [Mon, 1 Feb 2021 03:50:49 +0000 (19:50 -0800)]
avcodec/xbmenc: substitute end instead of recalculating end

Minor speed increase, end is calculated before entering parse_str_int(),
so let's take advantage of the value and avoid recalculating twice more.
This also allows parse_str_int() to work with file size larger than int.

Signed-off-by: Joe Da Silva <digital@joescat.com>
3 years agoavfilter/avfilter: mark enable as runtime option too
Paul B Mahol [Tue, 2 Feb 2021 11:50:38 +0000 (12:50 +0100)]
avfilter/avfilter: mark enable as runtime option too

3 years agoavfilter: add colorcorrect filter
Paul B Mahol [Mon, 1 Feb 2021 13:02:06 +0000 (14:02 +0100)]
avfilter: add colorcorrect filter

3 years agoav_dump_format(): reduce indentation for streams
Anton Khirnov [Wed, 27 Jan 2021 16:49:40 +0000 (17:49 +0100)]
av_dump_format(): reduce indentation for streams

Makes it easier to identify where metadata/chapters end and streams
begin.

3 years agoav_dump_format(): increase indentation for chapter metadata
Anton Khirnov [Wed, 27 Jan 2021 16:40:25 +0000 (17:40 +0100)]
av_dump_format(): increase indentation for chapter metadata

It should be at a deeper level than the chapter it belongs to.

3 years agoav_dump_format: add a heading for chapters
Anton Khirnov [Wed, 27 Jan 2021 16:39:26 +0000 (17:39 +0100)]
av_dump_format: add a heading for chapters

Otherwise the chapters look like a part of the metadata section.

3 years agofftools/ffmpeg_filter: Make functions only used locally static
Andreas Rheinhardt [Fri, 29 Jan 2021 03:39:54 +0000 (04:39 +0100)]
fftools/ffmpeg_filter: Make functions only used locally static

Also remove some declarations of inexistent functions while at it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agofftools/ffmpeg_filter: Remove ist_in_filtergraph
Andreas Rheinhardt [Fri, 29 Jan 2021 03:28:20 +0000 (04:28 +0100)]
fftools/ffmpeg_filter: Remove ist_in_filtergraph

Unused since af1761f7b5b1b72197dc40934953b775c2d951cc.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/cabac: Move encoder related stuff to libavcodec/tests/cabac.c
Andreas Rheinhardt [Fri, 29 Jan 2021 02:44:34 +0000 (03:44 +0100)]
avcodec/cabac: Move encoder related stuff to libavcodec/tests/cabac.c

(This is actually the second time the encoder stuff is removed;
the first was in 8b4119187b62d6932e07aded11d33d3b24e1b42f.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/h264_levels, h265_profile_level: Remove ff_h26[45]_get_level
Andreas Rheinhardt [Fri, 29 Jan 2021 02:08:54 +0000 (03:08 +0100)]
avcodec/h264_levels, h265_profile_level: Remove ff_h26[45]_get_level

Unused.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavfilter/ebur128: Remove unused functions
Andreas Rheinhardt [Fri, 29 Jan 2021 02:04:24 +0000 (03:04 +0100)]
avfilter/ebur128: Remove unused functions

Also make a function only used here static.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agofftools/ffmpeg_filter: Remove choose_sample_fmt
Andreas Rheinhardt [Fri, 29 Jan 2021 01:26:15 +0000 (02:26 +0100)]
fftools/ffmpeg_filter: Remove choose_sample_fmt

Unused since 6b35a83214f1bc3fb38c9ea9c2cd3676f28709fa.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/rtmppkt: Only compile ff_rtmp_packet_dump if defined(DEBUG)
Andreas Rheinhardt [Fri, 29 Jan 2021 01:11:11 +0000 (02:11 +0100)]
avformat/rtmppkt: Only compile ff_rtmp_packet_dump if defined(DEBUG)

It is only used in this case.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/avio: Remove ffurl_open
Andreas Rheinhardt [Fri, 29 Jan 2021 01:06:50 +0000 (02:06 +0100)]
avformat/avio: Remove ffurl_open

It is only used in commented-out (and nonworking) code in async.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/rtmpproto: Only include RTMP protocols that are enabled
Andreas Rheinhardt [Fri, 29 Jan 2021 00:53:04 +0000 (01:53 +0100)]
avformat/rtmpproto: Only include RTMP protocols that are enabled

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/rtmppkt: Remove ff_amf_read_bool
Andreas Rheinhardt [Thu, 28 Jan 2021 23:17:17 +0000 (00:17 +0100)]
avformat/rtmppkt: Remove ff_amf_read_bool

Added in 50468f93e3940ba78836dfdac5165c20ae75327a, but never used.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agovc2enc: Add missing static to local variables
Mark Thompson [Mon, 25 Jan 2021 22:07:01 +0000 (22:07 +0000)]
vc2enc: Add missing static to local variables

3 years agoavfilter/vf_colorlevels: call execute once per frame
Paul B Mahol [Tue, 2 Feb 2021 15:44:29 +0000 (16:44 +0100)]
avfilter/vf_colorlevels: call execute once per frame

3 years agoavfilter/vf_colorlevels: no need to use double for coeff
Paul B Mahol [Tue, 2 Feb 2021 15:14:48 +0000 (16:14 +0100)]
avfilter/vf_colorlevels: no need to use double for coeff

3 years agoavfilter/vf_colorlevels: beautify define
Paul B Mahol [Tue, 2 Feb 2021 15:12:34 +0000 (16:12 +0100)]
avfilter/vf_colorlevels: beautify define

3 years agoavfilter/vf_colorlevels: typedef ThreadData struct
Paul B Mahol [Tue, 2 Feb 2021 15:08:18 +0000 (16:08 +0100)]
avfilter/vf_colorlevels: typedef ThreadData struct

3 years agoavcodec: add PFM image encoder
Paul B Mahol [Sun, 31 Jan 2021 20:44:51 +0000 (21:44 +0100)]
avcodec: add PFM image encoder

3 years agoavfilter: add colorcontrast filter
Paul B Mahol [Sun, 31 Jan 2021 13:32:20 +0000 (14:32 +0100)]
avfilter: add colorcontrast filter

3 years agoavformat/hlsenc: use AV_OPT_TYPE_DURATION
Limin Wang [Sun, 17 Jan 2021 01:07:28 +0000 (09:07 +0800)]
avformat/hlsenc: use AV_OPT_TYPE_DURATION

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
3 years agoavformat/rmdec: Fix codecdata_length overflow check
Michael Niedermayer [Fri, 18 Dec 2020 22:13:58 +0000 (23:13 +0100)]
avformat/rmdec: Fix codecdata_length overflow check

Fixes: signed integer overflow: 2147483647 + 64 cannot be represented in type 'int'
Fixes: 28509/clusterfuzz-testcase-minimized-ffmpeg_dem_IVR_fuzzer-6310969680723968
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/simple_idct: Fix undefined integer overflow in idct4row()
Michael Niedermayer [Thu, 17 Dec 2020 23:31:08 +0000 (00:31 +0100)]
avcodec/simple_idct: Fix undefined integer overflow in idct4row()

Fixes: signed integer overflow: -1498310196 - 902891776 cannot be represented in type 'int'
Fixes: 28445/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-5075163389493248
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/wavdec: Check block_align vs. channels before combining them
Michael Niedermayer [Sun, 17 Jan 2021 22:16:46 +0000 (23:16 +0100)]
avformat/wavdec: Check block_align vs. channels before combining them

Fixes: signed integer overflow: 65535 * 65312 cannot be represented in type 'int'
Fixes: 26910/clusterfuzz-testcase-minimized-ffmpeg_dem_WAV_fuzzer-6606935226974208
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/tta: Use 64bit intermediate for index
Michael Niedermayer [Sun, 17 Jan 2021 21:57:28 +0000 (22:57 +0100)]
avformat/tta: Use 64bit intermediate for index

Fixes: signed integer overflow: 42032 * 51092 cannot be represented in type 'int'
Fixes: 26910/clusterfuzz-testcase-minimized-ffmpeg_dem_TTA_fuzzer-6679539648430080
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/soxdec: Check channels to be positive
Michael Niedermayer [Sun, 17 Jan 2021 21:52:59 +0000 (22:52 +0100)]
avformat/soxdec: Check channels to be positive

Fixes: signed integer overflow: 32 * -1795162112 cannot be represented in type 'int'
Fixes: 26910/clusterfuzz-testcase-minimized-ffmpeg_dem_SOX_fuzzer-6724151473340416
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/smacker: Check for too small pts_inc
Michael Niedermayer [Sun, 17 Jan 2021 21:14:03 +0000 (22:14 +0100)]
avformat/smacker: Check for too small pts_inc

Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
Fixes: 26910/clusterfuzz-testcase-minimized-ffmpeg_dem_SMACKER_fuzzer-6705429132476416
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/sccdec: Use larger intermediate for ts/next_ts computation
Michael Niedermayer [Sun, 17 Jan 2021 21:10:02 +0000 (22:10 +0100)]
avformat/sccdec: Use larger intermediate for ts/next_ts computation

Fixes: signed integer overflow: 92237203 * 33 cannot be represented in type 'int'
Fixes: 26910/clusterfuzz-testcase-minimized-ffmpeg_dem_SCC_fuzzer-6603769487949824
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: Use ff_set_dimensions()
Michael Niedermayer [Mon, 1 Feb 2021 19:18:14 +0000 (20:18 +0100)]
avcodec/cri: Use ff_set_dimensions()

Fixes: out of memory
Fixes: 29985/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CRI_fuzzer-6424425392111616
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/aacps_fixed_tablegen: Don't include config.h
Andreas Rheinhardt [Thu, 28 Jan 2021 15:19:23 +0000 (16:19 +0100)]
avcodec/aacps_fixed_tablegen: Don't include config.h

It is only valid for the target, not the host and therefore it must not
be included when building the tables when hardcoded tables are enabled.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/mxf: Establish register of local tags
Tomas Härdin [Wed, 27 Jan 2021 13:08:55 +0000 (14:08 +0100)]
avformat/mxf: Establish register of local tags

Tags can be marked "not used" upfront, saving some space in the primer.
av_asserts0() is used to enforce that only tags that are in the primer can actually be written.
Sharing of MasteringDisplay ULs is now done via macros.

3 years agoavformat/sbgdec: Use av_sat_add64() in str_to_time()
Michael Niedermayer [Sun, 31 Jan 2021 19:55:53 +0000 (20:55 +0100)]
avformat/sbgdec: Use av_sat_add64() in str_to_time()

Fixes: signed integer overflow: 7279992792120000000 + 4611686018427387904 cannot be represented in type 'long long'
Fixes: 29744/clusterfuzz-testcase-minimized-ffmpeg_dem_SBG_fuzzer-6434060249464832
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 agoavcodec/aac_ac3_parser: fix channel information parsing in case decoder is disabled
Piotr Uracz [Mon, 25 Jan 2021 11:04:36 +0000 (12:04 +0100)]
avcodec/aac_ac3_parser: fix channel information parsing in case decoder is disabled

Fixes #7372

3 years agoavformat/rtpdec: Avoid allocations of small dynamic buffers
Andreas Rheinhardt [Wed, 27 Jan 2021 14:57:19 +0000 (15:57 +0100)]
avformat/rtpdec: Avoid allocations of small dynamic buffers

Besides avoiding allocations this also fixes a design defect of
ff_rtp_send_punch_packets: It did not return an error in case of
these allocations failed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavfilter/vf_vibrance: add packed formats support
Paul B Mahol [Sun, 31 Jan 2021 19:52:22 +0000 (20:52 +0100)]
avfilter/vf_vibrance: add packed formats support

3 years agoavfilter/vf_colortemperature: add packed formats support
Paul B Mahol [Sun, 31 Jan 2021 19:39:45 +0000 (20:39 +0100)]
avfilter/vf_colortemperature: add packed formats support

3 years agoavfilter/vf_colortemperature: use macro for identical code
Paul B Mahol [Sun, 31 Jan 2021 19:24:04 +0000 (20:24 +0100)]
avfilter/vf_colortemperature: use macro for identical code

3 years agoavcodec/cscd: Check output len in zlib as in lzo
Michael Niedermayer [Wed, 11 Nov 2020 22:17:50 +0000 (23:17 +0100)]
avcodec/cscd: Check output len in zlib as in lzo

Fixes: Timeout (>10sec -> 134ms)
Fixes: 27245/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CSCD_fuzzer-575318210772992
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/vp3: Check input amount in theora_decode_header()
Michael Niedermayer [Fri, 29 Jan 2021 23:46:26 +0000 (00:46 +0100)]
avcodec/vp3: Check input amount in theora_decode_header()

Fixes: Timeout
Fixes: 29226/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_THEORA_fuzzer-6195092572471296
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/wavdec: Check avio_get_str16le() for failure
Michael Niedermayer [Fri, 29 Jan 2021 22:58:04 +0000 (23:58 +0100)]
avformat/wavdec: Check avio_get_str16le() for failure

Fixes: out of array access
Fixes: 29195/clusterfuzz-testcase-minimized-ffmpeg_dem_W64_fuzzer-5037853281222656
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/pnm: disable check for PFM as it is not needed
Paul B Mahol [Sun, 31 Jan 2021 13:04:51 +0000 (14:04 +0100)]
avcodec/pnm: disable check for PFM as it is not needed

3 years agoffmpeg: remove dead code for -vol
Gyan Doshi [Sun, 31 Jan 2021 04:51:54 +0000 (10:21 +0530)]
ffmpeg: remove dead code for -vol

It is applied via configure_input_audio_filter()

3 years agodoc/ffmpeg: document apad option
Gyan Doshi [Sun, 31 Jan 2021 04:32:18 +0000 (10:02 +0530)]
doc/ffmpeg: document apad option

3 years agoavfilter/af_acrusher: add commands support
Paul B Mahol [Sat, 30 Jan 2021 22:39:55 +0000 (23:39 +0100)]
avfilter/af_acrusher: add commands support

3 years agoavfilter/vf_lagfun: add support for commands
Paul B Mahol [Sat, 30 Jan 2021 16:23:26 +0000 (17:23 +0100)]
avfilter/vf_lagfun: add support for commands

3 years agoavfilter/vf_weave: add slice threading support
Paul B Mahol [Sat, 30 Jan 2021 15:55:56 +0000 (16:55 +0100)]
avfilter/vf_weave: add slice threading support

3 years agoavfilter/vf_blackdetect: add slice threading support
Paul B Mahol [Sat, 30 Jan 2021 15:04:28 +0000 (16:04 +0100)]
avfilter/vf_blackdetect: add slice threading support

3 years agoavcodec/dolby_e: Avoid duplicating sample rate table
Andreas Rheinhardt [Tue, 26 Jan 2021 16:14:05 +0000 (17:14 +0100)]
avcodec/dolby_e: Avoid duplicating sample rate table

Set the sample rate when parsing the header instead and only copy the
value in the decoder and the parser.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/dolby_e: Avoid code duplication when converting input
Andreas Rheinhardt [Tue, 26 Jan 2021 15:33:01 +0000 (16:33 +0100)]
avcodec/dolby_e: Avoid code duplication when converting input

convert_input, a nontrivial auxiliary function used by both the general
parsing code as well as the decoder itself, has been duplicated in
c7016e35a624a75bb5b82bee932ddfe28d013b3f; this commit removes said
duplication.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/dolby_e_parse: Merge ff_dolby_e_parse_init/header
Andreas Rheinhardt [Tue, 26 Jan 2021 14:46:15 +0000 (15:46 +0100)]
avcodec/dolby_e_parse: Merge ff_dolby_e_parse_init/header

These two functions are always called after another; after all, what
ff_dolby_e_parse_init does is obviously part of parsing the frame header.

Also move the DolbyEHeaderInfo into DBEContext so that parsing the frame
header only needs one struct (both users used a DBEContext immediately
followed by a separate DolbyEHeaderInfo).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/dolby_e_parser: Remove unused ParseContext
Andreas Rheinhardt [Tue, 26 Jan 2021 13:48:01 +0000 (14:48 +0100)]
avcodec/dolby_e_parser: Remove unused ParseContext

Parsers are not forced to use a ParseContext and the other stuff from
parser.h which is just designed to help parsers recombining frames. But
this parser does not do this at all, i.e. the ParseContext is unused.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavfilter/vf_pseudocolor: allow more advanced presets
Paul B Mahol [Fri, 29 Jan 2021 18:45:21 +0000 (19:45 +0100)]
avfilter/vf_pseudocolor: allow more advanced presets

3 years agoavfilter/vf_lut3d: add prism interpolation
Paul B Mahol [Wed, 27 Jan 2021 17:44:25 +0000 (18:44 +0100)]
avfilter/vf_lut3d: add prism interpolation

3 years agoavfilter/vf_lut3d: add pyramid interpolation
Paul B Mahol [Wed, 27 Jan 2021 13:37:10 +0000 (14:37 +0100)]
avfilter/vf_lut3d: add pyramid interpolation

3 years agoavformat/flvdec: Check for EOF in amf_skip_tag()
Michael Niedermayer [Tue, 12 Jan 2021 20:54:31 +0000 (21:54 +0100)]
avformat/flvdec: Check for EOF in amf_skip_tag()

Fixes: Timeout
Fixes: 29070/clusterfuzz-testcase-minimized-ffmpeg_dem_KUX_fuzzer-5650106766458880
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_o: Check lang_idx
Michael Niedermayer [Tue, 12 Jan 2021 20:45:38 +0000 (21:45 +0100)]
avformat/asfdec_o: Check lang_idx

Fixes: index 26981 out of bounds for type 'ASFStreamData [128]'
Fixes: 27334/clusterfuzz-testcase-minimized-ffmpeg_dem_ASF_O_fuzzer-6197611002068992
Alternatively the array could be increased in size or the cases not fitting be ignored

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/aiffdec: Check size before subtraction in get_aiff_header()
Michael Niedermayer [Tue, 10 Nov 2020 22:01:12 +0000 (23:01 +0100)]
avformat/aiffdec: Check size before subtraction in get_aiff_header()

Fixes: Infinite loop
Fixes: 27235/clusterfuzz-testcase-minimized-ffmpeg_dem_AIFF_fuzzer-5761398380167168
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/utils: Use av_sat_sub64() in max_analyze_duration check
Michael Niedermayer [Tue, 10 Nov 2020 21:27:47 +0000 (22:27 +0100)]
avformat/utils: Use av_sat_sub64() in max_analyze_duration check

Fixes: signed integer overflow: 9223372036854710272 - -541165944832 cannot be represented in type 'long'
Fixes: 27000/clusterfuzz-testcase-minimized-ffmpeg_dem_IVF_fuzzer-5643670608674816
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/electronicarts: More chunk_size checks
Michael Niedermayer [Tue, 12 Jan 2021 21:18:59 +0000 (22:18 +0100)]
avformat/electronicarts: More chunk_size checks

Fixes: Timeout
Fixes: 26909/clusterfuzz-testcase-minimized-ffmpeg_dem_EA_fuzzer-6489496553783296
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/cfhd: check peak.offset
Michael Niedermayer [Sat, 7 Nov 2020 23:08:35 +0000 (00:08 +0100)]
avcodec/cfhd: check peak.offset

Fixes: signed integer overflow: -2147483648 - 4 cannot be represented in type 'int'
Fixes: 26907/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CFHD_fuzzer-5746202330267648
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/tedcaptionsdec: Check for overflow in parse_int()
Michael Niedermayer [Sat, 7 Nov 2020 20:11:32 +0000 (21:11 +0100)]
avformat/tedcaptionsdec: Check for overflow in parse_int()

Fixes: signed integer overflow: 1111111111111111111 * 10 cannot be represented in type 'long'
Fixes: 26892/clusterfuzz-testcase-minimized-ffmpeg_dem_TEDCAPTIONS_fuzzer-5756045055754240
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/vorbis_data: Move encoder-related table to its only user
Andreas Rheinhardt [Thu, 28 Jan 2021 23:14:09 +0000 (00:14 +0100)]
avcodec/vorbis_data: Move encoder-related table to its only user

Said table was unused in case libvorbis was disabled.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/fft_template: Avoid useless function
Andreas Rheinhardt [Thu, 28 Jan 2021 23:06:20 +0000 (00:06 +0100)]
avcodec/fft_template: Avoid useless function

ff_init_ff_cos_tabs is only used for the floating point FFT and only
if hardcoded tables are disabled.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavfilter/drawutils: Remove remnants of old API
Andreas Rheinhardt [Thu, 28 Jan 2021 22:49:13 +0000 (23:49 +0100)]
avfilter/drawutils: Remove remnants of old API

ff_fill_line_with_color and ff_draw_rectangle are unused since
19c8f2271423281c9b876b984076a6467c455904; ff_copy_rectangle
is unused since 53b7a3fe081ec56c5706228eb6431bb943ad471a.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavfilter/vf_blackdetect: add support for >8 depth formats
Paul B Mahol [Fri, 29 Jan 2021 13:34:36 +0000 (14:34 +0100)]
avfilter/vf_blackdetect: add support for >8 depth formats