summaryrefslogtreecommitdiff
path: root/libavformat/mov.c
Commit message (Collapse)AuthorAge
* lavf/mov.c: Avoid heap allocation wraps in mov_read_{senc,saiz}()Matt Wolenetz2017-02-10
| | | | | | | | Core of patch is from paul@paulmehta.com Reference https://crbug.com/643952 (senc,saiz portions) Signed-off-by: Matt Wolenetz <wolenetz@chromium.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/mov.c: Avoid OOB in mov_read_udta_string()Matt Wolenetz2017-02-10
| | | | | | | | Core of patch is from paul@paulmehta.com Reference https://crbug.com/643952 (udta_string portion) Signed-off-by: Matt Wolenetz <wolenetz@chromium.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/mov.c: Avoid heap allocation wrap in mov_read_uuidMatt Wolenetz2017-02-08
| | | | | | | | | Core of patch is from paul@paulmehta.com Reference https://crbug.com/643951 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> Check value reduced as the code does not support values beyond INT_MAX Also the check is moved to a more common place and before integer truncation
* lavf/mov.c: Avoid heap allocation wrap in mov_read_hdlrMatt Wolenetz2017-02-08
| | | | | | | | Core of patch is from paul@paulmehta.com Reference https://crbug.com/643950 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> Check value reduced as the code does not support larger lengths
* Merge commit '90bc423212396e96a02edc1118982ab7f7766a63'Clément Bœsch2017-02-01
|\ | | | | | | | | | | | | | | | | | | | | | | | | * commit '90bc423212396e96a02edc1118982ab7f7766a63': mov: Wrap stsc index and count compare in a separate function The mov_stsc_index_valid() function is replaced with a macro to prevent signdness issues (index is not always signed, and count is always unsigned currently). The comparison is also adjusted to reduce the risk of overflows. Merged-by: Clément Bœsch <u@pkh.me>
| * mov: Wrap stsc index and count compare in a separate functionVittorio Giovara2016-07-20
| |
| * mov: Fix stsc_count comparisonMatthieu Bouron2016-07-20
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
| * mov: fix stream extradata_size allocationMatthieu Bouron2016-07-15
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | mov: fix decryption with edit listerankor2017-02-01
| | | | | | | | | | | | | | | | | | | | Retain the ranges of frame indexes when applying edit list in mov_fix_index. The index ranges are then used to keep track of the frame index of the current sample. In case of a discontinuity in frame indexes due to edit, update the auxiliary info position accordingly. Reviewed-by: Sasi Inguva <isasi@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/mov: Fix integer truncation in mov_read_uuid()Michael Niedermayer2017-01-30
| | | | | | | | | | | | Fixes Ticket6102 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | mov: Fix spherical metadata_source parsingAaron Colwell2017-01-27
| | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com>
* | lavf/mov: Unscramble dref debug output.Carl Eugen Hoyos2017-01-25
| |
* | avformat/mov.: Make the process of uuid-xmp atom faster.Chen Meng2016-12-19
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | mov: prevent overflow during bit rate calculationAndreas Cadhalpun2016-12-15
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | lavf/mov: Accept multiple fourcc for AVID 1:1.Carl Eugen Hoyos2016-12-12
| | | | | | | | Fixes ticket #5982.
* | mov: Export spherical informationVittorio Giovara2016-12-07
| | | | | | | | | | | | | | This implements Spherical Video V1 and V2, as described in the spatial-media collection by Google. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | hevc: Support extradata changesVittorio Giovara2016-12-02
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | mov: Evaluate the movie display matrixVittorio Giovara2016-11-30
| | | | | | | | | | | | | | | | | | This matrix needs to be applied after all others have (currently only display matrix from trak), but cannot be handled in movie box, since streams are not allocated yet. So store it in main context, and apply it when appropriate, that is after parsing the tkhd one. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Add experimental demuxing support for FLAC in ISO BMFF (MP4).Matthew Gregan2016-11-21
| | | | | | | | | | | | | | Based on the draft spec at https://git.xiph.org/?p=flac.git;a=blob;f=doc/isoflac.txt Signed-off-by: Matthew Gregan <kinetik@flim.org> Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat/mov: reuse existing err variableJames Almer2016-11-19
| | | | | | | | Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat/mov: use av_stream_add_side_data() for displaymatrix side dataJames Almer2016-11-18
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* | Merge commit '029cf99c5166b36f33381cd8ebfa5f1f1f463d1f'Hendrik Leppkes2016-11-14
|\| | | | | | | | | | | | | | | | | * commit '029cf99c5166b36f33381cd8ebfa5f1f1f463d1f': mov: Save number of stsd elements after stream extradata allocation Mostly noop, see 8b43ee4054af799e388d380b379a13a60849c1b5 Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * mov: Save number of stsd elements after stream extradata allocationVittorio Giovara2016-06-29
| | | | | | | | | | | | | | Avoid freeing an unallocated array in mov_read_close() in case of a malloc failure. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | avformat/mov: zero initialize codec_name in mov_parse_stsd_video()James Almer2016-11-12
| | | | | | | | | | | | | | Fixes valgrind warning about "Conditional jump or move depends on uninitialised value(s)" Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* | lavf/mov.c: Fallback to finding non-keyframe in fix_index, if keyframe ↵Sasi Inguva2016-11-10
| | | | | | | | | | | | | | | | search fails. Signed-off-by: Sasi Inguva <isasi@google.com> Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/mov: Read multiple stsd from DVVittorio Giovara2016-11-08
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | mov: validate sidx timescaleAndreas Cadhalpun2016-11-07
| | | | | | | | | | | | | | A negative timescale doesn't make sense and triggers assertions in av_rescale_rnd. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | mov: validate time_scaleAndreas Cadhalpun2016-11-07
| | | | | | | | | | | | | | A negative timescale doesn't make sense and triggers assertions in av_rescale_rnd. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | mov: validate sample_rateAndreas Cadhalpun2016-11-07
| | | | | | | | | | | | | | | | | | | | A negative sample rate doesn't make sense and triggers assertions in av_rescale_rnd. fate-aac-al07_96 fails if sample_rate == 0 is rejected in ff_mov_read_stsd_entries. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | lavf/mov.c: Use the first sidx for tracks without sidx.Sasi Inguva2016-11-03
| | | | | | | | | | | | | | | | According to spec ISO_IEC_15444_12 "For any media stream for which no segment index is present, referred to as non‐indexed stream, the media stream associated with the first Segment Index box in the segment serves as a reference stream in a sense that it also describes the subsegments for any non‐indexed media stream." Signed-off-by: Sasi Inguva <isasi@google.com> Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | mov: immediately return from mov_fix_index without old index entriesAndreas Cadhalpun2016-11-01
| | | | | | | | | | | | | | | | | | | | If there are no index entries, e_old = st->index_entries is only one byte large, since it was created by av_realloc called with size 0. Thus accessing e_old[0].timestamp causes a heap buffer overflow. Reviewed-by: Sasi Inguva <isasi@google.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | lavf/mov: Only search for invalid moov in free if compliance < STRICT.Carl Eugen Hoyos2016-11-01
| |
* | lavf/mov.c: Use the correct timescale when seeking for audio.Sasi Inguva2016-10-31
| | | | | | | | | | Signed-off-by: Sasi Inguva <isasi@google.com> Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | lavf/mov: reindentRodger Combs2016-10-24
| | | | | | | | Reviewed-By: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/mov: improve `tref/chap` chapter handlingRodger Combs2016-10-24
| | | | | | | | | | | | | | | | | | 3 parts: - Supports multiple chapter streams - Exports regular text chapter streams as opaque data. This prevents consumers from showing chapters as if they were regular subtitle streams. - Exports video chapter streams as thumbnails, and provides the first one as an attached_pic.
* | lavf/mov: support gopro hero moments udta tagJean Caillé2016-10-19
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/mov: pass the demuxer's AVFormatContext to avpriv_request_sample()James Almer2016-10-18
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* | mov: move stsd finalization to an appropriate placeHendrik Leppkes2016-10-17
| | | | | | | | | | | | | | | | mov_finalize_stsd_codec parses stream information from the ALAC extradata, so run it after the extradata processing is completed in mov_read_stsd. Fixes playback of 96kHz ALAC streams muxed by qaac or the reference alac encoder. Fixes trac ticket #5826
* | lavf/mov: support gopro firmware udta tagJean Caillé2016-10-15
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/mov: Read display aspect ratio from ares atom also for dnxhd.Carl Eugen Hoyos2016-09-29
| | | | | | | | | | Fixes aspect ratio of sample in ticket #2125. Fixes aspect ratio of sample in ticket #5325.
* | lavf/mov.c: Make audio timestamps strictly monotonically increasing inside ↵Sasi Inguva2016-09-29
| | | | | | | | | | | | | | | | | | an edit list. Fixes gapless decoding. Adjust skip_samples field correctly in case of DISCARDed audio frames. Signed-off-by: Sasi Inguva <isasi@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/mov: Add support for edit list parsing.Sasi Inguva2016-09-19
| | | | | | | | | | Signed-off-by: Sasi Inguva <isasi@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/mov: Enable stream parsing for VP9.Matthew Gregan2016-09-08
| | | | | | | | | | | | | | | | | | | | MP4 media containing VP9 using superframes (such as https://github.com/Netflix/vp9-dash/raw/master/DASH-Samples/Fountain_2997_0560kbps_640x480_4x3PAR.ivf_DashUnencrypted.ismv) does not decode correctly with the built-in VP9 decoder because superframes are passed to the decoder whole rather than split into individual frames. Signed-off-by: Matthew Gregan <kinetik@flim.org>
* | avformat/mov: Fix potential integer overflow in mov_read_keysSergey Volk2016-09-08
| | | | | | | | | | | | | | Actual allocation size is computed as (count + 1)*sizeof(meta_keys), so we need to check that (count + 1) won't cause overflow. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/mov: aax: pass proper AVClass to av_log()Thomas Hebb2016-08-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | av_log() expects its first parameter to be a pointer to a struct whose first element is a pointer to an AVClass. In what I can only imagine is a typo, one call to av_log() in the AAX decryption code instead passes a pointer to an AVSHA struct, which doesn't even contain a pointer as its first element, much less a pointer to an AVClass. Change the call to pass the current MOVContext, as surrounding calls do. The incorrect AVClass was causing mpv to emit the warning "av_log callback called with bad parameters" when playing an .aax file. Signed-off-by: Thomas Hebb <tommyhebb@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat: fix decoded creation_time timestampsMarton Balint2016-08-28
| | | | | | | | | | | | | | | | | | | | | | Use proper ISO 8601 timestamps which also signal that they are in UTC. This changes the format of creation_time and modification_date metadata values from 2016-06-01 22:30:00 to 2016-01-01T22:30:00.000000Z Fixes ticket #5673. Signed-off-by: Marton Balint <cus@passwd.hu>
* | mov: Remove old b-frame/video delay heuristicDerek Buitenhuis2016-08-25
| | | | | | | | | | | | | | This was added before edts support existed, and is no longer valid. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | mov: Remove ancient heuristic hackDerek Buitenhuis2016-08-25
| | | | | | | | | | | | | | | | This breaks files with legitimate single-entry edit lists, and the hack, introduced in f03a081df09f9c4798a17d7e24446ed47924b11b, has no link to any known sample in its commit message. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | libavformat/mov: Accept known codepoints in 'colr'Steven Robertson2016-08-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change relaxes the whitelist on reading color metadata in MOV/BMFF containers. The whitelist on writing values is still in place. As a consequence it also fixes an apparent bug in reading 'nclc' values. The 'nclc' spec [1] is in harmony with ISO 23001-8 for the values it lists, but the code getting removed was remapping 5->6 and 6->7 for primaries, which is incorrect, and was remapping 6->5 for color matrix ("colorspace" in the code), which is equivalent but an unnecessary inconsistency. This logic error doesn't appear in movenc. Removing the whitelist allows proper conversion when the source codec relies on the container for proper signaling of newer codepoints, such as DNxHR and VP9. If converting to a codec or container that has updated its spec to include the new codepoints, the metadata will be preserved. If going back to MOV/BMFF, the output whitelist will still kick in, so this won't result in out-of-spec files being created. [1] https://developer.apple.com/library/mac/technotes/tn2162/_index.html Signed-off-by: Steven Robertson <steven@strobe.cc> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/mov: Check STSD atom more completelyMichael Niedermayer2016-08-20
| | | | | | | | | | | | | | | | Fixes out of array read Fixes: 13262c363a28da8d6bdcc472aed6e9dc/asan_heap-oob_cfb5e2_3733_31cf3fcc783295c34222eb070a784f84.3gp Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>