Commit Graph

23822 Commits

Author SHA1 Message Date
Nick Ruff
ea24781a9b lavf/rtmp: Add option to set TCP_NODELAY for rtmp
Suggested-By: ffmpeg@fb.com
2021-06-20 22:45:35 +02:00
Matthieu Patou
52795d7f09 lavf/webmdashenc.c: Allow AV1 video in WebM
Suggested-By: ffmpeg@fb.com
2021-06-20 22:30:38 +02:00
Michael Niedermayer
602bbf71f6 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>
2021-06-20 17:43:47 +02:00
Michael Niedermayer
06d174e289 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>
2021-06-18 18:58:25 +02:00
Michael Niedermayer
fe12aa6890 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>
2021-06-18 18:58:25 +02:00
Michael Niedermayer
1b865cc703 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>
2021-06-18 18:58:25 +02:00
Michael Niedermayer
88fc295838 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>
2021-06-18 18:58:25 +02:00
Michael Niedermayer
1ca00b5e44 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>
2021-06-18 18:58:25 +02:00
Michael Niedermayer
a1a277926b 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>
2021-06-18 18:58:25 +02:00
Michael Niedermayer
e7a990164f 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>
2021-06-18 18:58:25 +02:00
Michael Niedermayer
8ef25d1182 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>
2021-06-18 18:58:25 +02:00
Michael Niedermayer
ff05326081 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>
2021-06-18 18:58:25 +02:00
Michael Niedermayer
93d964689c 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>
2021-06-18 18:58:25 +02:00
Michael Niedermayer
6ea494befc 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>
2021-06-18 18:58:25 +02:00
Michael Niedermayer
b72d657b73 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>
2021-06-18 18:58:25 +02:00
Kevin LaFlamme
7d1464721e 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.
2021-06-14 21:47:09 +05:30
Limin Wang
f21626b67b avformat/dashenc: use av_match_ext()
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-06-14 21:11:24 +05:30
Valerii Zapodovnikov
91ba771a3f 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.
2021-06-13 22:04:14 +02:00
Michael Niedermayer
480f11bdd7 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>
2021-06-12 14:22:42 +02:00
Michael Niedermayer
ffe4851e23 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>
2021-06-12 14:22:42 +02:00
Michael Niedermayer
bf4e7ec825 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>
2021-06-12 14:22:42 +02:00
Michael Niedermayer
f54d85cee6 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>
2021-06-12 14:22:42 +02:00
Michael Niedermayer
1e24da5cfe 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>
2021-06-12 14:22:42 +02:00
Anton Khirnov
71c0ef882e lavf: clarify probesize/format_probesize doxy
probesize is not used for probing the input format, but its
documentation claims it does.
2021-06-11 19:42:24 +02:00
James Almer
2cccab96f6 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>
2021-06-10 18:37:26 -03:00
zheng qian
f38458089f 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>
2021-06-10 23:16:55 +03:00
Anton Khirnov
1256b71ba9 lavf/mp3dec: avoid avcodec.h dependency 2021-06-10 16:51:44 +02:00
Anton Khirnov
c9642265f8 lavf/mov_chan: avoid avcodec.h dependency 2021-06-10 16:51:44 +02:00
Anton Khirnov
823ca1ba84 lavf/matroska: avoid avcodec.h dependency 2021-06-10 16:51:44 +02:00
Anton Khirnov
f3dafe6a41 lavf/latmenc: avoid avcodec.h dependency 2021-06-10 16:51:44 +02:00
Anton Khirnov
e246625b01 lavf/id3v1: drop unnecessary avcodec.h include 2021-06-10 16:51:44 +02:00
Anton Khirnov
5620d18e66 lavf/hevc: drop unnecessary avcodec.h include 2021-06-10 16:51:44 +02:00
Anton Khirnov
f79d009b7c lavf/framecrcenc: avoid avcodec.h dependency 2021-06-10 16:51:44 +02:00
Anton Khirnov
239b7d2e40 lavf/adtsenc: avoid avcodec.h dependency 2021-06-10 16:51:44 +02:00
Anton Khirnov
e7196afe28 lavf/a64: avoid avcodec.h dependency 2021-06-10 16:51:44 +02:00
Anton Khirnov
e67e02d156 lavf/avformat.h: drop the avcodec.h include
Since AVStream.codec is gone, avformat.h does not require anything from
avcodec.h.
2021-06-10 16:51:44 +02:00
Anton Khirnov
51200769c3 lavf/icoenc: include required headers explicitly 2021-06-10 16:51:44 +02:00
Anton Khirnov
c4c6c83421 lavf/internal: include avcodec.h explicitly
Do not depend on avformat.h to provide it.
2021-06-10 16:51:44 +02:00
James Almer
591b88e678 avformat: move AVStream.{first,cur}_dts to AVStreamInternal
They are private fields, no reason to have them exposed in a public header.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-06-09 13:55:25 -03:00
James Almer
c768233293 avformat/utils: make ff_update_cur_dts() shared
libavdevice needs it.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-06-09 13:55:25 -03:00
Zhao Zhili
58614f7bee avformat/libsrt: workaround conflict with ffmpeg cmdline option
Add 'srt_streamid' option as an alias for 'streamid'.

