summaryrefslogtreecommitdiff
path: root/libavformat
Commit message (Collapse)AuthorAge
...
* 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>
* avformat/hlsenc: check discont_program_date_time before use it in parse_playlistSteven Liu2022-05-12
| | | | | | | | | | Fix ticket: 9238 In parse_playlist, the discont_program_date_time should be used after EXT-X-PROGRAM-DATE-TIME tag parsed. Tested-by: pero Reviewed-by: Zhao Zhili <zhilizhao@tencent.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat/internal: Hide BSF stuff only used by the core APIsAndreas Rheinhardt2022-05-12
| | | | | | | | | | | | | | | | | | | | | The general demuxing API uses bitstream filters to extract extradata and the muxing API uses them in order to transform packets into the format desired by the target format. Therefore FFStream contains pointers to AVBSFContexts and lavf/internal.h includes lavc/bsf.h. Yet actually, only a few files files are supposed to use these, namely avformat.c, demux.c and mux.c. For all the other files, it should be an opaque type that they should not touch and that they need not know anything about. This can be achieved by not including these headers and using the structs instead of the corresponding typedefs. This also forces translation units that really use the BSF API themselves to include lavc/bsf.h directly instead of relying on indirect inclusions (a few other files also use the BSF API; they already abided by this). Of course, it also avoids unnecessary rebuilds when bsf.h changes. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/internal: Move FFERROR_REDO to demux.hAndreas Rheinhardt2022-05-12
| | | | | | It is demuxer-only. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/http: remove unused function ff_http_get_shutdown_statusSteven Liu2022-05-12
| | | | | | ff_http_get_shutdown_status is unused after ticket 9010 fixed. Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* lavf/matroskaenc: enable PGS merge auto bsfJohn Stebbins2022-05-10
| | | | | | PGS segments must be merged to one packet for muxing to mkv Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/utils: Move ff_format_io_close.* to options.c, avformat.cAndreas Rheinhardt2022-05-10
| | | | | | | These are not pure avio-functions, but auxiliary AVFormatContext functions. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/utils: Move ff_stream_side_data_copy to avformat.cAndreas Rheinhardt2022-05-10
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/utils: Move avpriv_set_pts_info() to avformat.cAndreas Rheinhardt2022-05-10
| | | | | | It is an essential auxiliary function for both demuxing and muxing. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/utils: Move ff_copy_whiteblacklists to avformat.cAndreas Rheinhardt2022-05-10
| | | | | | This is an auxiliary function for AVFormatContexts. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/utils: Move ff_format_set_url to avformat.cAndreas Rheinhardt2022-05-10
| | | | | | | An auxiliary function for AVFormatContexts (mainly muxers, but potentially (e.g. rtsp) also demuxers). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/utils: Move ff_is_intra_only to avformat.cAndreas Rheinhardt2022-05-10
| | | | | | | It is an auxiliary function only used by the generic muxing and demuxing code. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/utils: Move ff_find_stream_index to demux_utils.cAndreas Rheinhardt2022-05-10
| | | | | | | It is only used by demuxers (and it is generally demuxers who have to translate format-specific IDs to stream indices). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/asf: Move ASF GUIDs to a new fileAndreas Rheinhardt2022-05-10
| | | | | | | | | | | They are also needed by the MMSH and MMST protocols and therefore the file they are in is pulled in when these protocols are enabled and used. By moving them to a separate file, linking statically to libavformat while only using AVIO no longer pulls in all the muxers/demuxers (and also no longer any AVCodecs when linking statically to libavcodec). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/utils: Move av_find_best_stream to avformat.cAndreas Rheinhardt2022-05-10
| | | | | | | | | It is not forbidden to call this with a muxer, so it is moved to avformat.c and not demux_utils.c. ff_find_decoder(), which is used by av_find_best_stream() is also moved as well, despite being even more geared towards demuxers. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/utils: Move av_find_default_stream_index to avformat.cAndreas Rheinhardt2022-05-10
| | | | | | | | While it is clearly written with demuxers in mind, it is not forbidden to call it with muxers, hence avformat.c and not demux_utils.c. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/utils: Move av_find_program_from_stream to avformat.cAndreas Rheinhardt2022-05-10
| | | | | | It is potentially used with both demuxers and muxers. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>