summaryrefslogtreecommitdiff
path: root/libavformat/mxfdec.c
Commit message (Collapse)AuthorAge
* avformat: Constify all muxer/demuxersAndreas Rheinhardt2021-04-27
| | | | | | | 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>
* avformat/mxfdec: Fix file position additionMichael Niedermayer2021-04-22
| | | | | | | | Fixes: signed integer overflow: 9223372036854775805 + 4 cannot be represented in type 'long' Fixes: 29927/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-5579985228267520 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: Fix leak on errorAndreas Rheinhardt2021-03-19
| | | | | | | | It was introduced in d3d9b1fc8e2dfc8b4d66c9916ab7221062ff4660; Fixes Coverity issue #733800. Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/mxfdec: Don't use wrong type of pointerAndreas Rheinhardt2021-03-19
| | | | | | | | | | | If one of the two results of a ternary conditional is a pointer to void, the type of the whole conditional operator is a pointer to void, even when the other possible result is not a pointer to void. This loophole in the type system has allowed mxf_read_local_tags to have a pointer of type pointer to MXFMetadataSet that actually points to an MXFContext. Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/mxfdec: add support for getting product version number metadataMarton Balint2021-03-04
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mxfdec: change toolkit_version metadata field to toolkit_version_numMarton Balint2021-03-04
| | | | | | | It only got added recently, and the new name makes it consistent with product_version_num in the next patch. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mxfdec: set toolkit version metadataLimin Wang2021-02-05
| | | | | | | | | | | Please check the string of toolkit version with below command: ./ffmpeg -i ../fate-suite/mxf/Sony-00001.mxf -c:v copy -c:a copy out.mxf ./ffmpeg -i out.mxf .... toolkit_version : 58.65.101.0.0 Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/mxfdec: Add missing const to mxf_mastering_display*Tomas Härdin2021-02-03
|
* avformat/mxf: Establish register of local tagsTomas Härdin2021-02-01
| | | | | | Tags can be marked "not used" upfront, saving some space in the primer. av_asserts0() is used to enforce that only tags that are in the primer can actually be written. Sharing of MasteringDisplay ULs is now done via macros.
* avformat/mxfdec: Fix integer overflow in next position in mxf_read_local_tags()Michael Niedermayer2021-01-23
| | | | | | | | Fixes: signed integer overflow: 9223372036854775723 + 8192 cannot be represented in type 'long' Fixes: 29072/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-4812604904177664 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: Free all types for both DescriptorsMichael Niedermayer2021-01-11
| | | | | | | | | Fixes: memleak Fixes: 26352/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5201158714687488 Suggested-by: Tomas Härdin <tjoppen@acc.umu.se> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mxf: Deduplicate random_index_pack_keyAndreas Rheinhardt2021-01-08
| | | | | Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/mxfdec: Do not clear arrays in mxf_read_index_entry_array()Michael Niedermayer2020-12-28
| | | | | | They are written too immediately, so it should not be needed. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf: move AVStream.{inject_global_side_data,display_aspect_ratio} to ↵Anton Khirnov2020-10-28
| | | | | | | AVStreamInternal Those are private fields, no reason to have them exposed in a public header.
* avformat/mxfdec: Read Apple private Content Light Level from MXFHarry Mallon2020-09-17
| | | | | | * As embedded by Apple Compressor Signed-off-by: Harry Mallon <harry.mallon@codex.online>
* avformat/mxfdec: Read Mastering Display Colour Volume from MXFHarry Mallon2020-09-17
| | | | | | Described in Annex B SMPTE ST 2067-21:2020 Signed-off-by: Harry Mallon <harry.mallon@codex.online>
* avformat/mxfdec: Read video range from CDCIEssenceDescriptorHarry Mallon2020-08-29
| | | | | | | * Capture black_ref, white_ref and color_range and recognise full and narrow range. Signed-off-by: Harry Mallon <harry.mallon@codex.online>
* lavf/mxfdec: Limit score for files with run-in.Carl Eugen Hoyos2020-08-25
| | | | | | | | Only return AVPROBE_SCORE_MAX if the header partition pack key is at the start of the file. Fixes ticket #8846. Reviewed-by: Tomas Härdin
* avformat/mxfdec: Read color metadata from MXFHarry Mallon2020-08-06
| | | | | | | Reads color_primaries, color_trc and color_space from mxf headers. ULs are from https://registry.smpte-ra.org/ site. Signed-off-by: Harry Mallon <harry.mallon@codex.online>
* avformat/mxfdec: Fix memleak upon repeating tagsAndreas Rheinhardt2020-07-24
| | | | | | | | | | | When parsing MXF encountering some tags leads to allocations. And when these tags were encountered repeatedly, this could lead to memleaks, because the pointer to the old data got simply overwritten with a pointer to the new data (or to NULL on allocation failure). This has been fixed. Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/mxfdec: Fix memleak when parsing tag failsAndreas Rheinhardt2020-07-24
| | | | | | | | | | | | | | The MXF demuxer uses an array of pointers to different structures of metadata (all containing a common initial sequence containing a type field to distinguish them) and some of these structures contain pointers to separately allocated subelements. If an error happens while reading and creating the tags, the semi-finished new tag is freed using the function to free these tags. But this function doesn't free the already allocated subelements, because the type has not been set yet. This commit changes this. Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/mxfdec: Fix memleak when adding element to array failsAndreas Rheinhardt2020-07-24
| | | | | | | | | Said array contains pointers to other structs and both the designated new element as well as other stuff contained in it (e.g. strings) leak if the new element can't be added to the array. Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/mxfdec: free duplicated utf16 stringsMichael Niedermayer2020-06-14
| | | | | | | | | Fixes: memleak Fixes: 23415/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5124814510751744 Suggested-by: Marton Balint <cus@passwd.hu> 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: reindent codeLimin Wang2020-05-05
| | | | | Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/mxfdec: Correct confusing struct tagAndreas Rheinhardt2020-03-30
| | | | | | | | Don't use typedef struct MXFTrack {...} MXFTimecodeComponent, in particular given the fact that MXFTrack is a type of its own. Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/mxfdec: use av_asprintf()Limin Wang2020-03-23
| | | | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com> Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mxf: get rid of samples per frame array usageMarton Balint2020-03-14
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mxfdec: Clear metadata_sets_count in mxf_read_close()Michael Niedermayer2019-12-01
| | | | | | This avoids problems if the function is called twice Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mxfdec: cleanup on "essence prior to first PartitionPack"Michael Niedermayer2019-11-08
| | | | | | | | Fixes: memleak Fixes: 18473/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5738557074833408 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: do not ignore bad size errorsMarton Balint2019-08-22
| | | | | | | The return value was unintentionally lost after 00a2652df3bf25a27d174cc67ed508b5317cb115. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mxfdec: fix and enhance RIP KLV length checksMarton Balint2019-04-28
| | | | | | | | | KLV length is BER encoded (variable size), but the code assumed the encoding to always use 4 bytes. Fixes parsing Random Index Pack in samples/MXF/issue2160/PW0805A0V01.4C5B5636.EFA330.mxf. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mxfdec: take into account run-in in find_partition_by_offsetMarton Balint2019-04-28
| | | | | | | Also rename the function to find_partition_by_absolute_offset to make it clear offset is absolute. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mxfdec: guess wrapping of tracks by other tracks with the same body sidMarton Balint2019-04-28
| | | | | | | | | | | | | | | | This affects the following samples: samples/ffmpeg-bugs/roundup/issue1775/av_seek_frame_failure.mxf samples/ffmpeg-bugs/trac/ticket1957/16ch.mxf samples/ffmpeg-bugs/trac/ticket5016/r0.mxf samples/ffmpeg-bugs/trac/ticket5016/r1.mxf samples/ffmpeg-bugs/trac/ticket5316/hq.MXF samples/ffmpeg-bugs/trac/ticket5316/hqx.MXF Some AVPacket->pos values are changed because for frame wrapped tracks we point to the KLV offset and not the data. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mxfdec: rework mxf_essence_container_endMarton Balint2019-04-28
| | | | | | | We find the last essence container much faster if we go through the partitions backwards... Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mxfdec: use operational_pattern_ul instead of operational_pattern ↵Marton Balint2019-04-14
| | | | | | | | for metadata This makes it more consistent with other metadata keys. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mxfdec: export operational pattern UL as file metadataMarton Balint2019-04-11
| | | | | | | Can be useful for API users as ffmpeg/libavformat can't properly support some operational patterns. Signed-off-by: Marton Balint <cus@passwd.hu>
* lavf: Constify the probe function argument.Carl Eugen Hoyos2019-03-21
| | | | | Reviewed-by: Lauri Kasanen Reviewed-by: Tomas Härdin
* Add the Canon XF-HEVC UL to the picture essence container UL listMatthew McKenna2019-03-08
|
* avformat/mxfdec: support subsecond precision of decoded timestampsMarton Balint2018-12-25
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mxfdec: replace obsolete commentMarton Balint2018-12-25
| | | | | | We no longer use strftime directly but use av_timegm to get an int64_t timestamp. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mxfdec: Do not process zero modified_date timestamp.Michael Niedermayer2018-12-22
| | | | | | | | | This causes windows to fail as the timestamp is outside its supported range Fixes regression & fate Reviewed-by: Marton Balint <cus@passwd.hu> Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mxfdec: fix error check in macroPaul B Mahol2018-12-13
| | | | Fixes #6750.
* avformat/mxfdec: fix indentationPaul B Mahol2018-12-09
|
* avformat/mxfdec: set codec_tag for prores codecPaul B Mahol2018-12-07
|
* lavf/mxfdec: demux s436m as eia608 subtitle trackBaptiste Coudurier2018-10-12
|
* lavf/mxfenc: support creating s436m data tracksBaptiste Coudurier2018-10-12
|
* avformat/mxfdec: do not use sound essence descriptor quantization bits for ↵Marton Balint2018-09-05
| | | | | | | | | | | | | bits_per_coded_sample It refers to the uncompressed quantization, therefore is not correct for AAC. Also change mxf_set_pts to work based on current edit unit if bits_per_coded_sample is not available. Fixes error messages in the sample of ticket #7366. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mxfdec: drop invalid index table segments when sorting themMarton Balint2018-07-24
| | | | | | | | | This way if an index table segment is present multiple times, we can always use the proper one instead of the invalid one. Fixes seeking in the sample of ticket #5671. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mxfdec: only call mxf_free_metadataset when ctx_size is != 0, ↵Baptiste Coudurier2018-07-19
| | | | otherwise ctx == mxf
* avformat/mxfdec: only return stream indexes which have a corresponding trackMarton Balint2018-07-13
| | | | | | | Without this check some crafted files might crash because a packet might be demuxed which have no corresponding mxf track. Signed-off-by: Marton Balint <cus@passwd.hu>