ffmpeg.git
33 hours agolibavfilter: Fix fate-source after 072788c46e36a21ca9e8f1e3cc19a1944db5b89c master
Martin Storsjö [Wed, 23 Jun 2021 06:20:49 +0000 (09:20 +0300)]
libavfilter: Fix fate-source after 072788c46e36a21ca9e8f1e3cc19a1944db5b89c

Signed-off-by: Martin Storsjö <martin@martin.st>
2 days agoavfilter: compress CUDA PTX code if possible
Timo Rothenpieler [Fri, 11 Jun 2021 21:54:34 +0000 (23:54 +0200)]
avfilter: compress CUDA PTX code if possible

2 days agoconfigure: msys also has .exe suffix
Timo Rothenpieler [Sat, 12 Jun 2021 12:29:55 +0000 (14:29 +0200)]
configure: msys also has .exe suffix

2 days agoavcodec/crystalhd: signal that the decoder sets all output frame properties
James Almer [Mon, 21 Jun 2021 18:26:44 +0000 (15:26 -0300)]
avcodec/crystalhd: signal that the decoder sets all output frame properties

Signed-off-by: James Almer <jamrial@gmail.com>
2 days agoavcodec/cuviddec: signal that the decoder sets all output frame properties
James Almer [Fri, 18 Jun 2021 21:59:25 +0000 (18:59 -0300)]
avcodec/cuviddec: signal that the decoder sets all output frame properties

Fixes memleaks described in ticket #9082.

Signed-off-by: James Almer <jamrial@gmail.com>
2 days agoavcodec/cuviddec: remove unused AVCodec.decode() callback
James Almer [Thu, 17 Jun 2021 14:00:41 +0000 (11:00 -0300)]
avcodec/cuviddec: remove unused AVCodec.decode() callback

The AVCodec.receive_frame() callback takes precedence.

Signed-off-by: James Almer <jamrial@gmail.com>
2 days agoavcodec/decode: reindent after the previous commit
James Almer [Mon, 21 Jun 2021 18:05:11 +0000 (15:05 -0300)]
avcodec/decode: reindent after the previous commit

Signed-off-by: James Almer <jamrial@gmail.com>
2 days agoavcodec/decode: add an internal codec flag to signal a decoder sets all output frame...
James Almer [Fri, 18 Jun 2021 21:57:38 +0000 (18:57 -0300)]
avcodec/decode: add an internal codec flag to signal a decoder sets all output frame properties

Decoders like cuviddec ignore and overwrite all the properties set by the generic
code as derived from AVCodecInternal.last_pkt_props. This flag ensures libavcodec
will not store and potentially queue input packets that ultimately will not be used.

Signed-off-by: James Almer <jamrial@gmail.com>
2 days agoavcodec/decode: fetch packets from the pkt_props FIFO on every frame returned
James Almer [Fri, 18 Jun 2021 20:58:18 +0000 (17:58 -0300)]
avcodec/decode: fetch packets from the pkt_props FIFO on every frame returned

Fixes memleaks on decoders that don't call ff_decode_frame_props(), like
libdav1d.

Signed-off-by: James Almer <jamrial@gmail.com>
3 days agodoc/protocols: Add remark about TCP_NODELAY to documentation of TCP
Thilo Borgmann [Fri, 11 Jun 2021 19:03:20 +0000 (21:03 +0200)]
doc/protocols: Add remark about TCP_NODELAY to documentation of TCP

3 days agolavf/rtmp: Add option to set TCP_NODELAY for rtmp
Nick Ruff [Fri, 11 Jun 2021 19:02:02 +0000 (21:02 +0200)]
lavf/rtmp: Add option to set TCP_NODELAY for rtmp

Suggested-By: ffmpeg@fb.com
3 days agolavf/webmdashenc.c: Allow AV1 video in WebM
Matthieu Patou [Sun, 20 Jun 2021 20:19:18 +0000 (22:19 +0200)]
lavf/webmdashenc.c: Allow AV1 video in WebM

Suggested-By: ffmpeg@fb.com
3 days agoavformat/aaxdec: Check avio_seek() in header reading
Michael Niedermayer [Mon, 12 Apr 2021 19:21:08 +0000 (21:21 +0200)]
avformat/aaxdec: Check avio_seek() in header reading

Fixes: Timeout
Fixes: 32450/clusterfuzz-testcase-minimized-ffmpeg_dem_AAX_fuzzer-4875522262827008

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 days agoavcodec/hevc_sei: Use get_bits_long() for time_offset_value
Michael Niedermayer [Sat, 19 Jun 2021 13:11:41 +0000 (15:11 +0200)]
avcodec/hevc_sei: Use get_bits_long() for time_offset_value