Signed-off-by: Marton Balint <cus@passwd.hu>
2021-06-09 00:09:33 +02:00
Zhao Zhili
55c54ff744 avformat/libsrt: add tsbpd option
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-06-09 00:07:10 +02:00
Zhao Zhili
9099046cc7 avformat/libsrt: send message in order
There is no good use case for out of order delivery of data. For live
streaming with TSBPD enabled by default, the receiver get data in order
based on the timestamps. However, if TSBPD is disabled, the data can
be delivered out of order.

Signed-off-by: Marton Balint <cus@passwd.hu>
2021-06-09 00:07:10 +02:00
Valerii Zapodovnikov
812f39ee85 Revert "avformat/dashenc: Disable writing CODECS tag for HEVC streams"
This reverts commit d6d407d2d7.
Hack not needed after a2b1dd0ce3.
Will fix #7480 and #8904.
This will include e.g. CODECS="hvc1.2.4.L123.B0" into m3u8.

Signed-off-by: Valerii Zapodovnikov <val.zapod.vz@gmail.com>
2021-06-08 22:59:26 +05:30
Michael Niedermayer
a0a4a527c3 avformat/rpl: Check for EOF and zero framesize
Fixes: Infinite loop
Fixes: 34751/clusterfuzz-testcase-minimized-ffmpeg_dem_RPL_fuzzer-5439330800762880
Fixes: 34774/clusterfuzz-testcase-minimized-ffmpeg_dem_RPL_fuzzer-5851571660390400

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-06-08 18:00:05 +02:00
Michael Niedermayer
29b244ffc1 avformat/rpl: Use 64bit in bitrate computation and check it
Fixes: signed integer overflow: 777777776 * 4 cannot be represented in type 'int'
Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_RPL_fuzzer-6726188921913344

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-06-05 16:59:37 +02:00
Gyan Doshi
071930de72 avformat/mov: add option to use tfdt for fragment timestamps. 2021-06-02 10:46:04 +05:30
Joel Linn
127c40c9ca avcodec/movenc: fix spelling in warning message
hldr -> hdlr
2021-06-01 23:49:35 +05:30
Przemysław Sobala
575e52272d lavf/dashenc.c: Fix creating audio-only HLS playlists
With audio/video HLS playlists, audio chunklists are treated as
alternative renditions for video chunklists. This is wrong for
audio-only HLS playlists.

fixes: 9252
2021-06-01 11:58:26 +05:30
Gyan Doshi
51f1194eda avformat/hls: relay format options to segment demuxer
Signed-off-by: Gyan Doshi <ffmpeg@gyani.pro>
Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
2021-05-30 09:21:19 +05:30