]> git.sesse.net Git - ffmpeg/log
ffmpeg
3 years agolibavutil/common: Add FFABS64U()
Michael Niedermayer [Sun, 31 Jan 2021 14:51:10 +0000 (15:51 +0100)]
libavutil/common: Add FFABS64U()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/hevc_sei: Check payload size in decode_nal_sei_message()
Michael Niedermayer [Sun, 31 Jan 2021 13:59:27 +0000 (14:59 +0100)]
avcodec/hevc_sei: Check payload size in decode_nal_sei_message()

Fixes: out of array access
Fixes: 29392/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-4821602850177024.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 agolibavutil/eval: Remove CONFIG_TRAPV special handling
Michael Niedermayer [Sun, 31 Jan 2021 15:22:53 +0000 (16:22 +0100)]
libavutil/eval: Remove CONFIG_TRAPV special handling

Fixes: division by zero
Fixes: 29555/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVO_fuzzer-5149951447400448
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_datascope: add commands support
Paul B Mahol [Wed, 10 Feb 2021 10:25:25 +0000 (11:25 +0100)]
avfilter/vf_datascope: add commands support

3 years agoavcodec/libaomenc: add support for setting arbitrary libaom options
Bohan Li [Tue, 9 Feb 2021 04:04:41 +0000 (20:04 -0800)]
avcodec/libaomenc: add support for setting arbitrary libaom options

A new key & value API lets us gain access to newly added parameters
without adding explicit support for them in our wrapper. Add an
option utilizing this functionality in a similar manner to other
encoder libraries' wrappers.

Signed-off-by: Bohan Li <bohanli@google.com>
3 years agoavformat/fitsenc: write DATAMIN/DATAMAX to encoded output
Paul B Mahol [Mon, 8 Feb 2021 17:46:36 +0000 (18:46 +0100)]
avformat/fitsenc: write DATAMIN/DATAMAX to encoded output

There is no point in doing normalization when such files are decoded.

Update fate test with new results.

3 years agoavcodec/fitsdec: properly initialize header->data_max
Paul B Mahol [Mon, 8 Feb 2021 16:45:57 +0000 (17:45 +0100)]
avcodec/fitsdec: properly initialize header->data_max

3 years agoavfilter/af_arnndn: make model opening errors more verbose
Paul B Mahol [Tue, 9 Feb 2021 22:07:56 +0000 (23:07 +0100)]
avfilter/af_arnndn: make model opening errors more verbose

Also return proper error code.

3 years agoavformat/mov: factor size out of probe code
Michael Niedermayer [Sat, 6 Feb 2021 17:22:54 +0000 (18:22 +0100)]
avformat/mov: factor size out of probe code

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavformat/wtvdec: Check len in parse_chunks() to avoid overflow
Michael Niedermayer [Mon, 8 Feb 2021 13:29:01 +0000 (14:29 +0100)]
avformat/wtvdec: Check len in parse_chunks() to avoid overflow

Fixes: signed integer overflow: 2147483647 + 7 cannot be represented in type 'int'
Fixes: 30084/clusterfuzz-testcase-minimized-ffmpeg_dem_WTV_fuzzer-6192261941559296
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/wtvdec: Check for EOF before potentially reseting the eof state
Michael Niedermayer [Fri, 11 Dec 2020 23:41:17 +0000 (00:41 +0100)]
avformat/wtvdec: Check for EOF before potentially reseting the eof state

Fixes: infinite loop
Fixes: 28042/clusterfuzz-testcase-minimized-ffmpeg_dem_WTV_fuzzer-6311288967528448
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: Add an additional check for the extradata size
Michael Niedermayer [Sun, 7 Feb 2021 20:50:03 +0000 (21:50 +0100)]
avformat/asfdec_f: Add an additional check for the extradata size

