summaryrefslogtreecommitdiff
path: root/libavformat
Commit message (Collapse)AuthorAge
...
* | avformat/mxfenc: Comment edit rate write code like the surrounding codeMichael Niedermayer2017-09-12
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/mxfenc: Replace more literal magic numbers by enum values.Michael Niedermayer2017-09-12
| | | | | | | | | | | | This also moves the enum table up as it is needed earlier Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Add SUP/PGS subtitle muxerPetri Hintukainen2017-09-09
| | | | | | | | Fixes ticket #2208
* | avformat/dashdec: free resource allocated by xmlSteven Liu2017-09-09
| | | | | | | | | | | | | | modify from av_free to xmlFree Suggested-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* | avformat/dashdec: add dash demuxer base versionSteven Liu2017-09-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ffmpeg need a dash demuxer for demux the dash formats base on https://github.com/samsamsam-iptvplayer/exteplayer3/blob/master/tmp/ffmpeg/patches/3.2.2/000001_add_dash_demux.patch TODO: 1. support multi bitrate dash. v2 fixed: 1. from autodetect to disabled 2. from camelCase code style to ffmpeg code style 3. from RepType to AVMediaType 4. fix variable typo 5. change time value from uint32_t to uint64_t 6. removed be used once API 7. change 'time(NULL)`, except it is not 2038-safe.' to av_gettime and av_timegm 8. merge complex free operation to free_fragment 9. use API from snprintf to av_asprintf v3 fixed: 1. fix typo from --enabled-xml2 to --enable-xml2 v4 fixed: 1. from --enable-xml2 to --enable-libxml2 2. move system includes to top 3. remove nouse includes 4. rename enum name 5. add a trailing comma for the last entry enum 6. fix comment typo 7. add const to DASHContext class front 8. check sscanf if return arguments and give warning message when error 9. check validity before free seg->url and seg 10. check if the val is null, before use atoll v5 fixed: 1. fix typo from mainifest to manifest v6 fixed: 1. from realloc to av_realloc 2. from free to av_free v7 fixed: 1. remove the -lxml2 from configure when require_pkg_config v8 fixed: 1. fix replace filename template by av_asprintf secure problem v9 modified: 1. make manifest parser clearly v10 fixed: 1. fix function API name code style 2. remove redundant strreplace call 3. remove redundant memory operation and check return value from get_content_url() 4. add space between ) and { 5. remove no need to log the value for print v11 fixed: 1. from atoll to strtoll Suggested-by: Michael Niedermayer <michael@niedermayer.cc> v12 fixed: 1. remove strreplace and instead by av_strreplace Suggested-by: Nicolas George <george@nsup.org> v13 fixed: 1. fix bug: cannot play: http://dash.edgesuite.net/akamai/bbb_30fps/bbb_30fps.mpd Reported-by: Andy Furniss <adf.lists@gmail.com> v14 fixed: 1. fix bug: TLS connection was non-properly terminated 2. fix bug: No trailing CRLF found in HTTP header Reported-by: Andy Furniss <adf.lists@gmail.com> v15 fixed: 1. play youtube link: ffmpeg -i $(youtube-dl -J "https://www.youtube.com/watch?v=XmL19DOP_Ls" | jq -r ".requested_formats[0].manifest_url") 2. code refine for timeline living stream Reported-by: Ricardo Constantino <wiiaboo@gmail.com> v16 fixed: 1. remove the snprintf and instead by get_segment_filename make safety 2. remove unnecessary loops 3. updated xmlStrcmp and xmlFree to av_* functions 4. merge code repeat into one function 5. add memory alloc faild check 6. update update_init_section and open_url 7. output safety error message when filename template not safe Suggested-by : wm4 <nfxjfg@googlemail.com> v17 fixed: 1. add memory alloc faild check 2. fix resource space error at free_representation v18 fixed: 1. add condition of template format v19 fixed: 1. fix typo of the option describe v20 fixed: 1. add the c->base_url alloc check 2. make the DASHTmplId same to dashenc v21 fixed: 1. remove get_repl_pattern_and_format and get_segment_filename 2. process use dashcomm APIs v22 fixed: 1. modify the include "dashcomm.h" to include "dash.h" 2. use internal API from dash_fill_tmpl_params to ff_dash_fill_tmpl_params Signed-off-by: Steven Liu <lq@onvideo.cn> Signed-off-by: samsamsam <samsamsam@o2.pl>
* | avformat/matroskaenc: also write tags when output is WebMJames Almer2017-09-08
| | | | | | | | | | | | | | | | WebM supports a subset of elements from the Tags master. See https://www.webmproject.org/docs/container/#tagging Reviewed-by: Ivan Janatra <janatra@google.com> Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat/asfdec: Fix DoS in asf_build_simple_index()Michael Niedermayer2017-09-07
| | | | | | | | | | | | | | | | Fixes: Missing EOF check in loop No testcase Found-by: Xiaohei and Wangchu from Alibaba Security Team Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/mov: Fix DoS in read_tfra()Michael Niedermayer2017-09-07
| | | | | | | | | | | | | | | | Fixes: Missing EOF check in loop No testcase Found-by: Xiaohei and Wangchu from Alibaba Security Team Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/gdv: Make FixedSize staticMichael Niedermayer2017-09-07
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | flvdec: Check the avio_seek return value after reading a metadata packetSteven Liu2017-09-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | merge from libav: 585dc1aecef0371ad6f16cb3750ae2a6da9cf00a If the metadata packet is corrupted, flv_read_metabody can accidentally read past the start of the next packet. If the start of the next packet had been flushed out of the IO buffer, we would be unable to seek to the right position (on a nonseekable stream). Prefer to clearly error out instead of silently trying to read from a desynced stream which will only be interpreted as garbage. Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* | avformat/hlsenc: Added configuration to override HTTP User-AgentKarthick J2017-09-05
| | | | | | | | | | Signed-off-by: Karthick J <kjeyapal@akamai.com> Signed-off-by: Steven Liu <lq@onvideo.cn>
* | avformat/flvdec: Set need_context_update when setting the initial extradataAlex Converse2017-09-03
| | | | | | | | | | | | Fixes ticket 6398. Debugged with the help of James Almer and Hendrik Leppkes.
* | lavf: make avio_read_partial() publicwm42017-09-01
| | | | | | | | | | | | | | | | | | Main use-case is proxying avio through a foreign I/O layer and a custom AVIO context, without losing latency and performance characteristics. Signed-off-by: Luca Barbato <lu_zero@gentoo.org> Merged from Libav commit 173b56218f39c64.
* | avformat/avio: update avio_alloc_context() doxyJames Almer2017-09-01
| | | | | | | | | | | | | | | | It must be freed using avio_context_free() starting with commit b12e4d3bb8df994f042ff1216fb8de2b967aab9e. Found-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat/dash:add copyright to dash.cSteven Liu2017-09-01
| | | | | | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* | Use the new AVIOContext destructor.Anton Khirnov2017-09-01
| | | | | | | | | | (cherry picked from commit 6f554521afdf7ab4edbfaa9536660a1dca946b19) Signed-off-by: James Almer <jamrial@gmail.com>
* | avio: add a destructor for AVIOContextAnton Khirnov2017-09-01
| | | | | | | | | | | | | | | | Before this commit, AVIOContext is to be freed with a plain av_free(), which prevents us from adding any deeper structure to it. (cherry picked from commit 99684f3ae752fc8bfb44a2dd1482f8d7a3d8536d) Signed-off-by: James Almer <jamrial@gmail.com>
* | avformat/dash: move reused API to common file and header fileSteven Liu2017-09-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | move from dashenc, move DASHTmplId and dash_fill_tmpl_params to dash.c, they will be used by dash demuxer and dash muxer. v2 fixed: 1. rename common file from dashcomm.* to dash.* Suggested-by: Hendrik Leppkes <h.leppkes@gmail.com> v3 fixed: 1. rename header file pre defined 2. add ff_ prefix for the internal API Suggested-by: James Almer <jamrial@gmail.com> Suggested-by: Timo Rothenpieler <timo@rothenpieler.org> Reviewed-by: wm4 <nfxjfg@googlemail.com> Signed-off-by: Steven Liu <lq@onvideo.cn>
* | avformat/mxfdec: Fix Sign error in mxf_read_primer_pack()孙浩(晓黑)2017-09-01
| | | | | | | | | | | | | | | | Fixes: 20170829B.mxf Co-Author: 张洪亮(望初)" <wangchu.zhl@alibaba-inc.com> Found-by: Xiaohei and Wangchu from Alibaba Security Team Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/mxfdec: Fix DoS issues in mxf_read_index_entry_array()孙浩(晓黑)2017-09-01
| | | | | | | | | | | | | | | | Fixes: 20170829A.mxf Co-Author: 张洪亮(望初)" <wangchu.zhl@alibaba-inc.com> Found-by: Xiaohei and Wangchu from Alibaba Security Team Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/nsvdec: Fix DoS due to lack of eof check in nsvs_file_offset loop.孙浩(晓黑)2017-09-01
| | | | | | | | | | | | | | | | Fixes: 20170829.nsv Co-Author: 张洪亮(望初)" <wangchu.zhl@alibaba-inc.com> Found-by: Xiaohei and Wangchu from Alibaba Security Team Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/mov: prevent duplication of first fragment's ctts_dataDaniel Glöckner2017-09-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MP4 files with fragments might have the first moof box that is mentioned in a fragment index before the first mdat box. Since it is then already parsed by mov_read_header, we have to make sure that mov_switch_root will not parse it again when seeking by setting the headers_read flag in the index. Parsing it a second time would cause the ctts_data array to receive a second copy of the information from the trun box, leading to wrong PTS values for the second and following fragments in presence of B-frames. Fixes ticket 6560. Signed-off-by: Daniel Glöckner <daniel-gl@gmx.net> Reviewed-by: Dale Curtis <dalecurtis@chromium.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/mov: Bail when invalid sample data is present.Dale Curtis2017-09-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ctts data in ffmpeg relies on the index entries array to be 1:1 with samples... yet sc->sample_count can be read directly from the 'stsz' box and index entries are only generated if a chunk count has been read from 'stco' box. Ensure that if sc->sample_count > 0, sc->chunk_count is too as a basic sanity check. Additionally we need to check that after the index is built we have the right number of entries, so we also check in mov_read_trun() that sc->sample_count == st->nb_index_entries. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/concatdec: add fallback for calculating file durationJustin Ruggles2017-08-31
| | | | | | | | | | | | | | | | | | If a file does not have a known duration, this leads to the timestamps starting over for the next file, causing non-monotonic timestamps. To prevent this, track the duration during demuxing and use it to determine the current file duration before opening the next file. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | Add FITS MuxerParas Chadha2017-08-30
| | | | | | | | Signed-off-by: Paras Chadha <paraschadha18@gmail.com>
* | Add FITS DemuxerParas Chadha2017-08-30
| | | | | | | | Signed-off-by: Paras Chadha <paraschadha18@gmail.com>
* | avformat/mxfenc: Replace literal numbers by named enum values.Michael Niedermayer2017-08-30
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/mxfenc: Check that the video codec in D-10 is MPEG-2Michael Niedermayer2017-08-29
| | | | | | | | | | | | | | | | Others do not work, but nothing rejects them prior to this patch if the parameters otherwise match Reviewed-by: Matthieu Bouron <matthieu.bouron@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/dump: Remove superfluous cast.Carl Eugen Hoyos2017-08-29
| |
* | avformat/mvdec: Fix DoS due to lack of eof checkMichael Niedermayer2017-08-27
| | | | | | | | | | | | | | Fixes: loop.mv Found-by: Xiaohei and Wangchu from Alibaba Security Team Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/rl2: Fix DoS due to lack of eof check孙浩 and 张洪亮(望初)2017-08-27
| | | | | | | | | | | | | | Fixes: loop.rl2 Found-by: Xiaohei and Wangchu from Alibaba Security Team Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/rmdec: Fix DoS due to lack of eof check孙浩 and 张洪亮(望初)2017-08-27
| | | | | | | | | | | | | | Fixes: loop.ivr Found-by: Xiaohei and Wangchu from Alibaba Security Team Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/cinedec: Fix DoS due to lack of eof check孙浩 and 张洪亮(望初)2017-08-27
| | | | | | | | | | | | | | Fixes: loop.cine Found-by: Xiaohei and Wangchu from Alibaba Security Team Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/asfdec: Fix DoS due to lack of eof check孙浩 and 张洪亮(望初)2017-08-27
| | | | | | | | | | | | | | Fixes: loop.asf Found-by: Xiaohei and Wangchu from Alibaba Security Team Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/hls: Fix DoS due to infinite loopMichael Niedermayer2017-08-27
| | | | | | | | | | | | | | | | | | | | | | Fixes: loop.m3u The default max iteration count of 1000 is arbitrary and ideas for a better solution are welcome Found-by: Xiaohei and Wangchu from Alibaba Security Team Previous version reviewed-by: Steven Liu <lingjiujianke@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | lavf/rawenc: Add little- and big-endian G.726 muxers.Carl Eugen Hoyos2017-08-26
| |
* | lavf/g726: Demuxer for raw G.726 streams, both left- and right-justified.Carl Eugen Hoyos2017-08-24
| | | | | | | | | | Compatible with the binary encoder attached to ticket #6596 (right-aligned) and a sample from a SEG Mp3-Player (left-aligned).
* | avformat/mov: Fix trampling of ctts during seeks when sidx support is enabled.Dale Curtis2017-08-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When sidx box support is enabled, the code will skip reading all trun boxes (each containing ctts entries for samples inthat box). If seeks are attempted before all ctts values are known, the old code would dump ctts entries into the wrong location. These are then used to compute pts values which leads to out of order and incorrectly timestamped packets. This patch fixes ctts processing by always using the index returned by av_add_index_entry() as the ctts_data index. When the index gains new entries old values are reshuffled as appropriate. This approach makes sense since the mov demuxer is already relying on the mapping of AVIndex entries to samples for correct demuxing. As a result of this all ctts entries are now 1-count. A followup change will be submitted to remove support for > 1 count entries which will simplify seeking. Notes for future improvement: Probably there are other boxes (stts, stsc, etc) that are impacted by this issue... this patch only attempts to fix ctts since it completely breaks packet timestamping. This patch continues using an array for the ctts data, which is not the most ideal given the rearrangement that needs to happen (via memmove as new entries are read in). Ideally AVIndex and the ctts data would be set-type structures so addition is always worst case O(lg(n)) instead of the O(n^2) that exists now; this slowdown is noticeable during seeks. Signed-off-by: Dale Curtis <dalecurtis@chromium.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/rtpdec_h264: Fix heap-buffer-overflowMichael Niedermayer2017-08-23
| | | | | | | | | | | | | | Fixes: rtp_sdp/poc.sdp Found-by: Bingchang <l.bing.chang.bc@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/aviobuf: Fix signed integer overflow in avio_seek()Vitaly Buka2017-08-23
| | | | | | | | | | | | | | | | Signed integer overflow is undefined behavior. Detected with clang and -fsanitize=signed-integer-overflow Signed-off-by: Vitaly Buka <vitalybuka@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/mov: Fix signed integer overflows with total_sizeVitaly Buka2017-08-23
| | | | | | | | | | | | | | | | Signed integer overflow is undefined behavior. Detected with clang and -fsanitize=signed-integer-overflow Signed-off-by: Vitaly Buka <vitalybuka@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/hlsenc: move free fmp4_init_filename after hls_window operationSteven Liu2017-08-22
| | | | | | | | | | | | fix ticket id: 6599 Signed-off-by: Steven Liu <lq@onvideo.cn>
* | lavf/bink: fix latest header and add all existing revisionsbnnm2017-08-20
| | | | | | | | | | | | | | KB2 'i' found in Life is Strange (Xbox 360), rest verified against binkconv.exe Signed-off-by: bnnm <bananaman255@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | libavformat/mov: Fix inserting frames before current_frame.Jacob Trimble2017-08-18
| | | | | | | | | | | | | | | | | | | | When using streaming input, it may be possible to see frames that appear before the current_frame. When these frames are inserted into the index, the current_frame needs to be updated so it is still pointing at the same frame. Signed-off-by: Jacob Trimble <modmaker@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/utils: always av_reduce r_frame_rateMarton Balint2017-08-17
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Marton Balint <cus@passwd.hu>
* | avformat/mov: Fix memory leak when reading DDTS box.Nikolas Bowe2017-08-16
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/avidec: Move packet skip after prefix and related checksMichael Niedermayer2017-08-11
| | | | | | | | | | | | | | This fixes loosing packets Fixes: big.avi Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/movenc: reindent after the previous commitJames Almer2017-08-09
| |
* | lavf/movenc.c: Set sgpd and sbgp atoms to represent decoder delay for AAC.Sasi Inguva2017-08-10
| | | | | | | | | | | | | | | | According to https://developer.apple.com/library/content/documentation/QuickTime/QTFF/QTFFAppenG/QTFFAppenG.html and ISO-IEC-14496-12 Section 10.1.1.1 and 10.1.1.3 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/hlsenc: allow dynamic encryption key rotationDeHackEd2017-08-06
| | | | | | | | | | | | | | | | Makes behaviour of 805ce25b1d2f optional, re-enables HLS key rotation feature Reviewed-by: Steven Liu <lq@onvideo.cn> Signed-off-by: DHE <git@dehacked.net>