summaryrefslogtreecommitdiff
path: root/libavformat
Commit message (Collapse)AuthorAge
...
* | avformat/mov: Fix integer overflows related to sample_durationMichael Niedermayer2018-03-12
| | | | | | | | | | | | | | | | | | | | Fixes: runtime error: signed integer overflow: -9166684017437101870 + -2495066639299164439 cannot be represented in type Fixes: Chromium bug 791349 Reported-by: Matt Wolenetz <wolenetz@google.com> Reviewed-by: Matt Wolenetz <wolenetz@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/mov.c: Use the correct offset to shift timestamp when seeking.Sasi Inguva2018-03-10
| | | | | | | | | | | | | | | | Fixes seek for files with empty edits and files with negative ctts (dts_shift > 0). Added fate samples and tests. Signed-off-by: Sasi Inguva <isasi@isasi.mtv.corp.google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/img2dec: fix infinite loopMichael Niedermayer2018-03-10
| | | | | | | | | | | | | | | | Fixes: kira-poc Found-by: Kira <kira_cxy@foxmail.com> Change suggested by Kira Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/oggparsedaala: Do not adjust AV_NOPTS_VALUEMichael Niedermayer2018-03-10
| | | | | | | | | | | | Fixes: potential signed integer overflow Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/oggparseogm: Check lb against psizeMichael Niedermayer2018-03-10
| | | | | | | | | | | | | | | | No testcase, this was found during code review Found-by: Matt Wolenetz <wolenetz@google.com> Reviewed-by: Matt Wolenetz <wolenetz@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/oggparseogm: Fix undefined shift in ogm_packet()Michael Niedermayer2018-03-10
| | | | | | | | | | | | | | | | Fixes: shift exponent 48 is too large for 32-bit type 'int' Fixes: Chromium bug 786793 Reported-by: Matt Wolenetz <wolenetz@google.com> Reviewed-by: Matt Wolenetz <wolenetz@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/avidec: Fix integer overflow in cum_len checkMichael Niedermayer2018-03-10
| | | | | | | | | | | | | | | | | | Fixes: signed integer overflow: 3775922176 * 4278190080 cannot be represented in type 'long' Fixes: Chromium bug 791237 Reported-by: Matt Wolenetz <wolenetz@google.com> Reviewed-by: Matt Wolenetz <wolenetz@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/oggparsetheora: Do not adjust AV_NOPTS_VALUEMichael Niedermayer2018-03-10
| | | | | | | | | | | | | | | | Fixes: Chromium bug 795653 Fixes: signed integer overflow: 9223372036854775807 + 1 cannot be represented in type 'long' Reported-by: Matt Wolenetz <wolenetz@google.com> Reviewed-by: Matt Wolenetz <wolenetz@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/mxfdec: do not allow more partitions than INT_MAX/2Marton Balint2018-03-09
| | | | | | | | | | | | | | Some math (e.g: partition binary search) overflows if we have that many parititions. Signed-off-by: Marton Balint <cus@passwd.hu>
* | avformat/mxfdec: use binary search in mxf_absolute_bodysid_offsetMarton Balint2018-03-09
| | | | | | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* | avformat/mxfdec: fix opAtom audio demuxingMarton Balint2018-03-09
| | | | | | | | | | | | | | | | | | Consider edit rate when determining edit_units_per_packet and also make sure that checks are done in edit rate time base and not in stream time base. Fixes some errors reported with the sample in ticket #5863. Signed-off-by: Marton Balint <cus@passwd.hu>
* | avformat/mov: print the projection type when reporting it as unsupportedJames Almer2018-03-09
| | | | | | | | | | Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* | ffmpeg: Fix stts_data memory allocationXiaohan Wang2018-03-09
| | | | | | | | | | | | | | | | | | In this loop, |i| is the "index". And the memory allocated should be at least the current "count", which is |i + 1|. BUG=801821 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | sbc: add raw muxer for SBCAurelien Jacobs2018-03-07
| |
* | sbc: add raw demuxer for SBCAurelien Jacobs2018-03-07
| |
* | avformat/utils: Fix integer overflow of fps_first/last_dtsMichael Niedermayer2018-03-07
| | | | | | | | | | | | | | Fixes: runtime error: signed integer overflow: 7738135736989908991 - -7898362169240453118 cannot be represented in type 'long' Fixes: Chromium bug 796778 Reported-by: Matt Wolenetz <wolenetz@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/oggdec: Fix metadata memleak on multiple headersMichael Niedermayer2018-03-07
| | | | | | | | | | | | | | Fixes: Chromium bug 800123 Reported-by: Matt Wolenetz <wolenetz@google.com> Reviewed-by: Matt Wolenetz <wolenetz@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | libavformat/oggparsevorbis: Fix memleak on multiple headersMichael Niedermayer2018-03-07
| | | | | | | | | | | | | | Fixes: Chromium bug 800123 Reported-by: Matt Wolenetz <wolenetz@google.com> Reviewed-by: Matt Wolenetz <wolenetz@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/mov: Fix integer overflow in mov_get_stsc_samples()Michael Niedermayer2018-03-07
| | | | | | | | | | | | | | | | Fixes: runtime error: signed integer overflow: 5 * -2147483647 cannot be represented in type 'int' Fixes: Chromium bug 817338 Reviewed-by: Matt Wolenetz <wolenetz@google.com> Reported-by: Matt Wolenetz <wolenetz@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/internal: Document the freeing behavior of ff_alloc_extradata()Michael Niedermayer2018-03-07
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/isom: don't free extradata before calling ff_get_extradata()James Almer2018-03-06
| | | | | | | | | | | | | | | | | | | | | | ff_get_extradata() frees any existing extradata before allocating now, and using av_free() here leaves a dangling pointer that will result in a double free. Fixes a regression since 0ca33b1d4eb2a2a2e78ff3a37f1647917635b0d2. Tested-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* | libavformat/tls_libtls: pass numeric hostnames to tls_connect_cbs()Stefan _2018-03-07
| | | | | | | | | | | | | | Numeric hosts in certificates are not very common, but supported by LibreSSL. Forward the IP address to make verification work in this case. Fixes ticket #7029
* | avformat/utils: simplify ff_alloc_extradata()James Almer2018-03-06
| | | | | | | | | | | | | | Cosmetic refactor Reviewed-by: 74a2fa708af88d225ed708af758f236f869b1a57 Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat/utils: free existing extradata before trying to allocate a new oneJames Almer2018-03-06
| | | | | | | | | | | | | | | | This prevents leaks in the rare cases the function is called when extradata already exists. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat/mov: Initialize a potential gap in ctts_data in mov_build_indexMatt Wolenetz2018-03-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mov_read_ctts ignores ctts entries having count <= 0. Generally, the aggregate of all ctts entries' count fields resulting from mov_read_ctts can be less than the corresponding sample_count. mov_build_index attempts to normalize any existing ctts_data counts to be 1, to make a 1-1 mapping of a ctts_data entry to a sample. That 1-1 mapping left a tail of uninitialized ctts_data entries when the aggregate, normalized ctts_count < sample_count. Even more generally, later usage of ctts_data may depend on the entire ctts_allocated_size having been initialized. This change memsets the entire allocation of the normalized ctts_data in mov_build_index, to prevent use of uninitialized data later. BUG=816787 Change-Id: I7fd7db255e3aeed076ee32c90cb2df211741c052 Reviewed-on: https://chromium-review.googlesource.com/947110 Reviewed-by: Xiaohan Wang <xhwang@chromium.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/mov: Add manu/modl to mov_read_udta_string.Tianqiang Liu2018-03-03
| | | | | | | | | | | | Documentation: http://mp4ra.org/atoms.html Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/dashenc: Use HTTP DELETE for HTTP base protoSerhii Marchuk2018-03-03
| |
* | avformat/dashenc: fix for segment open issue when persistent connection is ↵Vishwanath Dixit2018-03-03
| | | | | | | | enabled
* | avformat/mxg: return reference counted packetsJames Almer2018-03-02
| | | | | | | | | | Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat/hlsenc: add reference stream index for split segmentSteven Liu2018-03-02
| | | | | | | | | | | | | | | | | | fix ticket: #7044 Get the first video stream to reference for split segment when there have more than one video stream Signed-off-by: Steven Liu <lq@chinaffmpeg.org> Reviewed-by: Karthick Jeyapal <kjeyapal@akamai.com>
* | ffmpeg: Fix memset size on ctts_data in mov_read_trun() (round 2)Xiaohan Wang2018-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The allocated size of sc->ctts_data is (st->nb_index_entries + entries) * sizeof(*sc->ctts_data). The size to memset at offset sc->ctts_data + sc->ctts_count should be (st->nb_index_entries + entries - sc->ctts_count) * sizeof(*sc->ctts_data)) The current code missed |entries| I believe, which was introduced in https://patchwork.ffmpeg.org/patch/5541/. However, after offline discussion, it seems the original code is much more clear to read (before https://patchwork.ffmpeg.org/patch/5541/). Hence this CL revert the memset logic to it's previous state by remembering the |old_ctts_allocated_size|, and only memset the newly allocated entries. BUG=812567 Change-Id: Ibe94c7138e5818bfaae76866bfa6619a9b8a2b6b Reviewed-on: https://chromium-review.googlesource.com/934925 Reviewed-by: Dale Curtis <dalecurtis@chromium.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/mxfdec: always use a stream which matches the first index table ↵Marton Balint2018-03-01
| | | | | | | | | | | | | | | | | | | | | | when seeking Obviously this is still not perfect, but better then it was. Using the first index table and mxf->current_edit_unit is still hardcoded in many places, so this change has hopefully the less chance of breaking anything that works now. Signed-off-by: Marton Balint <cus@passwd.hu>
* | avformat/mxfdec: compute sample_count after seek from index for audio streamsMarton Balint2018-03-01
| | | | | | | | | | | | | | This fixes audio timestamps if the audio streams are not frame wrapped with the video. Signed-off-by: Marton Balint <cus@passwd.hu>
* | avformat/mxfdec: use body_offset of the partitions in ↵Marton Balint2018-03-01
| | | | | | | | | | | | | | | | | | | | | | mxf_absolute_bodysid_offset Use body_offset of the partitions to search for the partition with the given offset in the essence. This makes the function find the correct partition for non frame-wrapped essences as well, where only the essence data is part of the the edit unit byte count, not the KLV-s. Signed-off-by: Marton Balint <cus@passwd.hu>
* | avformat/mxfdec: set index_duration from the track using the indexMarton Balint2018-03-01
| | | | | | | | | | | | Also use original_duration as index_duration is in edit units. Signed-off-by: Marton Balint <cus@passwd.hu>
* | avformat/mxfdec: fix sorting of index segmentsMarton Balint2018-03-01
| | | | | | | | | | | | Fixes ticket #5320. Signed-off-by: Marton Balint <cus@passwd.hu>
* | avformat/mxfdec: use both body_sid and track_number to find the track of a ↵Marton Balint2018-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | packet In order to do that we have to parse the EssenceContainerData and assign the proper body_sid and index_sid to the tracks from the corresponding source packages. This fixes packets returned in the wrong stream for some OP1-b files. Based on a patch by Alex Mogurenko from https://github.com/da8eat/FFmpeg Reference: http://mogurenko.com/2018/01/02/mxf-op1b-ffmpeg-part1/ Signed-off-by: Marton Balint <cus@passwd.hu>
* | avformat/mxfdec: use full UMID to resolve source packageMarton Balint2018-03-01
| | | | | | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* | avformat/mxfdec: use the first system item if available for calculating ↵Marton Balint2018-03-01
| | | | | | | | | | | | | | | | | | | | essence_offset Also add an additional system item key. Fixes parsing of ffmpeg-bugs/trac/ticket2817/warehouse.mxf Signed-off-by: Marton Balint <cus@passwd.hu>
* | avformat/mxfdec: fix essence_offset calculationMarton Balint2018-03-01
| | | | | | | | | | | | | | | | | | The reference point for a KAG is the first byte of the key of a Partition Pack. Fixes ticket #2817. Fixes ticket #5317. Signed-off-by: Marton Balint <cus@passwd.hu>
* | avformat/mxfdec: fix indentationMarton Balint2018-03-01
| | | | | | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* | avformat/dashenc: Removed usage of deprecated 'filename' variableKarthick Jeyapal2018-02-27
| |
* | avformat/dashenc: add option to change HTTP methodSerhii Marchuk2018-02-27
| |
* | avformat/utils: don't overwrite the return value of read_packet()James Almer2018-02-26
| | | | | | | | | | | | | | This only affected demuxers that didn't return reference counted packets. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat/concatdec: add support for very long line sizesMarton Balint2018-02-24
| | | | | | | | | | | | Fixes ticket #6761. Signed-off-by: Marton Balint <cus@passwd.hu>
* | avformat/aviobuf: add ff_read_line_to_bprint and ↵Marton Balint2018-02-24
| | | | | | | | | | | | | | | | ff_read_line_to_bprint_overwrite functions To be able to read lines longer than a static buffer size. Signed-off-by: Marton Balint <cus@passwd.hu>
* | Add muxer/demuxer for raw codec2 and .c2 filesTomas Härdin2018-02-24
| |
* | avformat/dashenc: chunk streaming support for low latency use casesVishwanath Dixit2018-02-24
| |
* | avformat/dashenc: opening a segment file when its first frame is readyVishwanath Dixit2018-02-24
| |
* | avformat/hvcc: zero initialize the nal buffers past the last written byteJames Almer2018-02-24
| | | | | | | | | | | | | | | | | | Prevents use of uninitialized values. Fixes ticket #7038. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>