Fixes: assertion failure
Fixes: crash_1

Found-by: Thuan Pham <tpham.unimelb@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 days agolavfi/vf_vpp_qsv: fix the time_base for outlink
Haihao Xiang [Fri, 11 Jun 2021 02:19:46 +0000 (10:19 +0800)]
lavfi/vf_vpp_qsv: fix the time_base for outlink

Since commit 89ffcd1, the status pts of the output link is set to a
value in the input link time base, not in the output link time base when
EOF is reached. Usually this pst value is larger than the required one
because the output link time base is more greater than the input link
time base. When "-vf vpp_qsv,fps" is used, user has to wait a long time
for the ending of the pipeline because fps filter output a huge number
of frames until the wrong status pts is hit.

The issue can be triggered with the command below (use a clip with 1000
frames in this case):

$> time ffmpeg -hwaccel qsv -c:v hevc_qsv -i input.h265 -vf
"vpp_qsv=w=1920:h=1080,fps=fps=30" -f null -
...
[out_0_0 @ 0x564ccd27e020] 10000000 buffers queued in out_0_0, something
may be wrong.
frame=40119596 fps=88080 q=-0.0 Lsize=N/A time=371:28:39.96 bitrate=N/A
speed=2.94e+03x
video:17238889kB audio:0kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: unknown

real    9m7.451s
user    2m34.102s
sys     0m39.734s

In order to avoid the above issue, the same time base for input and
ouput links is used in this patch.

Fixes ticket #9286

Signed-off-by: Zhong Li <zhongli_dev@126.com>
4 days agolavc/qsvdec: fix pts
Haihao Xiang [Fri, 11 Jun 2021 02:19:45 +0000 (10:19 +0800)]
lavc/qsvdec: fix pts

The time base used for compressed bitstream and video frame in the SDK
is { 1, 90000 }. [1][2]

This can avoid the error message below from the muxer.

$> ffmpeg -hwaccel qsv -c:v hevc_qsv -i input.h265 -f null -
...
[null @ 0x561c24f6f2f0] Application provided invalid, non monotonically
increasing dts to muxer in stream 0: 2 >= 2

[1]https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#mfxbitstream
[2]https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md#mfxframedata

Signed-off-by: Zhong Li <zhongli_dev@126.com>
5 days agolavfi/dnn_backend_openvino.c: fix crash when target is not specified
Guo Yejun [Sun, 13 Jun 2021 13:27:13 +0000 (21:27 +0800)]
lavfi/dnn_backend_openvino.c: fix crash when target is not specified

5 days agoavcodec/ccaption_dec: Make real-time latency configurable
Pavel Koshevoy [Sat, 19 Jun 2021 01:20:03 +0000 (19:20 -0600)]
avcodec/ccaption_dec: Make real-time latency configurable

Un-hardcode the 200ms minimum latency between emitting subtitle events
so that those that wish to receive a subtitle event for every screen
change could do so.

The problem with delaying realtime output by any amount is that it is
unknown when the next byte pair that would trigger output will happen.
It may be within 200ms, or it may be several seconds later -- that's
not realtime at all.

5 days agodoc/mailing-list-faq.texi: remove remaining references to Freenode
James Almer [Fri, 18 Jun 2021 22:21:11 +0000 (19:21 -0300)]
doc/mailing-list-faq.texi: remove remaining references to Freenode

Signed-off-by: James Almer <jamrial@gmail.com>
5 days agoavformat/rmdec: Check old_format len for overflow
Michael Niedermayer [Mon, 26 Apr 2021 20:35:37 +0000 (22:35 +0200)]
avformat/rmdec: Check old_format len for overflow

Maybe such large values could be disallowed earlier and closer to where
they are set.

Fixes: signed integer overflow: 538976288 * 8224 cannot be represented in type 'int'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_RM_fuzzer-6704350354341888

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 days agoavformat/realtextdec: Check the pts difference before using it for the duration compu...
Michael Niedermayer [Sun, 25 Apr 2021 18:45:10 +0000 (20:45 +0200)]
avformat/realtextdec: Check the pts difference before using it for the duration computation

Fixes: signed integer overflow: 5404200000 - -9223372031709351616 cannot be represented in type 'long'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_REALTEXT_fuzzer-6737340551790592

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 days agoavformat/qcp: Avoid negative nb_rates
Michael Niedermayer [Sun, 25 Apr 2021 18:16:38 +0000 (20:16 +0200)]
avformat/qcp: Avoid negative nb_rates