Fixes: OOM
Fixes: 30066/clusterfuzz-testcase-minimized-ffmpeg_dem_ASF_fuzzer-6182309126602752
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 agoavformat/3dostr: Check sample_rate
Michael Niedermayer [Mon, 8 Feb 2021 13:29:02 +0000 (14:29 +0100)]
avformat/3dostr: Check sample_rate

Fixes: signed integer overflow: -1268324762623155200 * 8 cannot be represented in type 'long'
Fixes: 30123/clusterfuzz-testcase-minimized-ffmpeg_dem_THREEDOSTR_fuzzer-6710765123928064
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 agoavfilter/vf_curves: add commands support
Paul B Mahol [Tue, 9 Feb 2021 17:08:16 +0000 (18:08 +0100)]
avfilter/vf_curves: add commands support

3 years agoavcodec: add cri parser
Paul B Mahol [Fri, 5 Feb 2021 19:10:49 +0000 (20:10 +0100)]
avcodec: add cri parser

3 years agoavcodec/argo: fix linesize for RLE? in PAL8 mode
Paul B Mahol [Tue, 9 Feb 2021 13:17:41 +0000 (14:17 +0100)]
avcodec/argo: fix linesize for RLE? in PAL8 mode

3 years agoavfilter/vf_framepack: add >8 format support
Paul B Mahol [Tue, 9 Feb 2021 11:25:48 +0000 (12:25 +0100)]
avfilter/vf_framepack: add >8 format support

3 years agoavfilter/vf_swaprect: add support for commands
Paul B Mahol [Tue, 9 Feb 2021 10:38:37 +0000 (11:38 +0100)]
avfilter/vf_swaprect: add support for commands

3 years agoavfilter/vf_maskfun: add support for commands
Paul B Mahol [Tue, 9 Feb 2021 10:23:19 +0000 (11:23 +0100)]
avfilter/vf_maskfun: add support for commands

3 years agoavfilter/vf_zscale: switch verbose log to trace
Paul B Mahol [Tue, 9 Feb 2021 09:35:36 +0000 (10:35 +0100)]
avfilter/vf_zscale: switch verbose log to trace

Not needed in verbose mode.

3 years agoavfilter/vf_lut: add support for commands
Paul B Mahol [Mon, 8 Feb 2021 15:31:21 +0000 (16:31 +0100)]
avfilter/vf_lut: add support for commands

While here remove excessive log and uninit() call in negate_init().

3 years agoavfilter/vf_deband: add support for commands
Paul B Mahol [Mon, 8 Feb 2021 15:08:25 +0000 (16:08 +0100)]
avfilter/vf_deband: add support for commands

3 years agoavfilter/vf_deband: avoid doubles
Paul B Mahol [Mon, 8 Feb 2021 14:58:42 +0000 (15:58 +0100)]
avfilter/vf_deband: avoid doubles

3 years agoavcodec/g722enc: Validate parameters before using them
Andreas Rheinhardt [Fri, 5 Feb 2021 11:23:49 +0000 (12:23 +0100)]
avcodec/g722enc: Validate parameters before using them

In case trellis is outside of 0..23, an invalid shift and/or a signed
integer overflow happens; furthermore, it can lead to the request to
allocate nonsense amounts of memory. So validate first.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavfilter/vf_thumbnail: add support for rest of packed rgb formats
Paul B Mahol [Mon, 8 Feb 2021 11:58:12 +0000 (12:58 +0100)]
avfilter/vf_thumbnail: add support for rest of packed rgb formats

3 years agoavfilter/vf_thumbnail: add support for YUV and GBRP formats
Paul B Mahol [Sat, 6 Feb 2021 20:59:50 +0000 (21:59 +0100)]
avfilter/vf_thumbnail: add support for YUV and GBRP formats

3 years agovf_pp: remove unnecessary free
Anton Khirnov [Tue, 26 Jan 2021 16:25:54 +0000 (17:25 +0100)]
vf_pp: remove unnecessary free

ff_qp_table_extract() frees the table on failure.

Found-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agomjpegdec: stop setting the QP table
Anton Khirnov [Tue, 26 Jan 2021 16:13:59 +0000 (17:13 +0100)]
mjpegdec: stop setting the QP table

