Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-02-01avformat/mov: Check size before subtractionMichael Niedermayer
Fixes: signed integer overflow: -9223372036854775808 - 8 cannot be represented in type 'long' Fixes: 43542/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5237670148702208 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-01-21avformat/mov: Fix endian-dependent parsingAndreas Rheinhardt
MOVAtom.type is always read as a little-endian number (despite MOV/ISOBMFF being big-endian). Fixes the matroska-dovi-write-config8 FATE-test on big-endian arches (which runs into the "index out of range" warning message). Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-04avcodec/ac3tab: Unavpriv ac3_channel_layout_tabAndreas Rheinhardt
It is small (16 B) and therefore the overhead of exporting it more than outweighs the size savings from not having duplicated symbols: When the symbol is no longer avpriv, one saves twice the size of the string containing the symbols name (2x30 byte), two entries in .dynsym (24 bytes each on x64), one entry in the importing libraries .got and .rela.dyn (8 + 24 bytes on x64) and two entries for the symbol version (2 bytes each) and one hash value in the exporting library (4 bytes). (The exact numbers are of course different for other platforms (e.g. when using dlls), but given that the strings saved alone more than outweigh the array size it can be presumed that this is beneficial for all platforms.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-04avformat/mov: Refactor mov_read_dvcc_dvvc to use ff_isom_parse_dvcc_dvvcquietvoid
To avoid duplicating code. The implementation in dovi_isom is identical. Signed-off-by: quietvoid <tcChlisop0@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-31avformat/mov: add option max_stts_deltaGyan Doshi
Very high stts sample deltas may occasionally be intended but usually they are written in error or used to store a negative value for dts correction when treated as signed 32-bit integers. This option lets the user set an upper limit, beyond which the delta is clamped to 1. Values greater than the limit if negative when cast to int32 are used to adjust onward dts. Unit is the track time scale. Default is UINT_MAX - 48000*10 which allows upto a 10 second dts correction for 48 kHz audio streams while accommodating 99.9% of uint32 range. Signed-off-by: Gyan Doshi <ffmpeg@gyani.pro> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
2021-12-17avformat/mov: Check next offset in mov_read_dref()Michael Niedermayer
Fixes: signed integer overflow: 9223372036200463215 + 1109914409 cannot be represented in type 'long' Fixes: 41480/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6553086177443840 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-12-08avformat/mov: Simplify data->hex conversionAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-06avformat/mov: Disallow duplicate smdmMichael Niedermayer
Fixes: memleak Fixes: 39879/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5327819907923968 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-12-06avformat/mov: Check for EOF in mov_read_glbl()Michael Niedermayer
Fixes: Infinite loop Fixes: 41351/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5433895854669824 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-11-29avformat/mov: Check channels for mov_parse_stsd_audio()Michael Niedermayer
Fixes: signed integer overflow: -776522110086937600 * 16 cannot be represented in type 'long' Fixes: 40563/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6644829447127040 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-11-22avformat/mov: make STTS duration unsigned intGyan Doshi
As per 8.6.1.2.2 of ISO/IEC 14496-12:2015(E), STTS sample offsets are to be always stored as uint32_t. So far, they have been signed ints which led to desync in files with very large offsets. The MOVStts struct was used to store CTTS offsets as well. These can be negative in version 1. So a new struct MOVCtts was created and all declarations for CTTS usage changed to MOVCtts.
2021-11-05lavf/mov: Change default to prefer TFDT time and allow for fallback to SIDX ↵Thilo Borgmann
or TFDT
2021-10-28avformat/mov: support dvwC box for Dolby VisionLimin Wang
By <<Dolby Vision Streams Within the ISO Base Media File Format Version 2.2>> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-10-21avformat/mov: Do not hard fail if bit rate calculation overflows unless in ↵Derek Buitenhuis
explode mode bit_rate is not a critical field, and we shouln't hard fail if we can't caluclate it due to a large timebase - it needlessly breaks valid files. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2021-10-21avformat/mov: Use av_rescale when calculating bit rateDerek Buitenhuis
It is less susceptible to overflows. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2021-10-13libavformat/mov: add support for 'cens', 'cbc1' and 'cbcs' encryption ↵Nachiket Tarate
schemes specified in Common Encryption (CENC) standard correct implementation of 'cenc' encryption scheme to support decryption of partial cipher blocks at the end of subsamples https://www.iso.org/standard/68042.html Signed-off-by: Nachiket Tarate <nachiket.programmer@gmail.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2021-10-04avformat/{isom,mov,movenc}: add support for CMAF DASH rolesJan Ekström
This information is coded in a standard MP4 KindBox and utilizes the scheme and values as per the DASH role scheme defined in MPEG-DASH. Other schemes are technically allowed, but where multiple schemes define the same concepts, the DASH scheme should be utilized. Such flagging is additionally utilized by the DASH-IF CMAF ingest specification, enabling an encoder to inform the following component of the roles of the incoming media streams. A test is added for this functionality in a similar manner to the matroska test. Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
2021-09-26avformat/mov: Fix last mfra checkMichael Niedermayer
Fixes: signed integer overflow: 9223372036854775360 + 536870912 cannot be represented in type 'long' Fixes: 37940/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6095637855207424 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-23avformat/mov: Set AVSTREAM_PARSE_HEADERS flag for H264Nicolas Gaullier
Signed-off-by: Nicolas Gaullier <nicolas.gaullier@cji.paris> Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-20Replace all occurences of av_mallocz_array() by av_calloc()Andreas Rheinhardt
They do the same. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-17avformat: Avoid allocation for AVStreamInternalAndreas Rheinhardt
Do this by allocating AVStream together with the data that is currently in AVStreamInternal; or rather: Put AVStream at the beginning of a new structure called FFStream (which encompasses more than just the internal fields and is a proper context in its own right, hence the name) and remove AVStreamInternal altogether. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-14avformat/mov: Check for duplicate clliMichael Niedermayer
Fixes: memleak Fixes: 35261/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-4869656287510528 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-08-29avformat/mov: Check dts for overflow in mov_read_trun()Michael Niedermayer
Fixes: signed integer overflow: 9223372034248226491 + 3275247799 cannot be represented in type 'long' Fixes: clusterfuzz-testcase-minimized-audio_decoder_fuzzer-4538729166077952 Reported-by: Matt Wolenetz <wolenetz@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-08-26avformat/avio: Move internal AVIOContext fields to avio_internal.hAndreas Rheinhardt
Currently AVIOContext's private fields are all over AVIOContext. This commit moves them into a new structure in avio_internal.h instead. Said structure contains the public AVIOContext as its first element in order to avoid having to allocate a separate AVIOContextInternal which is costly for those use cases where one just wants to access an already existing buffer via the AVIOContext-API. For these cases ffio_init_context() can't fail and always returned zero, which was typically not checked. Therefore it has been made to not return anything. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-08-22avformat/mov: add AVFMT_SHOW_IDS flagGyan Doshi
The MOV muxer can store streamids as track ids but they aren't visible when probing the result via lavf/dump or ffprobe due to lack of this flag in the demuxer.
2021-08-07libavformat/mov: Change log line from debug to traceSoft Works
It's creating too much noise, even for debug Signed-off-by: softworkz <softworkz@hotmail.com>
2021-07-28avformat/mov: Remove pointless EOF checksAndreas Rheinhardt
9888ffb1ce5e0a17f711b01933d504c72ea29d3b added checks for EOF in loops in the mov demuxer as a precaution against timeouts; yet there is no I/O in the loop when parsing the STSZ atom as the values are read from an already read buffer. So remove said checks. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-28avformat/mov: Fix crash with too big STSZ atomsAndreas Rheinhardt
mov_read_stsz() did not ensure that every bit of a buffer is addressable by an int as is required by the get_bits API, leading to a crash in ticket #9344. Fix this by restricting the size more thoroughly. The file from said ticket will then be considered invalid; in the future, we might read and process the data in chunks to actually support such files. Fixes ticket #9344. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-28avformat/mov: Fix incorrect overflow detection in mov_read_sidx()Michael Niedermayer
Fixes: signed integer overflow: 9223372036854775807 + 1442840321 cannot be represented in type 'long' Fixes: 33670/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6644379491106816 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-07-23avformat/mov: Avoid undefined overflow in time_offset calculationMichael Niedermayer
Fixes: signed integer overflow: 8511838621821575200 - -3954125146725285889 cannot be represented in type 'long' Fixes: 33414/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6610119325515776 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-07-17avformat/mov: do not ignore errors in mov_metadata_hmmt()Michael Niedermayer
Fixes: Timeout Fixes: 35637/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6311060272447488 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-07-15mov: Don't export unknown/unhandled metadata types as if they were UTF8Martin Storsjö
They can be other incompatible text encodings (such as UTF-16), or even binary data. Signed-off-by: Martin Storsjö <martin@martin.st>
2021-07-15mov: Pick up "com.apple.quicktime.artwork" as cover artMartin Storsjö
Signed-off-by: Martin Storsjö <martin@martin.st>
2021-07-08avformat/mov: Simplify cleanup after read_header failureAndreas Rheinhardt
By default, a demuxer's read_close function is not called automatically if an error happens when reading the header; instead it is up to the demuxer to clean up after itself in this case. The mov demuxer did this by calling its read_close function when it encountered some errors when reading the header. This commit changes this by setting the FF_FMT_INIT_CLEANUP flag so that mov_read_close() is automatically called when an error happens when reading the header. (Btw: mov_read_close() is not idempotent: Calling it twice is dangerouos, because MOVContext.frag_index.item will be av_freep'ed, yet MOVContext.frag_index.nb_items won't be reset. So the calls to mov_read_close() have to be removed before the switch to freeing generically.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-06-12avformat/mov: Check for duplicate mdcvMichael Niedermayer
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-02avformat/mov: add option to use tfdt for fragment timestamps.Gyan Doshi
2021-05-13avformat/mov: Ignore duplicate CoLLMichael Niedermayer
Fixes: memleak Fixes: 32146/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5377612845285376 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-05-13avformat/mov: Limit nb_chapter_tracks to input sizeMichael Niedermayer
Fixes: Timeout (15k loop iterations instead of 400m) Fixes: 31368/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6601583174483968 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-05-08avformat/mov: remove special handling of av1c extradataJan Ekström
Libavcodec can now handle the AV1CodecConfigurationRecord structure as-is when passed as extradata, so the standard behavior of read-box-into-extradata should suffice, just like with AVC and HEVC.
2021-05-07avformat: move AVStream.{parser,need_parsing} to AVStreamInternalJames Almer
Those are private fields, no reason to have them exposed in a public header. Signed-off-by: James Almer <jamrial@gmail.com>
2021-05-06avformat/mov: don't save a copy of the packet's AVBufferRef on DV streamsJames Almer
It's no longer needed. Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27avformat: Constify all muxer/demuxersAndreas Rheinhardt
This is possible now that the next-API is gone. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27avformat: remove deprecated AVStream.codecJames Almer
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27avutil/buffer: Switch AVBuffer API to size_tAndreas Rheinhardt
Announced in 14040a1d913794d9a3fd6406a6d8c2f0e37e0062. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27avformat/mov, movenc: Stop exporting rotation via metadataAndreas Rheinhardt
Deprecated in ddef3d902f0e4cbd6be6b3e5df7ec158ce51488b. (The reference file of the mov-zombie test needed to be updated, because a rotate metadata tag is no longer exported; the side-data is of course still present.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-22avformat/mov: check for pts overflow in mov_read_sidx()Michael Niedermayer
Fixes: signed integer overflow: 9223372036846336888 + 4278255871 cannot be represented in type 'long' Fixes: 32782/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6059216516284416 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-04-15mov: Prioritize aspect ratio values found in pasp atomVittorio Giovara
From the ISO/IEC specification for MP4: The pixel aspect ratio and clean aperture of the video may be specified using the ‘pasp’ and ‘clap’ sample entry boxes, respectively. These are both optional; if present, they over-ride the declarations (if any) in structures specific to the video codec, which structures should be examined if these boxes are absent. For maximum compatibility, these boxes should follow, not precede, any boxes defined in or required by derived specifications. Fixes trac/#7277.
2021-04-06mov: Skip computing SAR from invalid display matrix elementsVittorio Giovara
2021-04-05avformat/mov: check offset for overflow in mov_probe()Michael Niedermayer
Fixes: Invalid read of size 4 Fixes: ASAN_Deadlysignal.zip Found-by: Hardik Shah <hardik05@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-04-01avformat: Add and use helper function to add attachment streamsAndreas Rheinhardt
All instances of adding attached pictures to a stream or adding a stream and an attached packet to said stream have several things in common like setting the index and flags of the packet, setting the stream disposition etc. This commit therefore factors this out. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>