Fixes: signed integer overflow: 2 * -1725947872 cannot be represented in type 'int'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_QCP_fuzzer-6726807632084992

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 days agoavformat/pp_bnk: Use 64bit in bitrate computation
Michael Niedermayer [Sun, 25 Apr 2021 18:12:13 +0000 (20:12 +0200)]
avformat/pp_bnk: Use 64bit in bitrate computation

Fixes: signed integer overflow: 1207959552 * 4 cannot be represented in type 'int'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_PP_BNK_fuzzer-6747301169201152

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 days agoavformat/nutdec: Check tmp_size
Michael Niedermayer [Sun, 25 Apr 2021 18:01:03 +0000 (20:01 +0200)]
avformat/nutdec: Check tmp_size

Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_NUT_fuzzer-6739990530883584

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 days agoavformat/msf: Check that channels doesnt overflow during extradata construction
Michael Niedermayer [Sun, 25 Apr 2021 17:54:19 +0000 (19:54 +0200)]
avformat/msf: Check that channels doesnt overflow during extradata construction

Fixes: signed integer overflow: 2048 * 1122336 cannot be represented in type 'int'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_MSF_fuzzer-6726959600107520

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 days agoavformat/subtitles: Check pts difference before use
Michael Niedermayer [Sun, 25 Apr 2021 17:49:14 +0000 (19:49 +0200)]
avformat/subtitles: Check pts difference before use

Fixes: signed integer overflow: 0 - -9223372036854775808 cannot be represented in type 'long'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_MPL2_fuzzer-6747053545881600

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 days agoavformat/mpc8: Check for position overflow in mpc8_handle_chunk()
Michael Niedermayer [Sat, 24 Apr 2021 15:42:19 +0000 (17:42 +0200)]
avformat/mpc8: Check for position overflow in mpc8_handle_chunk()

Fixes: signed integer overflow: 15 + 9223372036854775796 cannot be represented in type 'long'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_MPC8_fuzzer-6723520756318208
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_MPC8_fuzzer-6739833034768384

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 days agoavformat/mccdec: Fix overflows in num/den
Michael Niedermayer [Sat, 24 Apr 2021 14:37:34 +0000 (16:37 +0200)]
avformat/mccdec: Fix overflows in num/den

Fixes: signed integer overflow: 6365816 * 1000 cannot be represented in type 'int'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_MCC_fuzzer-6737934184218624

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 days agoavformat/iff: Use 64bit in duration computation
Michael Niedermayer [Sat, 24 Apr 2021 13:41:16 +0000 (15:41 +0200)]
avformat/iff: Use 64bit in duration computation

Fixes: signed integer overflow: 588 * 16719904 cannot be represented in type 'int'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_IFF_fuzzer-6748331936186368

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 days agoavformat/dxa: Check fps to be within the supported range more precissely
Michael Niedermayer [Sat, 24 Apr 2021 11:08:24 +0000 (13:08 +0200)]
avformat/dxa: Check fps to be within the supported range more precissely

Fixes: negation of -2147483648 cannot be represented in type 'int32_t' (aka 'int'); cast to an unsigned type to negate this value to itself
Fixes: assertion failure
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_DXA_fuzzer-6744985740378112

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 days agoavcodec/iff: Only write palette to plane 1 if its PAL8
Michael Niedermayer [Tue, 4 May 2021 20:52:41 +0000 (22:52 +0200)]
avcodec/iff: Only write palette to plane 1 if its PAL8

Fixes: null pointer passed as argument 1, which is declared to never be null
Fixes: 33791/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5107575256383488.fuzz

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 days agoavformat/tta: Check for EOF in index reading loop
Michael Niedermayer [Tue, 4 May 2021 16:34:44 +0000 (18:34 +0200)]
avformat/tta: Check for EOF in index reading loop

Fixes: OOM
Fixes: 33585/clusterfuzz-testcase-minimized-ffmpeg_dem_TTA_fuzzer-4564665830080512

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 days agoavutil/tx: avoid negative left shifts
Michael Niedermayer [Tue, 4 May 2021 16:22:40 +0000 (18:22 +0200)]
avutil/tx: avoid negative left shifts