MJPEG does not have a single quantiser scale, so this does not fit into
the intended API use.

This removes the last use of the long-deprecated QP table API.

3 years agoavfilter/vf_lut3d: lut3d, haldclut: add support for commands
Paul B Mahol [Sun, 7 Feb 2021 23:53:53 +0000 (00:53 +0100)]
avfilter/vf_lut3d: lut3d, haldclut: add support for commands

3 years agoavfilter/vf_lut2: add support for commands
Paul B Mahol [Sun, 7 Feb 2021 21:39:25 +0000 (22:39 +0100)]
avfilter/vf_lut2: add support for commands

3 years agoavfilter/vf_extractplanes: add float formats support
Paul B Mahol [Sun, 7 Feb 2021 20:41:04 +0000 (21:41 +0100)]
avfilter/vf_extractplanes: add float formats support

3 years agoavformat/libsrt: fix race condition with libsrt_network_wait_fd and epoll
Marton Balint [Sat, 30 Jan 2021 23:45:33 +0000 (00:45 +0100)]
avformat/libsrt: fix race condition with libsrt_network_wait_fd and epoll

The way SRT's async / epoll-based IO works is that the event status is stored
in the epoll containers. That is, if an event occurs on an SRT socket, and that
SRT socket isn't part of any epoll container, then that event is lost. If we
later add that socket to an epoll container, we still won't receive the event
even if it wasn't serviced.

Therefore we create the epoll and put the fd into it right after the connection
is established.

See http://lists.ffmpeg.org/pipermail/ffmpeg-devel/2021-January/275334.html

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoavformat/libsrt: fix or simplify some function return values
Marton Balint [Sat, 30 Jan 2021 23:25:14 +0000 (00:25 +0100)]
avformat/libsrt: fix or simplify some function return values

Sometimes there was a confusion between srt_*() function return values and
libavformat-style return values.

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoavformat/libsrt: close listen fd immediately after accept
Marton Balint [Sat, 30 Jan 2021 22:57:34 +0000 (23:57 +0100)]
avformat/libsrt: close listen fd immediately after accept

There is no reason to keep it open.

Signed-off-by: Marton Balint <cus@passwd.hu>
3 years agoavfilter: add colorize filter
Paul B Mahol [Thu, 4 Feb 2021 14:06:35 +0000 (15:06 +0100)]
avfilter: add colorize filter

3 years agoavcodec/ac3enc: Share options and defaults
Andreas Rheinhardt [Thu, 3 Dec 2020 04:32:18 +0000 (05:32 +0100)]
avcodec/ac3enc: Share options and defaults

Both AC-3 encoder share the same options, yet they are nevertheless
duplicated in the binary; and the options applying to the EAC-3 encoder
are a proper subset of the options for the AC-3 encoders, so that it can
use the same options as the former by putting the options specific to
AC-3 at the front. This commit implements this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/Makefile: Remove dependency for nonexistent files
Andreas Rheinhardt [Thu, 28 Jan 2021 13:55:50 +0000 (14:55 +0100)]
avcodec/Makefile: Remove dependency for nonexistent files

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/aacdec_fixed: Move fixed-point sinewin tables to its only user
Andreas Rheinhardt [Wed, 30 Dec 2020 00:46:34 +0000 (01:46 +0100)]
avcodec/aacdec_fixed: Move fixed-point sinewin tables to its only user

The fixed-point AAC decoder is the only user of the fixed-point sinewin
tables from sinewin; and it only uses a few of them (about 10% when
counting by size). This means that guarding initializing these tables by
an AVOnce (as done in 3719122065863f701026632f610175980d42b05a) is
unnecessary for them. Furthermore the array of pointers to the
individual arrays is also unneeded.

Therefore this commit moves these tables directly into aacdec_fixed.c;
this is done by ridding the original sinewin.h and sinewin_tablegen.h
headers completely of any fixed-point code at the cost of a bit of
duplicated code (the alternative is an ugly ifdef-mess).

