summaryrefslogtreecommitdiff
path: root/libavformat
Commit message (Collapse)AuthorAge
* avformat/av1dec: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-07
| | | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/assdec: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-07
| | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/aqtitledec: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-07
| | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/ape: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-07
| | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/avidec: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-07
| | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/aaxdec: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-07
| | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/aadec: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-07
| | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/4xm: Simplify cleanup after read_header failureAndreas Rheinhardt2021-07-07
| | | | | | by setting the FF_FMT_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat: Redo cleanup of demuxers upon read_header() failureAndreas Rheinhardt2021-07-07
| | | | | | | | | | | | | | | | | | | | If reading the header fails, the demuxer's read_close() function (if existing) is not called automatically; instead several demuxers call it via "goto fail" in read_header(). This commit intends to change this by adding an internal flag for demuxers that can be used to set on a per-AVInputFormat basis whether read_close() should be called generically after an error during read_header(). The flag controlling this behaviour needs to be added because it might be unsafe to call read_close() generally (e.g. this might lead to read_close() being called twice and this might e.g. lead to double-frees if av_free() is used instead of av_freep(); or a size field has not been reset after freeing the elements (see the mov demuxer for an example of this)). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat: Add internal flags for AV(In|Out)putFormatAndreas Rheinhardt2021-07-07
| | | | | | | | | | | | | | | | Both AVInputFormat and AVOutputFormat currently lack an equivalent to AVCodec's caps_internal. E.g. if reading a header fails, each demuxer is currently required to clean up manually, which often means to just call the demuxer's read_close function. This could (and will) be done generically via an equivalent of FF_CODEC_CAP_INIT_CLEANUP. Because of the unholy ABI-relationship between libavdevice and libavformat adding such a flag is only possible when the ABI is open (despite the flag not being part of the public API), such as now. Therefore such a flag is also added to AVOutputFormat, despite there being no immediate use for it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskadec: Fix handling of huge default durationsMichael Niedermayer2021-07-06
| | | | | | | | Fixes: negation of -9223372036854775808 cannot be represented in type 'int64_t' (aka 'long'); cast to an unsigned type to negate this value to itself Fixes: 33997/clusterfuzz-testcase-minimized-ffmpeg_dem_WEBM_DASH_MANIFEST_fuzzer-6752039691485184 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavformat/rtpdec_rfc4175: Check for zero pgroup before modKyle Schwarz2021-07-06
| | | | Signed-off-by: Kyle Schwarz <zeranoe@gmail.com>
* avformat/rtsp: Include rtcp in port range checkAndriy Gelman2021-07-05
| | | | | | | Currently it is only checked that the rtp port does not exceed rtp_port_max. Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
* avformat/rtsp: Reindent after previous commitAndriy Gelman2021-07-05
| | | | | Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
* avformat/rtsp: Set port_off to zero for low min/max port rangeAndriy Gelman2021-07-05
| | | | | | | | | Fixes: $ ffmpeg -min_port 32000 -max_port 32001 -i rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov -f null - [1] 303871 floating point exception (core dumped) Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
* avformat/rtsp: Fix timeout optionAndriy Gelman2021-07-05
| | | | | | | | | | | | | | | | | | | | | | | 92c40ef882be115e72d2aa02f9032b7ce88f8537 added a listen_timeout option for sdp. This allowed a user to set variable timeout which was originally hard coded to 10 seconds. The commit used the initial_timeout variable to store the value. But this variable is shared with rtsp where it's used to infer a "listen" mode. Thus, the timeout value could not be set in rtsp, and the default value (initial_timeout = -1) would give 100ms timeout. This was attempted to be fixed in c8101aabee654f6d147a4d89f77fa73e18908610, which changed the meaning of initial_timeout = -1 to be an infinite timeout. However, it did not address the issue that the timeout could still not be set. Being able to set the timeout is useful because it allows to automatically reconfigure from a udp to tcp connection in the lower transport. In this commit this is fixed by using the stimeout variable to store the timeout value. Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
* avformat/ftp: Check for av_strtok() failureMichael Niedermayer2021-07-03
| | | | | | Fixes: CID1396258 Dereference null return value Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat: add a concat protocol that takes a line break delimited list of ↵James Almer2021-07-02
| | | | | | | | resources Suggested-by: ffmpeg@fb.com Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/movenc: Support encryption of H.265 stream in AnnexB formatVadym Bezdushnyi2021-06-29
| | | | | | | | | | | | | | | | Steps to test: 1. Create h265 test files - mp4 and h265 AnnexB streams: ffmpeg -f lavfi -i testsrc=duration=10:size=640x480:rate=30 -c:v hevc input_h265.mp4 ffmpeg -f lavfi -i testsrc=duration=10:size=640x480:rate=30 -c:v hevc -bsf:v hevc_mp4toannexb input_h265.h265 2. Encrypt and decrypt files. Put appropriate input file name here: input_h265.mp4 or input_h265.h265 ffmpeg -i input_h265.h265 -vcodec copy -acodec copy -encryption_scheme cenc-aes-ctr \ -encryption_key 00000000000000000000000000000000 -encryption_kid 00000000000000000000000000000000 \ encrypted_h265.mp4 ffplay -i encrypted_h265.mp4 -decryption_key 00000000000000000000000000000000 Signed-off-by: Vadym Bezdushnyi <vadim.bezdush@gmail.com>
* avformat/http: Stop cookie_dict leaking on errors.Robert Bengtsson-Ölund2021-06-26
| | | | | | This solves the memory leak reported in https://trac.ffmpeg.org/ticket/9273 Signed-off-by: Robert Bengtsson-Ölund <robert.bengtsson-olund@intinor.se>
* lavf/rtmp: Add option to set TCP_NODELAY for rtmpNick Ruff2021-06-20
| | | | Suggested-By: ffmpeg@fb.com
* lavf/webmdashenc.c: Allow AV1 video in WebMMatthieu Patou2021-06-20
| | | | Suggested-By: ffmpeg@fb.com
* avformat/aaxdec: Check avio_seek() in header readingMichael Niedermayer2021-06-20
| | | | | | | | 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>
* avformat/rmdec: Check old_format len for overflowMichael Niedermayer2021-06-18
| | | | | | | | | | | 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>
* avformat/realtextdec: Check the pts difference before using it for the ↵Michael Niedermayer2021-06-18
| | | | | | | | | | 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>
* avformat/qcp: Avoid negative nb_ratesMichael Niedermayer2021-06-18
| | | | | | | | 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>
* avformat/pp_bnk: Use 64bit in bitrate computationMichael Niedermayer2021-06-18
| | | | | | | | 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>
* avformat/nutdec: Check tmp_sizeMichael Niedermayer2021-06-18
| | | | | | | | 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>
* avformat/msf: Check that channels doesnt overflow during extradata constructionMichael Niedermayer2021-06-18
| | | | | | | | 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>
* avformat/subtitles: Check pts difference before useMichael Niedermayer2021-06-18
| | | | | | | | 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>
* avformat/mpc8: Check for position overflow in mpc8_handle_chunk()Michael Niedermayer2021-06-18
| | | | | | | | | 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>
* avformat/mccdec: Fix overflows in num/denMichael Niedermayer2021-06-18
| | | | | | | | 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>
* avformat/iff: Use 64bit in duration computationMichael Niedermayer2021-06-18
| | | | | | | | 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>
* avformat/dxa: Check fps to be within the supported range more precisselyMichael Niedermayer2021-06-18
| | | | | | | | | 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>
* avformat/tta: Check for EOF in index reading loopMichael Niedermayer2021-06-18
| | | | | | | | 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>
* dashenc: Write out DASH manifest immediately in streaming modeKevin LaFlamme2021-06-14
| | | | | | | | | | | | | | 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.
* avformat/dashenc: use av_match_ext()Limin Wang2021-06-14
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/mxfdec: fixed jp2k_rsiz and 170M matrixValerii Zapodovnikov2021-06-13
| | | | | | | 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.
* avformat/rpl: The associative law doesnt hold for signed integers in CMichael Niedermayer2021-06-12
| | | | | | | | | 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>
* avformat/utils: Avoid overflow in codec_info_duration computation for subtitlesMichael Niedermayer2021-06-12
| | | | | | | | 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>
* avformat/utils: check dts/duration to be representable before using themMichael Niedermayer2021-06-12
| | | | | | | | 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>
* avformat/mov: Check for duplicate mdcvMichael Niedermayer2021-06-12
| | | | | | | | 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>
* avformat/flvdec: Check data before castingMichael Niedermayer2021-06-12
| | | | | | | | | 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>
* lavf: clarify probesize/format_probesize doxyAnton Khirnov2021-06-11
| | | | | probesize is not used for probing the input format, but its documentation claims it does.
* avformat: make AVStream.pts_wrap_bits publicJames Almer2021-06-10
| | | | | | | 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>
* avformat/mpegtsenc: enable muxing of ARIB captionszheng qian2021-06-10
| | | | | | | | 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>
* lavf/mp3dec: avoid avcodec.h dependencyAnton Khirnov2021-06-10
|
* lavf/mov_chan: avoid avcodec.h dependencyAnton Khirnov2021-06-10
|
* lavf/matroska: avoid avcodec.h dependencyAnton Khirnov2021-06-10
|
* lavf/latmenc: avoid avcodec.h dependencyAnton Khirnov2021-06-10
|