Fixes: left shift of negative value -1
Fixes: 33736/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SIREN_fuzzer-6657785795313664

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
5 days agoUpdate missed irc links
Michael Niedermayer [Thu, 17 Jun 2021 16:37:01 +0000 (18:37 +0200)]
Update missed irc links

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 days agolavfi/dnn_backend_openvino.c: Fix Memory Leak for RequestItem
Shubhanshu Saxena [Mon, 14 Jun 2021 17:56:16 +0000 (23:26 +0530)]
lavfi/dnn_backend_openvino.c: Fix Memory Leak for RequestItem

Fix memory leak for RequestItem upon error while pushing to the
request_queue in the completion callback.

Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
6 days agoffbuild: Avoid using the --preprocessor argument to windres
Martin Storsjö [Fri, 14 May 2021 21:42:38 +0000 (00:42 +0300)]
ffbuild: Avoid using the --preprocessor argument to windres

Instead use --preprocessor-arg; in binutils 2.36, the --preprocessor
flag was changed so that it no longer accepts a string containing
multiple arguments, but the whole --preprocessor argument is
treated as the path to the preprocessor executable (where the path
can contain spaces).

It's currently unclear whether this behaviour will stay or if it
is going to be reverted in the future, see discussion at [1]. Just
to be safe, avoid using the --preprocessor argument. Don't redeclare
the full preprocessing command, but just add the $(CC_DEPFLAGS) options.

Based on a patch by Kyle Schwartz.

[1] https://sourceware.org/bugzilla/show_bug.cgi?id=27594

Signed-off-by: Martin Storsjö <martin@martin.st>
8 days agodoc/filters: document expr support in fps filter
Gyan Doshi [Wed, 16 Jun 2021 10:12:15 +0000 (15:42 +0530)]
doc/filters: document expr support in fps filter

Added in dd770883e976c91feeb8de58eacd97dfb4e8308e

9 days agolavc/libvpxenc: Show encoder config as a warning in case of failed initialization
Matthieu Patou [Mon, 14 Jun 2021 18:20:52 +0000 (20:20 +0200)]
lavc/libvpxenc: Show encoder config as a warning in case of failed initialization

Suggested-By: ffmpeg@fb.com
9 days agolavc/libaomenc: Show encoder config as a warning in case of failed initialization
Matthieu Patou [Mon, 14 Jun 2021 18:18:24 +0000 (20:18 +0200)]
lavc/libaomenc: Show encoder config as a warning in case of failed initialization

Suggested-By: ffmpeg@fb.com
9 days agodashenc: Write out DASH manifest immediately in streaming mode
Kevin LaFlamme [Tue, 8 Jun 2021 19:03:43 +0000 (15:03 -0400)]
dashenc: Write out DASH manifest immediately in streaming mode

When streaming mode is enabled with fMP4/CMAF for DASH output, the
segment files are available to read by players as soon as the first byte
is written instead of only after the file is fully written. The DASH
manifest currently only gets written when the final write to the segment
file occurs. This means that players cannot stream the first segment
while it is being written.

When -lhls is enabled with MP4 segments the HLS manifest is written
immediately to advertise the in-flight segments. This change adds the
same behavior for the DASH manifest so players can stream it
immediately.

9 days agoavformat/dashenc: use av_match_ext()
Limin Wang [Fri, 11 Jun 2021 10:41:55 +0000 (18:41 +0800)]
avformat/dashenc: use av_match_ext()

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
10 days agolavc/videotoolboxenc.c: Fix preprocessor macro for OSX 10.10.5 and probably older...
Thilo Borgmann [Mon, 14 Jun 2021 13:53:20 +0000 (15:53 +0200)]
lavc/videotoolboxenc.c: Fix preprocessor macro for OSX 10.10.5 and probably older versions

10 days agoavfilter/vf_fps: extend support for expressions
James Almer [Wed, 24 Feb 2021 17:40:04 +0000 (14:40 -0300)]
avfilter/vf_fps: extend support for expressions

AV_OPT_TYPE_VIDEO_RATE AVOption types are parsed as expressions, but in a
limited way. For example, name constants can only be parsed alone and not as
part of a longer expression.

This change allows usage like

ffmpeg -i IN -vf fps="if(eq(source_fps\,film)\,ntsc_film\,source_fps)" OUT

Suggested-by: ffmpeg@fb.com
Signed-off-by: James Almer <jamrial@gmail.com>
10 days agoavformat/mxfdec: fixed jp2k_rsiz and 170M matrix
Valerii Zapodovnikov [Sun, 6 Jun 2021 02:27:39 +0000 (05:27 +0300)]
avformat/mxfdec: fixed jp2k_rsiz and 170M matrix

