summaryrefslogtreecommitdiff
path: root/libavformat
Commit message (Collapse)AuthorAge
...
* 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>
* avformat/tiertexseq: Cleanup on errorMichael Niedermayer2019-06-21
| | | | | | | | Fixes: memleak Fixes: 15122/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5685964636160000 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/tiertexseq: Move seq_read_close() up so it can be used for cleanupMichael Niedermayer2019-06-21
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/ifv: added support for ifv cctv filesSwaraj Hota2019-06-21
| | | | | | | Fixes ticket #2956. Signed-off-by: Swaraj Hota <swarajhota353@gmail.com> Signed-off-by: Peter Ross <pross@xvid.org>
* avformat/segment: fix muxing tmcd tracks in MOVGyan Doshi2019-06-20
| | | | | | avformat/movenc still relies on AVCodecContext time_base to mux tmcd tracks and segment muxer did not copy that field to inner streams leading to SIGFPE in the child muxer instance.
* avformat/hlsenc: enhanced %v handling with variant namesBodecs Bela2019-06-20
| | | | | | | | | | | | | | | | When multiple variant streams are specified by var_stream_map option, %v placeholder in various names ensures that each variant has its unique names. Currently %v is substituted by its variant index value (0, 1, 2 etc.). In some use cases it would be handy to specify names for variants instead of numerical indexes. This patch makes it possible to use names instead of default indexes. In var_stream_map option each or some of the variant streams may use an optional name attributum (e.g. -var_stream_map "v:0,a:0,name:sd v:1,a:1,name:720p") If a name is specified for a variant, then this name value will be used as substitution value of %v instead of the default index value. Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu> Signed-off-by: Steven Liu <lq@onvideo.cn>
* av_format/hlsenc: fix %v handling by format_name functionBodecs Bela2019-06-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hi All, When multiple variant streams are specified by var_stream_map option, %v placeholder in various names ensures that each variant has its unique names. Most of %v handlng is done in format_name function. Currently in this function the result buffer is the same as the input pattern buffer, so you must allocate it before calling format_name function. It also means, that it is silently assumed that the result string will NOT be longer that the pattern string. It is true most of the time, because %v may appear only once in the pattern string and number of variant streams is less than 100 in practical cases. But theoretically it will fail if specified number of variant streams is greater than 100 (i.e. longer than 2 digits). This patch fixes this behaviour by altering format_name function to allocate the result buffer and return it to the caller. Please, review this patch. best, Bela >From 6377ebee8a106a9684d41b270c7d6c8e57cd3e7b Mon Sep 17 00:00:00 2001 From: Bela Bodecs <bodecsb@vivanet.hu> Date: Mon, 17 Jun 2019 14:31:36 +0200 Subject: [PATCH] av_format/hlsenc: fix %v handling by format_name function When multiple variant streams are specified by var_stream_map option, %v placeholder in various names ensures that each variant has its unique names. Most of %v handlng is done in format_name function. Currently in this function the result buffer is the same as the input pattern buffer, so you must allocate it before calling format_name function. It also means, that it is silently assumed that the result string will NOT be longer that the pattern string. It is true most of the time, because %v may appear only once in the pattern string and number of variant streams is less than 100 in practical cases. But theoretically it will fail if specified number of variant streams is greater than 100. This patch fixes this behaviour by altering format_name function to allocate the result buffer and return it to the caller. Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
* avformat/segment: fix increment_tcGyan Doshi2019-06-18
| | | | | | inner stream avg_frame_rate wasn't populated, so tc formation failed. Also, extended increment_tc to cover individual stream timecode.
* avformat/wtvdec: Avoid (32bit signed) sectorsMichael Niedermayer2019-06-14
| | | | | | | | | Fixes: left shift of negative value -14614752 Fixes: 15174/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5670543606415360 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/sbgdec: Fixes integer overflow in str_to_time() with hoursMichael Niedermayer2019-06-14
| | | | | | | | Fixes: signed integer overflow: 904444 * 3600 cannot be represented in type 'int' Fixes: 15113/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5764083346833408 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vpk: Check offset for validityMichael Niedermayer2019-06-14
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/vpk: Fix integer overflow in samples_per_block computationMichael Niedermayer2019-06-14
| | | | | | | | Fixes: signed integer overflow: 84026453 * 28 cannot be represented in type 'int' Fixes: 15111/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5675630072430592 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavf/tls_gnutls: retry gnutls_handshake on non fatal errorsRemita Amine2019-06-14
| | | | | | fixes #7801 Signed-off-by: Remita Amine <remitamine@gmail.com>
* avformat/dashdec: check copy_init_section memory alloc resultSteven Liu2019-06-14
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* lavf/hls: More log messageJun Zhao2019-06-14
| | | | | | | More log message, it's will help the debugging Reviewed-by: Steven Liu <lq@chinaffmpeg.org> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* lavf/webvtt: fix ffmpeg -h demuxer=webvtt can't dump optionsJun Zhao2019-06-14
| | | | | | fix ffmpeg -h demuxer=webvtt can't dump options Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
* avformat/hls: add http 2.0 version number compare for the http_multipleSteven Liu2019-06-14
| | | | Signed-off-by: Steven Liu <lq@chinaffmpeg.org>