This saves about 58KB from the binary when using hardcoded tables (as
these tables are hardcoded in this scenario); when not using hardcoded
tables, most of these savings only affect the .bss segment, but the rest
(< 1KB) contains relocations (i.e. savings in .data.rel.ro).

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoffbuild/common: Make deletion of templates possible
Andreas Rheinhardt [Wed, 27 Jan 2021 23:04:53 +0000 (00:04 +0100)]
ffbuild/common: Make deletion of templates possible

If a target to be built includes a template file, the target's .d file
includes the template file as a prerequisite; if the code were changed so
that the template file no longer exists, one would get an error from
make that it has no rule for the template file target. Therefore add a
dummy rule for template files to make deleting them possible.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agodoc/general_contents: add few more entries
Paul B Mahol [Sat, 6 Feb 2021 22:38:14 +0000 (23:38 +0100)]
doc/general_contents: add few more entries

Also extend description of some entries.

3 years agoavdevice/xcbgrab: don't assume xserver endianness
Andriy Gelman [Sun, 31 Jan 2021 19:41:47 +0000 (14:41 -0500)]
avdevice/xcbgrab: don't assume xserver endianness

xserver defines the endianness of the grabbed images. Use this information
to set the correct pixel format.

This also fixes format selection in configuration depth=32/bpp=32 with
xserver on a little endian machine. Before the patch, the big endian
layout 0RGB was always selected which is incorrect because BGR0 should
be used. RGB24 was also incorrectly assumed (but this format was removed
in xserver 1.20).

The big-endian settings can be tested using docker+qemu from a little-endian
machine:

$ docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
$ docker run --rm -it -v /tmp:/tmp powerpc64/debian /bin/bash

In docker container
$ apt-get update
$ apt-get install xvfb
$ apt-get install x11-apps

To test AV_PIX_FMT_0RGB32
$ Xvfb :2 -screen 0 720x480x24 &
$ export DISPLAY=:2
$ xclock -geometry 720x480 -bg green #test different colors

On your host machine grab the frames using the following
command. View output to check that colors are rendered correctly
$ ./ffmpeg -y -f x11grab -i :2.0 -codec:v mpeg2video out.mp4

Other pixel formats can be tested by modifying how Xvfb is started in the docker
container:

AV_PIX_FMT_RGB565
$ Xvfb :2 -screen 0 720x480x16

AV_PIX_FMT_RGB555
$ Xvfb :2 -screen 0 720x480x15

AV_PIX_FMT_BGR24 / AV_PIX_FMT_RGB24
This is difficult to test because bpp=24 support was removed in xserver 1.20
https://lists.x.org/archives/xorg-devel/2018-February/056175.html?hmsr=joyk.com&utm_source=joyk.com&utm_medium=referral
However, I was able to run previous version of Xvfb (with some
modifications to force 24bpp) to check that images are rendered correctly.

Reviewed-by: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
3 years agoavfilter/vf_deblock: add support for commands
Paul B Mahol [Sat, 6 Feb 2021 14:21:56 +0000 (15:21 +0100)]
avfilter/vf_deblock: add support for commands

3 years agoavfilter/vf_lut3d: lut1d: add support for commands
Paul B Mahol [Sat, 6 Feb 2021 11:45:39 +0000 (12:45 +0100)]
avfilter/vf_lut3d: lut1d: add support for commands

3 years agoavfilter/vf_tile: remove extra whitespace in option description
Paul B Mahol [Fri, 5 Feb 2021 11:31:01 +0000 (12:31 +0100)]
avfilter/vf_tile: remove extra whitespace in option description

3 years agoavfilter/avfilter: move enable_str expression parsing into avfilter_init_dict()
Paul B Mahol [Fri, 5 Feb 2021 11:23:57 +0000 (12:23 +0100)]
avfilter/avfilter: move enable_str expression parsing into avfilter_init_dict()