Again. 240M matrix is different from BT.601! And 170M is the same
as BT.601. It is primaries that are the same in 240M and 170M, as
for jp2k_rsiz see page 17 of ST 422:2019. IT WAS THERE since 2006.
This wrong jp2k_rsiz is a copy-paste of header_open_partition_key.

10 days agoavutil/samplefmt: don't add offsets to NULL pointers
James Almer [Mon, 7 Jun 2021 03:04:21 +0000 (00:04 -0300)]
avutil/samplefmt: don't add offsets to NULL pointers

Signed-off-by: James Almer <jamrial@gmail.com>
10 days agoavutil/samplefmt: remove outdated comment
James Almer [Mon, 7 Jun 2021 03:39:02 +0000 (00:39 -0300)]
avutil/samplefmt: remove outdated comment

av_samples_fill_arrays() has been returning the minimum required buffer size
for a while now.

Signed-off-by: James Almer <jamrial@gmail.com>
10 days agoavutil/tests/audio_ffio: add missing header
Matthieu Patou [Fri, 22 Jan 2021 23:55:11 +0000 (15:55 -0800)]
avutil/tests/audio_ffio: add missing header

Needed for HAVE_BIGENDIAN

Suggested-by: ffmpeg@fb.com
Signed-off-by: James Almer <jamrial@gmail.com>
10 days agoavutil/tests/lzo: remove timer macros
James Almer [Wed, 2 Jun 2021 16:06:16 +0000 (13:06 -0300)]
avutil/tests/lzo: remove timer macros

Suggested-by: ffmpeg@fb.com
Signed-off-by: James Almer <jamrial@gmail.com>
11 days agodoc/demuxers: note defaults for apng options
Gyan Doshi [Sun, 13 Jun 2021 11:37:03 +0000 (17:07 +0530)]
doc/demuxers: note defaults for apng options

12 days agoavformat/rpl: The associative law doesnt hold for signed integers in C
Michael Niedermayer [Thu, 10 Jun 2021 18:35:43 +0000 (20:35 +0200)]
avformat/rpl: The associative law doesnt hold for signed integers in C

Add () to avoid undefined behavior
Fixes: signed integer overflow: 9223372036854775790 + 57 cannot be represented in type 'long'
Fixes: 34983/clusterfuzz-testcase-minimized-ffmpeg_dem_RPL_fuzzer-5765822923538432

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
12 days agoavcodec/faxcompr: Check available bits in decode_uncompressed()
Michael Niedermayer [Wed, 9 Jun 2021 19:25:58 +0000 (21:25 +0200)]
avcodec/faxcompr: Check available bits in decode_uncompressed()

Fixes: Timeout
Fixes: 34950/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5686764151898112
Fixes: 34966/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4587409334468608

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
12 days agoavcodec/faxcompr: Check if bits are available before reading in cmode == 9 || cmode...
Michael Niedermayer [Wed, 9 Jun 2021 19:20:04 +0000 (21:20 +0200)]
avcodec/faxcompr: Check if bits are available before reading in cmode == 9 || cmode == 10

Fixes: Timeout
Fixes: 34950/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5686764151898112

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
12 days agoavformat/utils: Avoid overflow in codec_info_duration computation for subtitles
Michael Niedermayer [Wed, 9 Jun 2021 19:10:32 +0000 (21:10 +0200)]
avformat/utils: Avoid overflow in codec_info_duration computation for subtitles

Fixes: signed integer overflow: 9223126845747118112 - -2594073385365397472 cannot be represented in type 'long'
Fixes: 34936/clusterfuzz-testcase-minimized-ffmpeg_dem_MATROSKA_fuzzer-6739888002170880

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
12 days agoavformat/utils: check dts/duration to be representable before using them
Michael Niedermayer [Sun, 18 Apr 2021 20:39:30 +0000 (22:39 +0200)]
avformat/utils: check dts/duration to be representable before using them

Fixes: signed integer overflow: 6854513951393103890 + 3427256975738527712 cannot be represented in type 'long'
Fixes: 32936/clusterfuzz-testcase-minimized-ffmpeg_dem_R3D_fuzzer-5236914752978944

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
12 days agoavcodec/utils: do "calc from frame_bytes, channels, and block_align" in 64bit
Michael Niedermayer [Wed, 28 Apr 2021 14:50:13 +0000 (16:50 +0200)]
avcodec/utils: do "calc from frame_bytes, channels, and block_align" in 64bit

