summaryrefslogtreecommitdiff
path: root/libavformat
Commit message (Collapse)AuthorAge
...
* avformat/matroskaenc: Improve handling of AV1 extradataAndreas Rheinhardt2022-06-24
| | | | | | | | | | | | Up until now, only the first four bytes (the ones preceding the OBU) were written because not enough space has been reserved for the complete CodecPrivate. This commit changes this by increasing the space reserved for the CodecPrivate (it is big enough for every sane sequence header plus something extra); the code falls back to writing four bytes in case the increased space turns out to be insufficient. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskaenc: Split updating CodecPrivate from writing itAndreas Rheinhardt2022-06-24
| | | | | | | | | | | | | | | | | | | | | | Up until now, updating extradata was very ad-hoc: The amount of space reserved for extradata was not recorded when writing the header; instead the AAC code simply presumed that it was enough. This commit changes this by recording how much space is available. This brings with it that the code for writing of and reserving space for the CodecPrivate and for updating it diverges. They are therefore split; this allows to put other common tasks like seeking to right offset as well as writing padding (in case the new extradata did not fill the whole reserved space) to this common function. The code for filling up the reserved space is smarter than the code it replaces; therefore it is no longer necessary to reserve more than necessary just to be sure that one can add an EBML Void element (whose minimum size is two) lateron. This is the reason for the change to the aac-autobsf-adtstoasc test. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskaenc: Avoid swapping codecpar->extradata temporarilyAndreas Rheinhardt2022-06-24
| | | | | | | | | | Instead pass extradata and extradata_size explicitly. (It is not perfect, as ff_put_(wav|bmp)_header() still uses the extradata embedded in codecpar, but this is not an issue as long as their CodecPrivate isn't updated.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskaenc: Split assembling CodecPrivate from writing itAndreas Rheinhardt2022-06-24
| | | | | | | This is in preparation for splitting writing and updating extradata more thoroughly later. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/movenc: enable compressorname for mp4 modeZhao Zhili2022-06-24
| | | | Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/hls: Limit start_seq_no to one bit lessMichael Niedermayer2022-06-23
| | | | | | | | | | | This avoids overflow checks on additions with 32bit numbers Fixes: signed integer overflow: 9223372036854775806 + 2 cannot be represented in type 'long' Fixes: 44012/clusterfuzz-testcase-minimized-ffmpeg_dem_HLS_fuzzer-4747770734444544 Fixes: 48065/clusterfuzz-testcase-minimized-ffmpeg_dem_HLS_fuzzer-5372410355908608 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavformat: Remove MAX_PATH limit and use UTF-8 version of getenv()Nil Admirari2022-06-21
| | | | | | | | | 1. getenv() is replaced with getenv_utf8() across libavformat. 2. New versions of AviSynth+ are now called with UTF-8 filenames. 3. Old versions of AviSynth are still using ANSI strings, but MAX_PATH limit on filename is removed. Signed-off-by: Martin Storsjö <martin@martin.st>
* avformat/matroskaenc: Don't check twice whether to write tagsAndreas Rheinhardt2022-06-20
| | | | | | | | | | | | | | | Because not all metadata is written as tags, the Matroska muxer filters out the tags that are not written as tags. Therefore the code first checks whether a Tag master element needs to be opened for a given stream/chapter/attachment/global metadata. If the answer turns out to be yes, it is checked again whether a given AVDictionaryEntry is written as a tag. This commit changes this: The Tag element is opened unconditionally and in case it turns out that it was unneeded, it is discarded again. This is possible because the Tag element is written into its own dynamic buffer. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskaenc: Don't waste bytes to Write Tag length fieldsAndreas Rheinhardt2022-06-20
| | | | | | | This is possible by using a dynamic buffer to write them; said dynamic buffer is (re)used and reset as appropriate. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mpegts: remove obsolate hacks for detecting streams with bad PMTsMarton Balint2022-06-20
| | | | | | | | | Ffmpeg/ffprobe/ffplay sets scan_all_pmts to 1 when finding the streams, that should be enough to handle files for which some early PMTs miss some streams. Fixes ticket #9782. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/librist: bump required version to 0.2.7Marton Balint2022-06-18
| | | | | | This is the first version for which fifo size setting actually works. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/aiffdec: avoid integer overflow in get_meta()Michael Niedermayer2022-06-17
| | | | | | | | Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int' Fixes: 45891/clusterfuzz-testcase-minimized-ffmpeg_dem_AIFF_fuzzer-6159183893889024 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/aaxdec: Check for overlaping segmentsMichael Niedermayer2022-06-17
| | | | | | | | Fixes: Timeout Fixes: 45875/clusterfuzz-testcase-minimized-ffmpeg_dem_AAX_fuzzer-6121689903136768 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/demux: Count EAGAIN as 100 bytes in relation to read limit in ↵Michael Niedermayer2022-06-17
| | | | | | | | | | | avformat_find_stream_info() Fixes: Timeout Fixes: 43717/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-5206008287330304 Fixes: 45738/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-6142535657979904 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/demux: Make read_frame_internal() return AVERREOR(EAGAIN) on stuck ↵Michael Niedermayer2022-06-17
| | | | | | | | | | empty input parser Fixes: read_frame_internal() which does not return even though both demuxer and parser do return Fixes: 43717/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-5206008287330304 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/matroskaenc: Convert chapter metadataAndreas Rheinhardt2022-06-16
| | | | | | | | | | | | It is no longer converted since mkv_write_chapters() is called before mkv_write_tags() which happens since commit 4ebfc13c338423cf48f1a1266c890422367f7775. Given the fact that chapters can also be written late, mkv_write_chapters() has to convert the metadata itself. Fixes ticket #9812. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskaenc: Reset cur_master_element when discarding masterAndreas Rheinhardt2022-06-16
| | | | | | | | | | | | | | Before this patch the muxer writes an invalid file (namely one in which the Projection master is a child of the Colour element) if the following conditions are met: a) The stream contains AVMasteringDisplayMetadata without primaries and luminance (i.e. useless AVMasteringDisplayMetadata). b) The stream contains AV_PKT_DATA_SPHERICAL side data. c) All the colour elements of the stream are equal to default (i.e. unknown). Fortunately these conditions are very unlikely to be met. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mxfdec: Offload allocating string to av_dict_set()Andreas Rheinhardt2022-06-16
| | | | | Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mxfdec: Use ff_data_to_hex() for data->hex conversionAndreas Rheinhardt2022-06-16
| | | | | | | | | | In this case it also stops pretending that the length of the output string is somehow checked (which is currently being done by using snprintf that is called with the amount of space needed instead of the amount of space actually available). Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mxfdec: Don't duplicate av_uuid_unparseAndreas Rheinhardt2022-06-16
| | | | | | | | Also don't allocate the string ourselves, let av_dict_set() do it. Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mxf: Use AVUUID for uidsAndreas Rheinhardt2022-06-16
| | | | | | | This is in preparation for using av_uuid functions directly. Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/ape: more bits in size for less overflowsMichael Niedermayer2022-06-14
| | | | | | | | Fixes: signed integer overflow: 2147483647 + 3 cannot be represented in type 'int' Fixes: 46184/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-4678059519770624 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: Non overflowing ambisonic order checkMichael Niedermayer2022-06-14
| | | | | | | | Fixes: signed integer overflow: 536870913 * 536870913 cannot be represented in type 'int' Fixes: 45862/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-4730373768085504 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/avio: add avio_vprintf()Stefano Sabatini2022-06-13
| | | | | | | This new function makes it possible to use avio_printf() functionality from a function taking a variable list of arguments. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/imf: refactor to use avutil/uuidPierre-Anthony Lemieux2022-06-12
|
* avformat/smoothstreamingenc: refactor to use avutil/uuidPierre-Anthony Lemieux2022-06-12
|
* avformat/mov: refactor to use avutil/uuidPierre-Anthony Lemieux2022-06-12
|
* avformat/os_support: use windows stat structs with 64bit time_tsoftworkz2022-06-11
| | | | | Signed-off-by: softworkz <softworkz@hotmail.com> Signed-off-by: Martin Storsjö <martin@martin.st>
* avformat/librist: allow setting fifo size and fail on overflowGijs Peskens2022-06-09
| | | | | | | | | | Introduce fifo_size and overrun_nonfatal params to configure fifo buffer behavior. Use newly introduced RIST_DATA_FLAGS_OVERFLOW flag to check for overrun and error out in that case. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/aviobuf: Check buf_size in ffio_ensure_seekback()Michael Niedermayer2022-06-09
| | | | | | | | | buffer_size is an int Fixes: signed integer overflow: 9223372036854775754 + 32767 cannot be represented in type 'long' Fixes: 45691/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-5263458831040512 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/bfi: Check offsets betterMichael Niedermayer2022-06-09
| | | | | | | | Fixes: signed integer overflow: -2145378272 - 538976288 cannot be represented in type 'int' Fixes: 45690/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-5015496544616448 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/asfdec_f: Check packet_frag_timestampMichael Niedermayer2022-06-09
| | | | | | | | Fixes: signed integer overflow: -9223372036854775808 - 4607 cannot be represented in type 'long' Fixes: 45685/clusterfuzz-testcase-minimized-ffmpeg_IO_DEMUXER_fuzzer-5280102802391040 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/file: remove _WIN32 conditionsoftworkz2022-06-09
| | | | | | | | stat is now re-mapped with long path support in os_support.h Signed-off-by: softworkz <softworkz@hotmail.com> Signed-off-by: Martin Storsjö <martin@martin.st>
* avformat/os_support: Support long file names on Windowssoftworkz2022-06-09
| | | | | Signed-off-by: softworkz <softworkz@hotmail.com> Signed-off-by: Martin Storsjö <martin@martin.st>
* libavformat/tls_libtls: handle TLS_WANT_{POLLIN, POLLOUT} in read/write ↵Matthieu Bouron2022-06-08
| | | | | | | | | | | | | | | functions According to the tls documentation: tls_read() and tls_write() can return TLS_WANT_POLLIN and TLS_WANT_POLLOUT which indicates that the same operation must be repeated immediately. This commit prevents the libtls backend from failing when libtls returns TLS_WANT_POLLIN or TLS_WANT_POLLOUT with the following error: [tls @ 0x7f6e20005a00] (null) Signed-off-by: Marton Balint <cus@passwd.hu>
* lavf/matroskadec: stop mapping text/plain attachments to AV_CODEC_ID_TEXTAnton Khirnov2022-06-08
| | | | | | There is no reason to think that an attachment will contain text subtitles. Furthermore, attachments are exported in extradata, so the AV_CODEC_ID_TEXT decoder would not do anything useful with them anyway.
* libavformat/isom: Add more language mappingsIvan Baykalov2022-06-07
| | | | | | | | | mov_mdhd_language_map table doesn't contain ISO 639 codes for some of the languages. I added a few which have no contradictory mappings Fixes ticket #9743 Signed-off-by: Anton Khirnov <anton@khirnov.net>
* avcodec: add QOI decoder and demuxer and parser and encoder and muxerPaul B Mahol2022-06-05
|
* avformat/matroskadec: assert non NULL bufMichael Niedermayer2022-05-26
| | | | | | | | | The code is only called if size is > 0 so buf should not be NULL Helps: CID610554 Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/act: Check ff_get_wav_header() for failureMichael Niedermayer2022-05-26
| | | | | | | Fixes: missing error check Fixes: CID717495 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/jpegxl_probe: Check init_get_bits8() for failureMichael Niedermayer2022-05-26
| | | | | | | Fixes: missing error check Fixes: CID1504270 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Switch uses of av_fopen_utf8 to avpriv_fopen_utf8Martin Storsjö2022-05-23
| | | | | | The former has been deprecated. Signed-off-by: Martin Storsjö <martin@martin.st>
* avformat/sccenc: avoid potential invalid accessLimin Wang2022-05-19
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* Makefile: remove sccenc dependency on subtitlesLimin Wang2022-05-19
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/img2: Add support for AVIF mux in image2Vignesh Venkatasubramanian2022-05-19
| | | | | | | | | Add support for AVIF muxing in the image2 muxer. Tested with this example: ffmpeg -lavfi testsrc=duration=1:size=320x320 -g 1 -flags global_header -c:v libaom-av1 -f image2 img-%2d.avif Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
* avformat/hls, dashdec: Don't use AV_OPT flags in av_dict_set()Andreas Rheinhardt2022-05-16
| | | | | | | | | | | | | | | | | av_dict_set() expects a different set of flags, namely the AV_DICT_* flags. Using AV_OPT_FLAG_DECODING_PARAM (or any AV_OPT_FLAG_*) ic av_dict_set() is therefore completely wrong and given that av_dict_set() just doesn't care about whether the string it receives has anything to do with a decoding parameter or not, it should just be removed without replacement. (The numerical value of AV_OPT_FLAG_DECODING_PARAM currently coincides with AV_DICT_IGNORE_SUFFIX. Given that the dictionaries we are dealing with here are always empty (i.e. NULL) before the calls to av_dict_set(), this flag changes nothing. It would be different if it were equal to one of the AV_DICT_DONT_STRDUP_* values.) Reviewed-by: Jan Ekström <jeebjp@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/ac3: Move non-(de|en)coder-only parts out of ac3.hAndreas Rheinhardt2022-05-15
| | | | | | | | | | Move AC3HeaderInfo into ac3_parser_internal.h and the rest into a new header ac3defs.h. This also breaks an include cycle of ac3.h and ac3tab.h (the latter now only needs ac3defs.h). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/dashdec: accept and relay CENC decryption keyGyan Doshi2022-05-14
| | | | | Allows to process CENC-encrypted media segments. Option arg syntax is same as that for option decryption_key in MOV demuxer
* avformat/movenc: Add support for AVIF muxingVignesh Venkatasubramanian2022-05-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add an AVIF muxer by re-using the existing the mov/mp4 muxer. AVIF Specification: https://aomediacodec.github.io/av1-avif Sample usage for still image: ffmpeg -i image.png -c:v libaom-av1 -still-picture 1 image.avif Sample usage for animated AVIF image: ffmpeg -i video.mp4 animated.avif We can re-use any of the AV1 encoding options that will make sense for image encoding (like bitrate, tiles, encoding speed, etc). The files generated by this muxer has been verified to be valid AVIF files by the following: 1) Displays on Chrome (both still and animated images). 2) Displays on Firefox (only still images, firefox does not support animated AVIF yet). 3) Verified to be valid by Compliance Warden: https://github.com/gpac/ComplianceWarden Fixes the encoder/muxer part of Trac Ticket #7621 Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>
* avformat/av1: Add a parameter to av1c to omit seq headerVignesh Venkatasubramanian2022-05-13
| | | | | | | | | Add a parameter to omit seq header when generating the av1C atom. For now, this does not change any behavior. This will be used by a follow-up patch to add AVIF support. Signed-off-by: Vignesh Venkatasubramanian <vigneshv@google.com>