This ensures that needed arrays are always allocated and properly initialized.

Previously if code would use only avfilter_init_dict() to set options for filters
it would not allocate arrays for timeline processing thus it would crash if
user supplied enable option for filter(s).

3 years agoavfilter/vf_mix: add support for commands
Paul B Mahol [Sat, 6 Feb 2021 10:27:56 +0000 (11:27 +0100)]
avfilter/vf_mix: add support for commands

3 years agoavfilter/vf_mix: add timeline support
Paul B Mahol [Sat, 6 Feb 2021 10:05:55 +0000 (11:05 +0100)]
avfilter/vf_mix: add timeline support

3 years agoavformat/img2dec: improve xbm probing
Paul B Mahol [Fri, 5 Feb 2021 21:33:32 +0000 (22:33 +0100)]
avformat/img2dec: improve xbm probing

3 years agoffmpeg: add -fpsmax to clamp output framerate
Gyan Doshi [Mon, 1 Feb 2021 12:49:18 +0000 (18:19 +0530)]
ffmpeg: add -fpsmax to clamp output framerate

Useful when encoding in batch or with aberrant inputs.

3 years agoavformat/cdxl: add back options to override sample and frame rate
Paul B Mahol [Fri, 5 Feb 2021 17:06:28 +0000 (18:06 +0100)]
avformat/cdxl: add back options to override sample and frame rate

It make sense to allow to control speed of playback when
no infomation is provided.

3 years agoavcodec/xbm_parser: mark frame as intra only and as key frame
Paul B Mahol [Fri, 5 Feb 2021 14:46:39 +0000 (15:46 +0100)]
avcodec/xbm_parser: mark frame as intra only and as key frame

3 years agoavcodec/xbm_parser: split long line
Paul B Mahol [Fri, 5 Feb 2021 14:43:50 +0000 (15:43 +0100)]
avcodec/xbm_parser: split long line

3 years agoavformat: add xbm_pipe demuxer
Paul B Mahol [Wed, 3 Feb 2021 12:52:00 +0000 (13:52 +0100)]
avformat: add xbm_pipe demuxer

3 years agoavcodec: add xbm parser
Paul B Mahol [Wed, 3 Feb 2021 10:58:47 +0000 (11:58 +0100)]
avcodec: add xbm parser

3 years agoavfilter/vf_lensfun: display list of possible values if user supplied none
Paul B Mahol [Fri, 5 Feb 2021 14:26:10 +0000 (15:26 +0100)]
avfilter/vf_lensfun: display list of possible values if user supplied none

3 years agoavfilter/vf_lensfun: replace deprecated calls
Paul B Mahol [Fri, 5 Feb 2021 13:28:57 +0000 (14:28 +0100)]
avfilter/vf_lensfun: replace deprecated calls

3 years agoavfilter/vf_frei0r: add timeline support
Paul B Mahol [Fri, 5 Feb 2021 12:14:43 +0000 (13:14 +0100)]
avfilter/vf_frei0r: add timeline support

3 years agoavfilter/drawbox: fix formatting after d64cbd4fda
Gyan Doshi [Fri, 5 Feb 2021 11:59:59 +0000 (17:29 +0530)]
avfilter/drawbox: fix formatting after d64cbd4fda

3 years agoavformat/mxfenc: prefer to use the configured metadata
Limin Wang [Tue, 2 Feb 2021 12:41:22 +0000 (20:41 +0800)]
avformat/mxfenc: prefer to use the configured metadata

The metadata company_name, product_name, product_version from input
file will be deleted to avoid overwriting information
Please to test with below commands:
./ffmpeg -i ../fate-suite/mxf/Sony-00001.mxf -c:v copy -c:a copy out.mxf
and
./ffmpeg -i ../fate-suite/mxf/Sony-00001.mxf -c:v copy -c:a copy \
        -metadata company_name="xxx" \
        -metadata product_name="xxx" \
        -metadata product_version="xxx" \
        out.mxf

Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
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>