Fixes: signed integer overflow: 104962766 * 32 cannot be represented in type 'int'
Fixes: 33614/clusterfuzz-testcase-minimized-ffmpeg_dem_RSD_fuzzer-6252129036664832

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
12 days agoavcodec/ttadata: Add sentinel at the end of ff_tta_shift_1
Michael Niedermayer [Tue, 8 Jun 2021 18:10:56 +0000 (20:10 +0200)]
avcodec/ttadata: Add sentinel at the end of ff_tta_shift_1

Fixes: out of array access
Fixes: 34933/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TTA_fuzzer-5629322560929792

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
12 days agoavformat/mov: Check for duplicate mdcv
Michael Niedermayer [Tue, 8 Jun 2021 16:14:21 +0000 (18:14 +0200)]
avformat/mov: Check for duplicate mdcv

Fixes: memleak
Fixes: 34932/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5456227658235904

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
12 days agoavformat/flvdec: Check data before casting
Michael Niedermayer [Tue, 8 Jun 2021 16:09:55 +0000 (18:09 +0200)]
avformat/flvdec: Check data before casting

Fixes: -nan is outside the range of representable values of type 'long'
Fixes: signed integer overflow: 1000 * -9223372036854775808 cannot be represented in type 'long'
Fixes: 34890/clusterfuzz-testcase-minimized-ffmpeg_dem_FLV_fuzzer-5334208657620992

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
12 days agolavfi/dnn: Fill Task using Common Function
Shubhanshu Saxena [Sat, 5 Jun 2021 18:08:06 +0000 (23:38 +0530)]
lavfi/dnn: Fill Task using Common Function

This commit adds a common function for filling the TaskItems
in all three backends.

Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
12 days agolavfi/dnn: Use uint8_t for async and do_ioproc in TaskItems
Shubhanshu Saxena [Sat, 5 Jun 2021 18:08:05 +0000 (23:38 +0530)]
lavfi/dnn: Use uint8_t for async and do_ioproc in TaskItems

These properties have values either 0 or 1, so using uint8_t
is a better option as compared to int.

Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
12 days agolavfi/dnn: Add nb_output to TaskItem
Shubhanshu Saxena [Sat, 5 Jun 2021 18:08:04 +0000 (23:38 +0530)]
lavfi/dnn: Add nb_output to TaskItem

Add nb_output property to TaskItem for use in TensorFlow backend
and Native backend.

Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
12 days agolavfi/dnn: Convert output_name to char** in TaskItem
Shubhanshu Saxena [Sat, 5 Jun 2021 18:08:03 +0000 (23:38 +0530)]
lavfi/dnn: Convert output_name to char** in TaskItem

Convert output_name to char **output_names in TaskItem and use it as
a pointer to array of output names in the DNN backend.

Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
12 days agolavfi/dnn: Extract TaskItem and InferenceItem from OpenVino Backend
Shubhanshu Saxena [Sat, 5 Jun 2021 18:08:02 +0000 (23:38 +0530)]
lavfi/dnn: Extract TaskItem and InferenceItem from OpenVino Backend

Extract TaskItem and InferenceItem from OpenVino backend and convert
ov_model to void in TaskItem.

Signed-off-by: Shubhanshu Saxena <shubhanshu.e01@gmail.com>
12 days agolavu/mem: un-inline av_size_mult()
Anton Khirnov [Mon, 31 May 2021 09:25:26 +0000 (11:25 +0200)]
lavu/mem: un-inline av_size_mult()

There seems to be no compelling reason for it to be inline.

12 days agolavf: clarify probesize/format_probesize doxy
Anton Khirnov [Sat, 24 Apr 2021 12:56:10 +0000 (14:56 +0200)]
lavf: clarify probesize/format_probesize doxy

probesize is not used for probing the input format, but its
documentation claims it does.

12 days agodoc: fix generating doxy with out-of-tree builds
Anton Khirnov [Sat, 24 Apr 2021 12:52:27 +0000 (14:52 +0200)]
doc: fix generating doxy with out-of-tree builds

Broken in 753930bc7300dd595c4bab51c5a70d1da9083da4, as the path to
Doxyfile passed to doxy-wrapper.sh is relative to the build dir, while
the recipe cd's to the source dir before invoking the wrapper.

13 days agoavcodec/cuviddec: correctly set key_frame with interlaced content
stuhlo [Fri, 11 Jun 2021 10:27:30 +0000 (12:27 +0200)]
avcodec/cuviddec: correctly set key_frame with interlaced content

Fixes #9283

