summaryrefslogtreecommitdiff
path: root/libavformat
Commit message (Collapse)AuthorAge
* avformat/rpl: Replace strcpy with av_strlcpyCameron Cawley2019-07-10
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/dashdec: fix code style and remove some empty lineSteven Liu2019-07-10
|
* avformat/utils: Check timebase before use in estimate_timings()Michael Niedermayer2019-07-08
| | | | | | | | Fixes: division by 0 Fixes: 15480/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5746727434321920 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: Check for input length in get_v()Michael Niedermayer2019-07-08
| | | | | | | | Fixes: out of array read Fixes: 15286/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5658245101780992 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* matroskadec: Fix overflow introduced in a569a7b3Andreas Rheinhardt2019-07-06
| | | | | | | | | | | | | This commit fixes an overflow introduced in a569a7b3 that affected EBML elements that the Matroska demuxer doesn't want to parse like CRC-32 elements. The return value of avio_skip (the new position on success or an AVERROR on failure) has been assigned to an integer which meant that new positions in the range of 2GB to 4GB-1 etc. were considered errors. Fixes ticket #8001. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/rpl: Calculate the duration of the video trackCameron Cawley2019-07-05
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/rpl: Allow a file to have audio, but not videoCameron Cawley2019-07-05
| | | | | Signed-off-by: Cameron Cawley <ccawley2011@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/rpl: Fix detection of 8-bit linear formatsCameron Cawley2019-07-05
| | | | | | | | Was previously broken by commit 8cf5f94. Fixes ticket #7859 Signed-off-by: Cameron Cawley <ccawley2011@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/dashdec: fix code style in dash_read_packetSteven Liu2019-07-05
|
* avformat/dashdec: refine and fix code style of dash_read_headerSteven Liu2019-07-04
| | | | | move the temp variable to the top of the expression paragraph rename the pls to rep(representation)
* avformat/dashdec: simplified code in open_demux_for_componentSteven Liu2019-07-04
| | | | | | change from pls->ctx->streams[i]->codecpar to ist->codecpar Signed-off-by: Steven Liu <lq@onvideo.cn>
* ifv: populate creation_timePeter Ross2019-07-03
| | | | | Reviewed-by: Carl Eugen Hoyos <ceffmpeg@gmail.com> Signed-off-by: Peter Ross <pross@xvid.org>
* lavf/dump: More disposition flag dumpJun Zhao2019-07-03
| | | | | | | More disposition flag dump Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavf/utils: Respect default disposition when select the AVStreamJun Zhao2019-07-03
| | | | | | Respect default disposition when select the AVStream Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* libavformat/subfile: Improve AVSEEK_SIZE/SEEK_END seekingAndreas Rheinhardt2019-07-01
| | | | | | | | | | The subfile protocol treats an end of 0 as meaning "until EOF"; this got implemented by simply setting the end to INT64_MAX. But seeking relative to EOF or AVSEEK_SIZE seeking hasn't been adapted; the result is that e.g. the duration of transport streams isn't correctly determined when this option is used. This is fixed in this patch. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/dashdec: Fix reading values from SegmentTimeline inside Periodsfan52019-07-01
| | | | This was missed in commit e752da546463e693865d92a837fc0e8d2b28db2e.
* avformat/hlsenc: changing all filename length to MAX_URL_SIZEBela Bodecs2019-07-01
| | | | | | | | | Throughout hlsenc code, all filename related buffer lengths are set hardcoded as 1024. This PATCH change it to general value as MAX_URL_SIZE in internal.h Reviewed-by: Steven Liu <lq@onvideo.cn> Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
* avformat/aviobuf: Delay buffer downsizing until asserts are metMichael Niedermayer2019-06-30
| | | | | | | | | Fixes: Assertion failure Fixes: 15151/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5757079496687616 Fixes: 15205/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5767573242642432 May fix: Ticket7094 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vqf: Check header_sizeMichael Niedermayer2019-06-29
| | | | | | | | Fixes: 15271/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5735262606327808 Fixes: signed integer overflow: -2147483648 - 8 cannot be represented in type 'int' Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/hlsenc: temp_file usage for master playlist and vtt playlistBela Bodecs2019-06-28
| | | | | | | | | | | | | currently master playlist and subtitle playlist creation does not use temporary files even when temp_file flag is set. Most of the use cases it is not a problem because master playlist creation happens once on the beginning of the whole process. But if master playlist is periodically re-created because of master_pl_refresh_rate is set, non-atomic playlist creation may cause problems in case of live streaming. This patch correct this behavior by adding this functionality. Reviewed-by: Steven Liu <lq@onvideo.cn> Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
* libavformat/mux: Fix mixed delarations and codeAndreas Rheinhardt2019-06-27
| | | | | | This commit fixes mixed declarations and code introduced in 1889e316. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/sccdec: display last caption even when there is no empty last linePaul B Mahol2019-06-27
|
* hlsenc: Add option to set custom HTTP headersDerek Buitenhuis2019-06-27
| | | | Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* libavformat/mux: Fix audio_preloadAndreas Rheinhardt2019-06-26
| | | | | | | | | | | | | | | | | Commit 31f9032b added the audio_preload feature; its goal is to interleave audio earlier than the rest. Unfortunately, it has never ever worked, because the check for whether a packet should be interleaved before or after another packet was completely wrong: When audio_preload vanishes, interleave_compare_dts returns 1 if the new packet should be interleaved earlier than the packet it is compared with and that is what the rest of the code expects. But the codepath used when audio_preload is set does the opposite. Also fixes potential undefined behaviour (namely signed integer overflow). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/oggparseogm: sync avctx w/ codecparChris Cunningham2019-06-25
| | | | | Codec information may change while reading ogg packets. Update the stream's internal avctx to match.
* avformat/mov: Set fragment.found_tfhd only after TFHD has been parsedMichael Niedermayer2019-06-25
| | | | | | | | | Fixes: Assertion failure Fixes: crbug971646.mp4 Reported-by: Matt Wolenetz <wolenetz@google.com> Reviewed-by: Matt Wolenetz <wolenetz@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/img2dec: Fix probe_buffer leak in ff_img_read_header()Michael Niedermayer2019-06-25
| | | | | | | | Fixes: memleak Fixes: 15171/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5683881644130304 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: check length in read_vblock()Michael Niedermayer2019-06-25
| | | | | | | | Fixes: out of array access Fixes: 15166/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5731062396747776 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/dashenc: split extension for MP4 into .mp4 or .m4sAlfred E. Heggestad2019-06-25
|
* lavf/flvenc: add automatic bitstream filteringJun Zhao2019-06-25
| | | | | | | | add automatic bitstream filtering when mux AAC Reported-by: Yabo Wei weiyabogeijing@gmail.com Reviewed-by: Steven Liu<lq@onvideo.cn> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avformat/matroskadec: Improve error/EOF checks IIIAndreas Rheinhardt2019-06-24
| | | | | | | | | | | Up until now, when an element was skipped, it was relied upon ffio_limit to make sure that there is enough data available to skip. ffio_limit itself relies upon the availability of the file's size. As this needn't be available, the check has been refined: First one byte less than intended is skipped, then another byte is read, followed by a check of the error flags. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/matroskadec: Improve read error/EOF checks IIAndreas Rheinhardt2019-06-24
| | | | | | | | | | | | | | | | | This commit fixes a number of bugs: 1. There was no check that no read error/EOF occured during ebml_read_uint, ebml_read_sint and ebml_read_float. 2. ebml_read_ascii and ebml_read_binary did sometimes not forward error codes; instead they simply returned AVERROR(EIO). 3. In particular, AVERROR_EOF hasn't been used and no dedicated error message for it existed. This has been changed. In order to reduce code duplication, the new error code NEEDS_CHECKING has been introduced which makes ebml_parse check the AVIOContext's status for errors. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/matroskadec: Improve read error/EOF checks IAndreas Rheinhardt2019-06-24
| | | | | | | | | | | | | | | | | | | | ebml_read_num had a number of flaws: 1. The check for read errors/EOF was totally wrong. E.g. an EBML number beginning with the invalid 0x00 would be considered a read error, although it is just invalid data. 2. The check for read errors/EOF was done just once, after reading the first byte of the EBML number. But errors/EOF can happen inbetween, of course, and this wasn't checked. 3. There was no way to distinguish when EOF should be an error (because the data has to be there) for which an error message should be emitted and when it is not necessarily an error (namely during parsing of EBML IDs). Such a possibility has been added and used. All this was fixed; furthermore, the error messages for invalid EBML numbers were improved and useless initializations were removed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/matroskadec: Properly check return valuesAndreas Rheinhardt2019-06-24
| | | | | | | | Up until now, webm_dash_manifest_cues used the return values of ebml_read_num and ebml_read_length without checking for errors, i.e. return values < 0. This has been changed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/matroskadec: Don't zero unnecessarilyAndreas Rheinhardt2019-06-24
| | | | | | | | | | It is only necessary to zero the initial allocated memory used to store the size of laced frames if the block used Xiph lacing. Otherwise no unintialized data was ever used, so use av_malloc instead of av_mallocz. Also use the correct type for the allocations. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/hlsenc: better error log message for var_stream_map contentBela Bodecs2019-06-24
| | | | | | | | | | | | When multiple variant streams are specified by var_stream_map option, %v is expected either in the filename or in the last sub-directory name, but only in one of them. When both of them contains %v string, current error message only states half of the truth. And even %v may appears several times inside the last sub-directory name or in filename pattern. This patch clarifies this in the log message and in the doc also. Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
* avformat/matroskadec: Treat SimpleBlock as EBML_BINAndreas Rheinhardt2019-06-23
| | | | | | | | | | | | | | | Up until now, the SimpleBlock was treated specially: It basically had its own EBML category and it was also included in the BlockGroup EBML syntax (although a SimpleBlock must not exist in a BlockGroup according to the Matroska specifications). The latter fact also meant that a MatroskaBlock's buffer was always unreferenced twice. This has been changed: The type of a SimpleBlock is now an EBML_BIN. The only way in which SimpleBlocks are still different is that they share their associated structure with another unit (namely BlockGroup). This is also used to unref the block: It is always unreferenced via the BlockGroup syntax. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/matroskadec: Don't keep old blocksAndreas Rheinhardt2019-06-23
| | | | | | | | | | Before this commit, the Matroska muxer would read a block when required to do so, parse the block, create and return the necessary AVPackets and yet keep the blocks (in a dynamically allocated list), although they aren't used at all any more. This has been changed. There is no list any more and the block is immediately discarded after parsing. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/matroskadec: Remove redundant initializationAndreas Rheinhardt2019-06-23
| | | | | | | | | Every new element of an EbmlList is zeroed initially in ebml_parse_elem, so that in particular a SimpleBlock's duration is initialized to zero. Therefore it is unnecessary to initialize this field again (for SimpleBlocks) in matroska_parse_cluster_incremental. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/matroskadec: Set offset of first clusterAndreas Rheinhardt2019-06-23
| | | | | | | | | | | | | | | | | By default, the data_offset member of the AVFormatInternal of the AVFormatContext associated with the MatroskaDemuxContext has not been initialized explicitly by any Matroska-specific function, so that it was initialized by default to the offset at the end of matroska_read_header, i.e. usually to the offset of the length field of the first encountered cluster. This meant that in case that the Matroska-specific seek-code fails because there are no index entries for the target track a seek to data_offset would be performed and ordinary parsing would start from there which is nonsense: The length field would be treated as EBML ID and (if the length field is not longer than four bytes (EBML numbers that long are rejected as invalid EBML IDs)) whatever comes next would be treated as its EBML size although it simply isn't. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/matroskadec: Get rid of cluster size field assumptionAndreas Rheinhardt2019-06-23
| | | | | | | | | | The earlier code relied on the length of clusters always being coded on eight bytes as was the behaviour of libavformat's Matroska muxer until recently. But given that our own Matroska muxer now (and mkvmerge from time immemorial) creates files that don't conform to this assumption, it is high time to get rid of this assumption. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/matroskadec: Remove non-incremental parsing of clustersAndreas Rheinhardt2019-06-22
| | | | | | | | | When the new incremental parser was introduced, the old parser was kept, because the new parser was unable to handle the way SSA packets are put into Matroska. But since 2014 (since c7d8dbad) this is no longer needed, so that the old parser can be completely removed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/matroskadec: Use generic size check for signed integersAndreas Rheinhardt2019-06-22
| | | | | | | and drop the redundant checks contained in ebml_read_uint and ebml_read_sint. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/matroskadec: Don't copy attached picturesAndreas Rheinhardt2019-06-22
| | | | | | | This commit replaces copying attached pictures by using references to the already existing buffers. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/hlsenc: better checking var_stream_map contentBela Bodecs2019-06-22
| | | | | | | | | When multiple variant streams are specified by var_stream_map option, implementation assumes that each elementary stream is assigned only once to any variant. But this is not checked. This patch makes this checking. Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu> Reviewed-by: Steven Liu<lq@onvideo.cn>
* avformat/vividas: reduce keybits to require half the spaceMichael Niedermayer2019-06-21
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vividas: Fix invalid shift in decode_key()Michael Niedermayer2019-06-21
| | | | | | | | Fixes: left shift of 1 by 31 places cannot be represented in type 'int' Fixes: 15118/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5740230004441088 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/jacosubdec: Fix timeres to 1/100 units convertion overflowMichael Niedermayer2019-06-21
| | | | | | | | Fixes: signed integer overflow: 44444442 * 100 cannot be represented in type 'int' Fixes: 15117/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5164660531134464 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/icodec: Free ico->images on error pathsMichael Niedermayer2019-06-21
| | | | | | | | Fixes: 15116/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5715173567889408 Fixes: memleak Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/wsddec: Fix undefined shiftMichael Niedermayer2019-06-21
| | | | | | | | Fixes: left shift of 1 by 31 places cannot be represented in type 'int' Fixes: 15123/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5738039235575808 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>