aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/matroskadec.c
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/itut35: rename some provider codesMaryla Ustarroz-Calonge34 hours1-1/+1
| | | | | | | | | | | | | | | | | | In general, a provider code corresponds to a company/organization, and the name should be that of the company, not of a given feature. The feature is signalled in the "provider oriented code". The exception is HDR Vivid, where the code 0x0004 indicates the HDR Vivid feature itself rather than CUVA (China UHD Video Industry Alliance), according to the UHD World Associations 'HDR Video Technology Part 2-1 Application Guide to System Integration' document. ITU_T_T35_PROVIDER_CODE_CUVA -> ITU_T_T35_PROVIDER_CODE_HDR_VIVID ITU_T_T35_PROVIDER_CODE_LCEVC-> ITU_T_T35_PROVIDER_CODE_VNOVA ITU_T_T35_PROVIDER_CODE_SMTPE -> ITU_T_T35_PROVIDER_CODE_SAMSUNG Signed-off-by: Maryla Ustarroz-Calonge <maryla@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* all: fix typos found by codespellTimo Rothenpieler5 days1-3/+3
|
* avformat/matroskadec: Fix VfW extradata sizeAndreas Rheinhardt2025-05-271-0/+5
| | | | | | | | | | | The structure is padded to an even length with an internal size field to indicate the real size. The matroska-matroska-display-metadata test (writing FFV1 in VFW mode) was affected by this. It should also fix ticket #11613. Reviewed-by: compn <ff@hawaiiantel.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskadec: Accept WebVTT subtitles with empty cuesMarcos Del Sol Vives via ffmpeg-devel2025-05-231-3/+0
| | | | | Fixes: #11493 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/matroskadec: check that channels fit in signed 32bit intMichael Niedermayer2025-05-151-0/+2
| | | | | | | | Fixes: signed integer overflow: -1384566925600903168 * 16 cannot be represented in type 'long' Fixes: 407069502/clusterfuzz-testcase-minimized-ffmpeg_dem_WEBM_DASH_MANIFEST_fuzzer-5159255372267520 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avutil/dict: Unavpriv avpriv_dict_set_timestamp()Andreas Rheinhardt2025-03-281-2/+1
| | | | | | | And move it to lavf, its only user. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/matroskadec: Check pre_ns for overflowMichael Niedermayer2024-12-241-2/+3
| | | | | | | | Fixes: signed integer overflow: -3483479120376300096 - 7442323944145700864 cannot be represented in type 'long' Fixes: 383187489/clusterfuzz-testcase-minimized-ffmpeg_dem_WEBM_DASH_MANIFEST_fuzzer-4561470580391936 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/matroskadec: set all frames in a keyframe simple box as keyframesJames Almer2024-11-241-1/+1
| | | | | | | And not just the first, as it was being done for lacing. The spec states that the flag applies to everything inside the simple box. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/matroskadec: Check desc_bytes so bits fit in 64bitMichael Niedermayer2024-10-091-1/+1
| | | | | | | | | | Likely a tighter check can be done Fixes: signed integer overflow: 3305606804154370442 * 8 cannot be represented in type 'long' Fixes: 70449/clusterfuzz-testcase-minimized-ffmpeg_dem_WEBM_DASH_MANIFEST_fuzzer-4771166007918592 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/matroskadec: use AV_WL32AJames Almer2024-07-291-2/+2
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/matroskadec: export cropping valuesJames Almer2024-07-081-10/+41
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/matroskadec: don't infer display dimensions when DisplayUnit is not ↵James Almer2024-07-081-5/+8
| | | | | | | | pixels The spec doesn't define a default value for other values of DisplayUnit. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/matroskadec: don't use sizeof(AVStereo3D)James Almer2024-06-251-2/+3
| | | | | | It's not part of the libavutil ABI. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/matroskadec: don't use sizeof(AVMasteringDisplayMetadata)James Almer2024-06-201-8/+8
| | | | | | It's not part of the libavutil ABI. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/matroskadec: Assert that num_levels is non negativeMichael Niedermayer2024-06-121-1/+1
| | | | | | | Maybe Closes: CID1452496 Uninitialized scalar variable Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/matroskadec: Add assert to silence Coverity false positiveAndreas Rheinhardt2024-05-311-0/+2
| | | | | | Helps with Coverity issue #1452453. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/common: Don't auto-include mem.hAndreas Rheinhardt2024-03-311-0/+1
| | | | | | | | | | | There are lots of files that don't need it: The number of object files that actually need it went down from 2011 to 884 here. Keep it for external users in order to not cause breakages. Also improve the other headers a bit while just at it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskadec: Check timescaleMichael Niedermayer2024-03-261-0/+4
| | | | | | | | Fixes: 3.82046e+18 is outside the range of representable values of type 'unsigned int' Fixes: 62276/clusterfuzz-testcase-minimized-ffmpeg_dem_WEBM_DASH_MANIFEST_fuzzer-6381436594421760 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/internal: Move FF_FMT_INIT_CLEANUP to demux.hAndreas Rheinhardt2024-03-261-2/+2
| | | | | | | | | and rename it to FF_INFMT_INIT_CLEANUP. This flag is demuxer-only, so this is the more appropriate place for it. This does not preclude adding internal flags common to both demuxer and muxer in the future. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroska: use named constants for ITU-T T.35 metadataJames Almer2024-03-191-1/+3
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* lavf/matroskadec: add missing linebreaks in error messagesAnton Khirnov2024-03-071-3/+3
|
* avformat/avformat: Add FFInputFormat, hide internals of AVInputFormatAndreas Rheinhardt2024-03-071-9/+9
| | | | | | | | | | | | | | | | | | | | | This commit does for AVInputFormat what commit 59c9dc82f450638a3068deeb1db5c56f6d155752 did for AVOutputFormat: It adds a new type FFInputFormat, moves all the internals of AVInputFormat to it and adds a now reduced AVInputFormat as first member. This does not affect/improve extensibility of both public or private fields for demuxers (it is still a mess due to lavd). This is possible since 50f34172e0cca2cabc5836308ec66dbf93f5f2a3 (which removed the last usage of an internal field of AVInputFormat in fftools). (Hint: tools/probetest.c accesses the internals of FFInputFormat as well, but given that it is a testing tool this is not considered a problem.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroska: Add support for A_ATRAC/AT1asivery2024-02-131-0/+8
| | | | | Signed-off-by: asivery <asivery@protonmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* Revert "all: Don't set AVClass.item_name to its default value"Anton Khirnov2024-01-201-0/+1
| | | | | | | Some callers assume that item_name is always set, so this may be considered an API break. This reverts commit 0c6203c97a99f69dbaa6e4011d48c331e1111f5e.
* all: Don't set AVClass.item_name to its default valueAndreas Rheinhardt2023-12-221-1/+0
| | | | | | | | Unnecessary since acf63d5350adeae551d412db699f8ca03f7e76b9; also avoids relocations. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskadec, mov: Fix declaration-after-statement warningsAndreas Rheinhardt2023-10-091-3/+2
| | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskadec: Check prebuffered_ns for overflowMichael Niedermayer2023-10-081-1/+5
| | | | | | | | Fixes: signed integer overflow: 9223372036630775808 + 1000000000 cannot be represented in type 'long' Fixes: 51896/clusterfuzz-testcase-minimized-ffmpeg_dem_WEBM_DASH_MANIFEST_fuzzer-5406131992526848 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/avformat: use the side data from AVStream.codecparJames Almer2023-10-061-24/+23
| | | | | | | | | | | | Deprecate AVStream.side_data and its helpers in favor of the AVStream's codecpar.coded_side_data. This will considerably simplify the propagation of global side data to decoders and from encoders. Instead of having to do it inside packets, it will be available during init(). Global and frame specific side data will therefore be distinct. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/aviobuf: Add ffio_init_(read|write)_context()Andreas Rheinhardt2023-09-071-7/+5
| | | | | | | | | | | | | | Most users of ffio_init_context() simply want to wrap a buffer into an AVIOContext; they do not provide function pointers at all. Therefore this commit adds shortcuts for these two common operations. This also allows to accept const data when reading (i.e. the const is now cast away at a central place in ffio_init_read_context() instead of at several callers). This also allows to constify the data in ff_text_init_buf(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/defs: Add AV_PROFILE_* defines, deprecate FF_PROFILE_* definesAndreas Rheinhardt2023-09-071-4/+4
| | | | | | | | | These defines are also used in other contexts than just AVCodecContext ones, e.g. in libavformat. Furthermore, given that these defines are public, the AV-prefix is the right one, so deprecate (and not just move) the FF-macros. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskadec: Factor parsing content encodings outAndreas Rheinhardt2023-09-071-67/+79
| | | | | | Namely, out of matroska_parse_tracks(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskadec: Move WEBVTT code to mkv_parse_subtitle_codec()Andreas Rheinhardt2023-09-071-22/+27
| | | | | | | and also perform the remainder of the subtitle parsing directly after mkv_parse_subtitle_codec(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskdec: Reindent after the previous commitAndreas Rheinhardt2023-09-071-26/+26
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskadec: Factor generic parsing of audio tracks outAndreas Rheinhardt2023-09-071-32/+47
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskadec: Reindent after the previous commitAndreas Rheinhardt2023-09-071-78/+79
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskadec: Factor generic parsing of video tracks outAndreas Rheinhardt2023-09-071-86/+102
| | | | | | Out of matroska_parse_tracks(), that is. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskadec: Factor parsing subtitle codecs outAndreas Rheinhardt2023-09-071-29/+46
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskadec: Use av_dict_set_int() where appropriateAndreas Rheinhardt2023-09-071-1/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskadec: Avoid clobbering CodecPrivate sizeAndreas Rheinhardt2023-09-071-3/+2
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskadec: Move reading color space to a better placeAndreas Rheinhardt2023-09-071-4/+3
| | | | | | | Namely to a place after the AVStream has already been created, so that it can be directly attached to it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskadec: Reindent after the previous commitAndreas Rheinhardt2023-09-071-43/+43
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskadec: Factor video parsing out of matroska_parse_tracks()Andreas Rheinhardt2023-09-071-48/+72
| | | | | | | More exactly, factor codec-specific video parsing out of matroska_parse_tracks(). This is intended to improve readability. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskadec: Reindent after the previous commitAndreas Rheinhardt2023-09-071-126/+125
| | | | | | Also fix a variable shadowing. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskadec: Remove redundant checksAndreas Rheinhardt2023-09-071-8/+4
| | | | | | | | If the size of the data of an EbmlBin is > 0, its data is always present, as ebml_read_binary() always leaves the buffer in a consistent state (even on error). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskdec: Factor audio parsing out of matroska_parse_tracks()Andreas Rheinhardt2023-09-071-181/+243
| | | | | | | More exactly, factor codec-specific audio parsing out of matroska_parse_tracks(). This is intended to improve readability. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskadec: Set AVCodecParameters earlierAndreas Rheinhardt2023-09-071-27/+28
| | | | | | This is in preparation for future commits. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskadec: Redo handling extradata allocationAndreas Rheinhardt2023-09-071-33/+27
| | | | | | | | | | | | | | | | | | | Up until now, matroska_parse_tracks() has two main ways to set AVCodecParameters.extradata: A generic way via CodecPrivate (possibly with an offset) and by allocating a buffer manually; the pointer to this buffer is stored in a stack pointer. In particular, the latter method is problematic, as the buffer needs to be freed manually in case of error (currently there are no error conditions between the place where it is set to AVCodecParameters.extradata). Most of these buffers are very small (<= 22B), so replace the pointer to an allocated buffer with a stack buffer and set the extradata directly for the one place where the buffer may not be small. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskadec: Use dedicated pointer for access to codecparAndreas Rheinhardt2023-09-071-48/+50
| | | | | | Shortens code and improves readability. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskadec: Set several stream parameters earlierAndreas Rheinhardt2023-09-071-32/+32
| | | | | | Don't do it in between parsing and setting extradata. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroska(dec|enc): Rename macro to avoid clash with winbase.hAndreas Rheinhardt2023-09-021-2/+2
| | | | | | | | winbase.h defines IGNORE and is included via bzlib.h when compiling for Windows. So rename this macro to NOTHING. Also rename the muxer macro for consistency. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>