This fixes setting of 'key_frame' flag in AVFrame when input h264 packets represents individual fields of interlaced video.
In this case, pairs of two consecutive fields represents a single decoded picture and have identical 'CurrPicIdx', however, only
the first field is entirely intra-coded and has the flag 'intra_pic_flag' set and the second field was resetting the flag before
it was even read in the function 'cuvid_output_frame'.

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
13 days agoffmpeg: silence a thread_safe_callbacks deprecation warning
James Almer [Mon, 7 Jun 2021 12:17:05 +0000 (09:17 -0300)]
ffmpeg: silence a thread_safe_callbacks deprecation warning

Signed-off-by: James Almer <jamrial@gmail.com>
13 days agoexamples/muxing: add missing header
James Almer [Fri, 11 Jun 2021 00:19:39 +0000 (21:19 -0300)]
examples/muxing: add missing header

Fixed compilation broken by e67e02d15672.

Signed-off-by: James Almer <jamrial@gmail.com>
13 days agoexamples/extract_mvs: add missing header
James Almer [Fri, 11 Jun 2021 00:19:28 +0000 (21:19 -0300)]
examples/extract_mvs: add missing header

Fixed compilation broken by e67e02d15672.

Signed-off-by: James Almer <jamrial@gmail.com>
13 days agoexamples/demuxing_decoding: add missing header
James Almer [Fri, 11 Jun 2021 00:19:12 +0000 (21:19 -0300)]
examples/demuxing_decoding: add missing header

Fixed compilation broken by e67e02d15672.

Signed-off-by: James Almer <jamrial@gmail.com>
13 days agoavformat: make AVStream.pts_wrap_bits public
James Almer [Wed, 9 Jun 2021 18:04:48 +0000 (15:04 -0300)]
avformat: make AVStream.pts_wrap_bits public

It can be useful to library users, and is currently being used by ffmpeg.c

Suggested-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
13 days agoavfilter/overlay_cuda: support expression of x y position
Steven Liu [Tue, 8 Jun 2021 10:45:03 +0000 (18:45 +0800)]
avfilter/overlay_cuda: support expression of x y position

and add per-frame / init mode for it.

Signed-off-by: Steven Liu <liuqi05@kuaishou.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
13 days agoavformat/mpegtsenc: enable muxing of ARIB captions
zheng qian [Thu, 15 Apr 2021 15:21:33 +0000 (00:21 +0900)]
avformat/mpegtsenc: enable muxing of ARIB captions

Writes a general ARIB stream identifier descriptor, as well
as a data component descriptor which also includes a
pre-defined additional_arib_caption_info structure.

Signed-off-by: zheng qian <xqq@xqq.im>
2 weeks agolavu/video_enc_params: make sure blocks are properly aligned
Anton Khirnov [Thu, 8 Apr 2021 09:16:06 +0000 (11:16 +0200)]
lavu/video_enc_params: make sure blocks are properly aligned

2 weeks agolavf/mp3dec: avoid avcodec.h dependency
Anton Khirnov [Fri, 21 May 2021 17:56:46 +0000 (19:56 +0200)]
lavf/mp3dec: avoid avcodec.h dependency

2 weeks agolavf/mov_chan: avoid avcodec.h dependency
Anton Khirnov [Fri, 21 May 2021 17:56:46 +0000 (19:56 +0200)]
lavf/mov_chan: avoid avcodec.h dependency

2 weeks agolavf/matroska: avoid avcodec.h dependency
Anton Khirnov [Fri, 21 May 2021 17:56:46 +0000 (19:56 +0200)]
lavf/matroska: avoid avcodec.h dependency

2 weeks agolavf/latmenc: avoid avcodec.h dependency
Anton Khirnov [Fri, 21 May 2021 17:35:13 +0000 (19:35 +0200)]
lavf/latmenc: avoid avcodec.h dependency

2 weeks agolavf/id3v1: drop unnecessary avcodec.h include
Anton Khirnov [Fri, 21 May 2021 17:23:50 +0000 (19:23 +0200)]
lavf/id3v1: drop unnecessary avcodec.h include

2 weeks agolavf/hevc: drop unnecessary avcodec.h include
Anton Khirnov [Fri, 21 May 2021 17:23:50 +0000 (19:23 +0200)]
lavf/hevc: drop unnecessary avcodec.h include

2 weeks agolavf/framecrcenc: avoid avcodec.h dependency
Anton Khirnov [Fri, 21 May 2021 17:16:10 +0000 (19:16 +0200)]
lavf/framecrcenc: avoid avcodec.h dependency

2 weeks agolavf/adtsenc: avoid avcodec.h dependency
Anton Khirnov [Fri, 21 May 2021 17:16:10 +0000 (19:16 +0200)]
lavf/adtsenc: avoid avcodec.h dependency

