aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
Commit message (Collapse)AuthorAgeFilesLines
* avformat/lrcenc: add precision optionKacper Michajłow41 min.1-6/+36
| | | | | | | Allows to output LRC with more precision than standard centiseconds. Time base is determined by number of requested digits. Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
* avformat/lrcdec: support arbitrary precision timestampKacper Michajłow41 min.1-8/+10
| | | | | | | | | | | | | | | | | | Apparently files with milliseconds exist in the wild. And since it cost nothing to support arbitrary number of digits, extend format to support that. Depending on number of digits, the time base of fractional part is changing. Most LRCs use 2 digits and centiseconds base, but subs with 3 digits and miliseconds exist too. Set internal time base to AV_TIME_BASE, which in parcitice allows to hold microseconds with 6 digits. Totally artificial, but who knows maybe someone wants that. Fixes: #11677 Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
* avformat/webvttdec,webvttenc: update documentationLeon Grutters7 hours2-2/+2
| | | | | | The previous links lead to a 404 page as that page doesn't exist anymore. Signed-off-by: Leon Grutters <gruttersleonbot2@gmail.com>
* avformat/mov: item names can be NULL in infe boxesJames Almer9 hours1-2/+1
| | | | | | Fixes assertions after 11a53339805950bf2d0b429cc598c5f6b83ae1c7. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mov: move AVC-Intra extradata generation to earlier in the stsd ↵James Almer13 hours1-8/+25
| | | | | | | | | | | | parsing process This will ensure it will be stored in the stream's private context, so it can be fetched and replaced as required. Fixes a regression since eefa6de7d505ecd80e4674146067b99d1b74ddbe. Fixes avc-intra-panasonic-AG-HPX301E.mov Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mov: don't set stsc_count for item streams before the array is ↵James Almer13 hours1-1/+1
| | | | | | allocated Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mov: free streams earlier on error when parsing infe boxesJames Almer13 hours1-11/+11
| | | | | | Fixes clusterfuzz-testcase-minimized-fuzzer_loadfile-5365661771825152. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mov: free AVBPrint on error when parsing infe boxesJames Almer13 hours1-3/+5
| | | | | | Should fix memleaks. Signed-off-by: James Almer <jamrial@gmail.com>
* all: fix typos found by codespellTimo Rothenpieler17 hours43-65/+65
|
* all: fix whitespace/new-line issuesTimo Rothenpieler17 hours5-6/+0
|
* avformat/dashdec: Allocate space for appended "/"Michael Niedermayer30 hours1-2/+11
| | | | | | | | | | | | Fixes: writing 1 byte over the end of the array Fixes: BIGSLEEP-433502298/test.xml Found-by: Google Big Sleep A prettier solution is welcome! A testcase exists only for the baseurl case Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mov: add extra sanity checks before setting the primary extradataJames Almer2 days1-1/+2
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/movenc: look for the Intra profile flag before assuming a stream is ↵James Almer3 days1-0/+4
| | | | | | | | | | | | | AVC-Intra Fixes issue #20018. Note that Codec Descriptors are not written for all these ai** codec tags, and no considerations were ever made to ensure parameter sets are present in muxed packets. Their usage may result in unplayable files if parameter sets are only available in extradata (Default behavior for x264 encoding when combined with this muxer). Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/file: add missing null check in Android content resolversfan54 days1-0/+5
| | | | | | | | openFileDescriptor() can return null in certain error conditions. Signed-off-by: sfan5 <sfan5@live.de> Reviewed-by: Kacper Michajłow <kasper93@gmail.com> Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* lavu/spherical: Add support for Spherical Immersive typeVittorio Giovara4 days1-0/+3
|
* mov: Export frame packing information from pack boxVittorio Giovara4 days1-0/+86
|
* libavformat/mov.c: Fix "statement will never be executed" warningzhaozhenghang4 days1-6/+2
| | | | | | | That occurs when H261, H263, and MPEG4 decoders are disabled. Signed-off-by: zhaozhenghang <15083277223@163.com> Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/movenc: support writing more than one STSD entry per trackJames Almer4 days2-4/+50
| | | | | | | | If a packet contains new extradata within a side data entry, save for specific cases it means the coded stream changed. If ignored, upon demuxing every packet from then onwards may be undecodable. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/movenc: allow storing more than one extradata buffer per trackJames Almer4 days2-124/+147
| | | | | | This is in preparation for a following change Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mov: export the correct initial extratada from samples with ↵James Almer4 days1-0/+14
| | | | | | | | | | multiple stsd The first sample in the stsc box may not refer to the first stsd entry. This is the case in h264/thezerotheorem-cut.mp4, and as such the fate-h264_redundant_pps-side_data test is updated accordingly. Signed-off-by: James Almer <jamrial@gmail.com>
* Revert "avformat/tls_openssl: properly get new BIO index"Kacper Michajłow5 days1-14/+4
| | | | | | | | | | | | | | | | | | | | | | | BIO_get_new_index() is static counter meant to get index for custom bio type definition. As we can read in the documentation: > Note that BIO_get_new_index() can only be used 127 times before it > returns an error. We cannot call it repeatedly, because it will fail eventually. To my understanding the index is not needed in our use and we could safely use BIO_TYPE_NONE. Documentation states: > type can be set to either BIO_TYPE_NONE or via BIO_get_new_index() if > a unique type is required for searching (See BIO_find_type(3)) We don't use any search related functions. This reverts commit 816dad231f5b312fd98e81cc6a6cbaf47c1e26a5. Fixes: https://github.com/mpv-player/mpv/issues/16589 Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
* avformat/subfile: Initialize end on all casesMichael Niedermayer5 days1-2/+0
| | | | | | | Fixes: use of uninitialized variable Regression since: e29016a9de8cf9a15569bdcea6e68c8e9ba2f299 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/dhav: Remove end_ prefix from variable namesMichael Niedermayer6 days1-18/+18
| | | | | | | The end_ prefix is confusing and may have contributed the mixup fixed in the previous commit Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/dhav: fix reference point mixupMichael Niedermayer6 days1-1/+1
| | | | | | | | | | | Fixes: reading the duration from before the start of the allocated buffer. Regression since: 36ec9217e6dca3432304c9d76078d9618247eb0f Fixes: BIGSLEEP-433513232/test Found-by: Google Big Sleep Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mxg: clear AV_INPUT_BUFFER_PADDING_SIZEMichael Niedermayer7 days1-0/+2
| | | | | | | | Fixes: use of uninitialized memory Fixes: 427532813/clusterfuzz-testcase-minimized-ffmpeg_dem_MXG_fuzzer-5661938917113856 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vqf: Ensure that comm_chunk is fully readMichael Niedermayer7 days1-1/+3
| | | | | | | | Fixes: use of uninitialized memory Fixes: 412125811/clusterfuzz-testcase-minimized-ffmpeg_dem_VQF_fuzzer-6253774274887680 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mxfdec: Ensure klv->key is initializedMichael Niedermayer7 days1-1/+3
| | | | | | | | Fixes: read of uninitialized memory Fixes: 391916474/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-4935250956845056 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: make sure file_checksum is fully initializedMichael Niedermayer7 days1-1/+3
| | | | | | | | Fixes: use of uninitialized memory Fixes: 394990189/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6431722199908352 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 amount of value readMichael Niedermayer7 days1-2/+4
| | | | | | | | Fixes: use of uninitialized memory Fixes: 403675492/clusterfuzz-testcase-minimized-ffmpeg_dem_ASF_fuzzer-4754281823797248 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/hlsenc: limit segments count to search duplicated segments filenamesArtem Smorodin7 days1-1/+1
| | | | | | | | | This linear search has a complexity of O(n). When ffmpeg attempts to parse a playlist containing approximately 100,000 segments, it effectively causes a hang for several minutes. This patch limits the allowed size for duplicate searches to a reasonable value. Now it takes between 0.5 and a few seconds (tested on different devices) instead of several minutes. Signed-off-by: Artem Smorodin <artem.smorodin@dacast.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/movenc: fix HEVC fmp4 HLS init segment for Apple playbackDavid McElroy7 days1-1/+1
| | | | | | | | | | | | | | | | | | | | | | HEVC fmp4 HLS video produced by ffmpeg is currently unplayable on Apple software (Safari, QuickTime, AVFoundation). This is caused by an empty sdtp atom being erroneously written to the fmp4 init segment. The `has_disposable` flag can be set for a track with B-frames, but the init segment contains no actual frames (track->entry == 0). Writing an sdtp atom in this case is incorrect and causes Apple's parsers to reject the file. This patch fixes the issue by ensuring the sdtp atom is only written if track->entry is non-zero. A similar patch was proposed in November 2023 by Jay Zhang, but it was never merged. Link: https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2023-November/317173.html Co-authored-by: Jay Zhang <wangyoucao577@gmail.com> Signed-off-by: David McElroy <david@mcelroy.online> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mxfenc: Ensure frame offset in valid rangeZhao Zhili9 days1-8/+42
| | | | | | | Fix assert failure. Fix #11666. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
* avformat/subfile: clip seek offsetKacper Michajłow9 days1-3/+3
| | | | | | | | | Fixes: signed integer overflow: 9223372036854737920 + 1649410 cannot be represented in type 'int64_t' Fixes OSS-Fuzz: 410100610 Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
* avformat/rtmpproto: guard usage of undefined functions with preprocessorKacper Michajłow9 days1-7/+24
| | | | | | | | The asumption is that DCE will remove references to those functions. However some compilers with certain instrumentation enabled doesn't DCE those at all, resulting in linking failure. Tested with cl.exe -RTCu -RTCs. Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
* avformat/vivo: fix sscanf specifer for doubleKacper Michajłow9 days1-1/+1
| | | | Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
* avformat/os_support: check invalid socket value correctly on WindowsKacper Michajłow9 days1-1/+4
| | | | | | | | SOCKET defined in winsock2.h is unsigned and invalid value is defined as INVALID_SOCKET. Check this explicity to avoid compiler warnings. See: https://learn.microsoft.com/en-us/windows/win32/winsock/socket-data-type-2 Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
* avformat/options_table: supress implicit conversion warningsKacper Michajłow9 days1-7/+7
| | | | Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
* avformat/udp: avoid warning about always false comparisonKacper Michajłow12 days1-1/+1
| | | | | | | | | | socklen_t underlying type can be signed or unsigned depending on platform. This is fine, just cast it to size_t before comparison. Fixes: warning: result of comparison of unsigned expression < 0 is always false [-Wtautological-unsigned-zero-compare] Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
* avformat/hevc: don't print parameter_set_id for any NALUJames Almer13 days1-4/+0
| | | | | | | | It's not a value stored in the hvcC structure. Fixes use of uninitialized variable errors under sanitizer when the input extradata is already hvcC formatted, given we don't parse parameter sets for those. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/tls_openssl: load default verify locationsMarvin Scholz13 days1-0/+6
| | | | | | | When no explicit CAs file is set, load the default locations, else there is no way for verification to succeed. This matches the behavior of other TLS backends.
* avformat/tls_openssl: verify setting hostname for SNIMarvin Scholz13 days1-1/+5
|
* avformat/tls_openssl: add hostname for verificationDaniel N Pettersson13 days1-3/+12
| | | | | | | | When verification is enabled (using -tls_verify 1) now the hostname will be verified properly too, while before only other aspects of the certificate were checked. Co-Authored-By: Marvin Scholz <epirat07@gmail.com>
* avformat/concatdec: Clip duration in one more case in get_best_effort_duration()Michael Niedermayer2025-07-211-1/+1
| | | | | | | | | Fixes: signed integer overflow: 40000 - -9223372036854770000 cannot be represented in type 'long' Fixes: 427262541/clusterfuzz-testcase-minimized-ffmpeg_dem_CONCAT_fuzzer-4831506940100608 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/apv: use memset to zero initialize frame_infoJames Almer2025-07-191-1/+9
| | | | | | | | Don't rely on implicit zeroing. Should fix fate failures on msvc targets. Found-by: Kacper Michajlow <kasper93@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/hevc: don't print parameter_set_id for SEI NALUsJames Almer2025-07-181-3/+4
| | | | | | | | The field is unset for those. Fixes use of uninitialized variable errors under sanitizer. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mov: don't assume iloc and iinf entries for each item_id will be in ↵James Almer2025-07-181-15/+26
| | | | | | | | | | | the same order Nothing forbids them to be in any order the muxer desires. Fixes demuxing heif samples generated by S1II. Tested-by: Lynne <dev@lynne.ee> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mov_muxer: Extended MOV muxer to handle APV video contentDawid Kozinski2025-07-187-2/+479
| | | | | | | | | - Changes in mov_write_video_tag function to handle APV elementary stream - Provided structure APVDecoderConfigurationRecord that specifies the decoder configuration information for APV video content Co-Authored-by: James Almer <jamrial@gmail.com> Signed-off-by: Dawid Kozinski <d.kozinski@samsung.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mov: Enable jpeg streams in HEIF MOVContextEric Joyner2025-07-171-0/+1
| | | | | | | | | | | | | Nikon HEIFs from a camera or NX studio include a small jpeg thumbnail in addition to the expected HEVC thumbnails; allowing jpegs allows all thumbnails to have an associated stream for Nikon HEIF files. With this, Nikon HEIFs can finally be decoded without failing and the thumbnails can be extracted into their own files. Signed-off-by: Eric Joyner <erj@erj.cc> Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mov: Support multiple thumbnails in HEIFEric Joyner2025-07-172-8/+19
| | | | | | | | | | | | | | | | | | | | | | Prevents ffmpeg/ffprobe from erroring out when reading an HEIF that contains multiple hvcC thumbnails (e.g. from a Nikon Z6III camera). Before, move_read_iref_thmb() would always override the stored thmb_item_id in the MOVContext with each new read thumbnail, causing a stream and item_id mismatch later in mov_parse_heif_items(), resulting in the "HEIF thumbnail doesn't reference a stream" error message. To solve this, - Turn thmb_item_id into an array of IDs because multiple thumbnails can exist - Change check in mov_parse_heif_items() to compare against all stored thumbnail IDs to see if any item missing a stream is in the list of thumbnail IDs. Signed-off-by: Eric Joyner <erj@erj.cc> Reviewed-by: Lynne <dev@lynne.ee> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/whip: force NONBLOCK for rtpJack Lau2025-07-171-0/+1
| | | | | | | | We need to ensure rtp sets NONBLOCK since the dtls handshake has potentially overriden the sockets mode. Signed-off-by: Jack Lau <jacklau1222@qq.com> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>