2 weeks agolavf/a64: avoid avcodec.h dependency
Anton Khirnov [Fri, 21 May 2021 17:16:10 +0000 (19:16 +0200)]
lavf/a64: avoid avcodec.h dependency

2 weeks agolavf/avformat.h: drop the avcodec.h include
Anton Khirnov [Fri, 21 May 2021 16:54:50 +0000 (18:54 +0200)]
lavf/avformat.h: drop the avcodec.h include

Since AVStream.codec is gone, avformat.h does not require anything from
avcodec.h.

2 weeks agotools/uncoded_frame: include required headers explicitly
Anton Khirnov [Mon, 31 May 2021 10:16:39 +0000 (12:16 +0200)]
tools/uncoded_frame: include required headers explicitly

2 weeks agolavf/icoenc: include required headers explicitly
Anton Khirnov [Fri, 21 May 2021 16:52:30 +0000 (18:52 +0200)]
lavf/icoenc: include required headers explicitly

2 weeks agolavf/internal: include avcodec.h explicitly
Anton Khirnov [Fri, 21 May 2021 16:28:40 +0000 (18:28 +0200)]
lavf/internal: include avcodec.h explicitly

Do not depend on avformat.h to provide it.

2 weeks agolavfi/lavfutils: include required headers explicitly
Anton Khirnov [Fri, 21 May 2021 16:27:13 +0000 (18:27 +0200)]
lavfi/lavfutils: include required headers explicitly

2 weeks agolavc/get_bits: avoid avcodec.h dependency
Anton Khirnov [Fri, 21 May 2021 16:22:03 +0000 (18:22 +0200)]
lavc/get_bits: avoid avcodec.h dependency

Include only defs.h, needed for AV_INPUT_BUFFER_PADDING_SIZE.

2 weeks agolavc/hevc_sei: include buffer.h explicitly
Anton Khirnov [Mon, 31 May 2021 10:01:45 +0000 (12:01 +0200)]
lavc/hevc_sei: include buffer.h explicitly

Do not rely on including it indirectly through get_bits.h->avcodec.h

2 weeks agolavc/mlp_parse: add required includes explicitly
Anton Khirnov [Fri, 21 May 2021 16:21:19 +0000 (18:21 +0200)]
lavc/mlp_parse: add required includes explicitly

2 weeks agolavc/dolby_e_parser: #include avcodec.h explicitly
Anton Khirnov [Fri, 21 May 2021 16:19:39 +0000 (18:19 +0200)]
lavc/dolby_e_parser: #include avcodec.h explicitly

This file uses definitions from it, but relies on an indirect include
through get_bits.h

2 weeks agolavc/cbs_internal: clean up headers
Anton Khirnov [Tue, 2 Mar 2021 09:57:46 +0000 (10:57 +0100)]
lavc/cbs_internal: clean up headers

Include all required headers explicitly, avoid avcodec.h dependency.

2 weeks agolavc/cbs: avoid avcodec.h dependency
Anton Khirnov [Tue, 2 Mar 2021 09:55:16 +0000 (10:55 +0100)]
lavc/cbs: avoid avcodec.h dependency

Include only the headers that are actually needed.

2 weeks agolavc/cbs_bsf.h: explicitly #include all required headers
Anton Khirnov [Tue, 2 Mar 2021 09:53:50 +0000 (10:53 +0100)]
lavc/cbs_bsf.h: explicitly #include all required headers

2 weeks agolavc: move av_get_profile_name() from avcodec.h to codec.h
Anton Khirnov [Fri, 21 May 2021 16:58:23 +0000 (18:58 +0200)]
lavc: move av_get_profile_name() from avcodec.h to codec.h

2 weeks agolavc: move av_get_audio_frame_duration2() from avcodec.h to codec_par.h
Anton Khirnov [Fri, 21 May 2021 16:58:23 +0000 (18:58 +0200)]
lavc: move av_get_audio_frame_duration2() from avcodec.h to codec_par.h

2 weeks agolavc: move av_get_pcm_codec() from avcodec.h to codec_id.h
Anton Khirnov [Mon, 31 May 2021 10:13:51 +0000 (12:13 +0200)]
lavc: move av_get_pcm_codec() from avcodec.h to codec_id.h

2 weeks agolavc: move avcodec_profile_name() from avcodec.h to codec_id.h
Anton Khirnov [Fri, 21 May 2021 17:07:09 +0000 (19:07 +0200)]
lavc: move avcodec_profile_name() from avcodec.h to codec_id.h