summaryrefslogtreecommitdiff
path: root/libavformat
Commit message (Collapse)AuthorAge
...
* avformat/ipmovie: Free packets allocated in header readingMichael Niedermayer2021-03-15
| | | | | | | | Fixes: memleaks Fixes: 29905/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5679700745781248 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavformat/hls: Reset options after open_url_keepalive() failsEd Martin2021-03-15
| | | | | | | | | | | | | | open_url_keepalive() unsets the options when it uses them, this includes the offsets for the Range: header. When using the HLS tag #EXT-X-BYTERANGE along with multiple files, the range options must be preserved after open_url_keepalive() returns EOF so that the new file can be opened. Failure to do this results in ignoring the #EXT-X-BYTERANGE tag and reading the wrong bytes of the file. To fix it, reset the options before calling io_open() following open_url_keepalive() reaching EOF Reviewed-by: Steven Liu <liuqi05@kuaishou.com>
* avformat/voc_packet: prevent remaining size from becoming negative in ↵Michael Niedermayer2021-03-14
| | | | | | | | | | ff_voc_get_packet() Fixes: memleak Fixes: 30909/clusterfuzz-testcase-minimized-ffmpeg_dem_AVS_fuzzer-4886284057313280 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mvi: Check audio size for more overflowsMichael Niedermayer2021-03-14
| | | | | | | | Fixes: left shift of negative value -352256000 Fixes: 30837/clusterfuzz-testcase-minimized-ffmpeg_dem_MVI_fuzzer-5755626262888448 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/samidec: Deallocate hdr_bufMichael Niedermayer2021-03-14
| | | | | | | | Fixes: memleak Fixes: 30841/clusterfuzz-testcase-minimized-ffmpeg_dem_SAMI_fuzzer-4521799196999680 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/cinedec: Fix index_entries size checkMichael Niedermayer2021-03-13
| | | | | | | | Fixes: out of array access Fixes: 29868/clusterfuzz-testcase-minimized-ffmpeg_dem_CINE_fuzzer-5692001957445632 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/aaxdec: Check that segments table has been initializedMichael Niedermayer2021-03-13
| | | | | | | | Fixes: Timeout Fixes: 29766/clusterfuzz-testcase-minimized-ffmpeg_dem_AAX_fuzzer-5635887566290944 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat: add Changelog entry for librist and bump minorMarton Balint2021-03-13
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/librist: clarify and limit buffer_sizeMarton Balint2021-03-13
| | | | | | As suggested by librist developers. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/librist: increase default loglevelMarton Balint2021-03-13
| | | | | | | | | Also remove AV_LOG_SIMULATE from the list as it is not used directly, and do not use panic level on unknown loglevel, but make them warn. Also fix mapping of NOTICE/INFO/VERBOSE and add documentation about when the option should actually be used. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/librist: simplify secret strlcpyMarton Balint2021-03-13
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/librist: make packet size adjustable for writing, fix it for readingMarton Balint2021-03-13
| | | | | | | | Maximum packet size is 10000 (RIST_MAX_PACKET_SIZE, which is unfortunately private) minus the RIST protocol overhead which is 28 bytes for the unencrypted case, 36 for the encrypted case. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/librist: rework librist_readMarton Balint2021-03-13
| | | | | | | Queue tracking makes no difference so remove it, return EAGAIN of no data is available and rist data block needs to be freed even for zero sized packets. Signed-off-by: Marton Balint <cus@passwd.hu>
* libavformat: add librist protocolPaul B Mahol2021-03-13
| | | | | | This work is sponsored by Open Broadcast Systems. Signed-off-by: Paul B Mahol <onemda@gmail.com>
* avformat/adp, svs: Remove redundant av_shrink_packet()Andreas Rheinhardt2021-03-12
| | | | | | | | | av_get_packet() already makes sure that the packet size is accurate and that the packet data is zero-padded even when one could not read as much as desired. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/gopher: Add support for Gopher over TLSparazyd2021-03-11
| | | | | | | | | | | | | | | | This commit adds a "gophers" handler to the gopher protocol. gophers is a community-adopted protocol that acts the same way like normal gopher with the added TLS encapsulation. The gophers protocol is supported by gopher servers like geomydae(8), and clients like curl(1), clic(1), and hurl(1). This commit also adds compilation guards to both gopher and gophers, since now there are two protocols in the file it makes sense to have this addition. Signed-off-by: parazyd <parazyd@dyne.org> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/gopher: Add default_whitelist to ff_gopher_protocolparazyd2021-03-11
| | | | | Signed-off-by: parazyd <parazyd@dyne.org> Signed-off-by: Marton Balint <cus@passwd.hu>
* avisynth: fix audio on big endianStephen Hutchinson2021-03-11
| | | | | | | | AviSynth+ outputs audio in the same format as the OS, so assuming little endian formats as input on big endian OSes results in nothing but static. Signed-off-by: Stephen Hutchinson <qyot27@gmail.com>
* avisynth: populate field orderemcodem2021-03-11
| | | | | | Fixes Trac ticket #8757 Signed-off-by: Stephen Hutchinson <qyot27@gmail.com>
* avisynth: more intelligent RGB flippingStephen Hutchinson2021-03-11
| | | | | | | | avs_is_color_space provides a generic way of checking whether the video is RGB, and has been available through AVSC_API since 2.6. This means that GetProcAddress doesn't have to run on every frame. Signed-off-by: Stephen Hutchinson <qyot27@gmail.com>
* avformat/rawenc: Use init instead of write_header functionAndreas Rheinhardt2021-03-11
| | | | | | force_one_stream() does not write anything. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat: use the buffer_size_t typedef where requiredJames Almer2021-03-10
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/utils: change AVStream side data related public function and struct ↵James Almer2021-03-10
| | | | | | | | | size types to size_t av_stream_add_side_data() already defines size as a size_t, so this makes it consistent across all side data functions. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/mvdec: Allocate extradata only onceMichael Niedermayer2021-03-09
| | | | | | | | Fixes: memleak Fixes: 28686/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5822961932173312 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/flvdec: Check double before cast in parse_keyframes_index()Michael Niedermayer2021-03-08
| | | | | | | | Fixes: -2.21166e+304 is outside the range of representable values of type 'long' Fixes: 29169/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5725452796821504 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/paf: Check for EOF before allocation in read_header()Michael Niedermayer2021-03-08
| | | | | | | | Fixes: OOM Fixes: 26584/clusterfuzz-testcase-minimized-ffmpeg_dem_PAF_fuzzer-5172661183053824 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/swfdec: Check outlen before allocationMichael Niedermayer2021-03-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: Timeout (too long -> 241ms) Fixes: 29083/clusterfuzz-testcase-minimized-ffmpeg_dem_SWF_fuzzer-6273684478230528 The source of the magic number is A very quick simulation of the best case compression for "compress" below is not nice written code as i did not expect I or anyone else would ever see it again I would have preferred some nicer expression or course, but thats what it seems to be asymptotically. For smaller amounts of data a tighter bound is possible but i saw no nice way to consider that and it seems also overkill to try to do it more fine grained for just this main(){ int64_t bits = 0; int bank = 256; int bitbank = 8; for(unsigned i = 0; i<1024*1024*1024*4U-100000;) { int word_size = bank-255; i += word_size; bits += bitbank; if (!(bank & (bank-1))) bitbank ++; bank++; if (bitbank > 16) { printf("BEST %f \n", 8.0 * i / bits ); bank = 256; bitbank = 8; } } } above assumes i remembered correctly how the algorithm works but the value was close to what actual compession of zeros gave Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* mobiclip: fix copyright headersFlorian Nouwt2021-03-08
| | | | | | | | The Mobiclip related code was based on Mobius (https://github.com/adibsurani/Mobius), which was based on my original reverse engineering efforts (https://github.com/Gericom/MobiclipDecoder). This commit adds the appropriate copyright headers on the related files. Signed-off-by: Florian Nouwt <fnouwt2@gmail.com>
* avformat/dashdec: Don't needlessly strdup metadataAndreas Rheinhardt2021-03-08
| | | | | Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/dashdec: Remove limit on length of idAndreas Rheinhardt2021-03-08
| | | | | Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/http: Fix leak when using deprecated optionAndreas Rheinhardt2021-03-07
| | | | | | | | | | | | When the deprecated option "user-agent" was set to something different than its default value, said option would always precede and overwrite the ordinary user_agent option (regardless of whether it was explicitly set) which leads to a leak of the user_agent option (which has a default value, so the leak happens always). Fix this by setting the same destination for both options; the last option applied wins then. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat: add TTML muxerJan Ekström2021-03-05
| | | | | | | | | | Enables writing TTML documents or encoded TTML paragraphs as such documents. Additionally, a test for the combined TTML encoder and muxer has been added to validate that the components still work. Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
* avformat/aadec: Replace strncpy by av_strlcpyAndreas Rheinhardt2021-03-05
| | | | | | | | | | | While this usage of strncpy is correct, said function nevertheless has the disadvantage of not automatically ensuring that the destination string is zero-terminated. So av_strlcpy should be preferred. This also removes a -Wstringop-truncation warning from GCC (it doesn't matter whether the buffer is truncated, as long as it can fit all the names of the supported codecs). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/aadec: Use smaller scope for variables, remove initializationsAndreas Rheinhardt2021-03-05
| | | | | | avio_get_str always zero terminates the strings it reads. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* lavf/sga: Silence several warnings because of wrong format specifiers.Carl Eugen Hoyos2021-03-04
| | | | | Fixes warnings like: warning: format ‘%lX’ expects argument of type ‘long unsigned int’, but argument n has type ‘uint64_t’
* avformat/mxfdec: add support for getting product version number metadataMarton Balint2021-03-04
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/mxfdec: change toolkit_version metadata field to toolkit_version_numMarton Balint2021-03-04
| | | | | | | It only got added recently, and the new name makes it consistent with product_version_num in the next patch. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/lxfdec: Fix multiple integer overflows related to track_sizeMichael Niedermayer2021-03-03
| | | | | | | | Fixes: signed integer overflow: 538976288 * 8 cannot be represented in type 'int' Fixes: 26910/clusterfuzz-testcase-minimized-ffmpeg_dem_LXF_fuzzer-6634030636335104 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mccdec: Use av_sat_add64() for fsMichael Niedermayer2021-03-03
| | | | | | | | Fixes: signed integer overflow: -9223372036854775808 + -242 cannot be represented in type 'long' Fixes: 26910/clusterfuzz-testcase-minimized-ffmpeg_dem_MCC_fuzzer-6723018395090944 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mspdec: Check packet_size more completelyMichael Niedermayer2021-03-03
| | | | | | | | | | Fixes: OOM Fixes: 28348/clusterfuzz-testcase-minimized-ffmpeg_dem_MSP_fuzzer-4612055872831488 Fixes: 28360/clusterfuzz-testcase-minimized-ffmpeg_dem_MSP_fuzzer-6245230626078720 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/aiffdec: Check that SSND is at least 8 bytesMichael Niedermayer2021-03-03
| | | | | | | | | Fixes: Infinite loop Fixes: 30874/clusterfuzz-testcase-minimized-ffmpeg_dem_AIFF_fuzzer-5933710488764416 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/dcstr: Check sample rateMichael Niedermayer2021-03-03
| | | | | | | | | Fixes: signed integer overflow: -1300248894420254720 * 16 cannot be represented in type 'long' Fixes: 30879/clusterfuzz-testcase-minimized-ffmpeg_dem_DCSTR_fuzzer-5094464215449600 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/frmdec: Simplify finding pixel formatAndreas Rheinhardt2021-03-03
| | | | | | | | | | | The fourccs used by the Megalux Frame format to determine the pixel format are actually no fourccs at all as they are a single byte. Furthermore, their range is continuous (1-5), so they are actually ordinary indices. So treat them as such and don't use PixelFormatTags for them. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat: Deprecate AVFMT_FLAG_PRIV_OPT, remove av_demuxer_open on bumpAndreas Rheinhardt2021-03-03
| | | | | | | | | | | | | | | | | | | | | | | This flag was added in 492026209b9b58eaf6d2ea56423f6b1e1a8a76a5 in conjunction with av_demuxer_open() to allow to pass private options to demuxers. It worked as follows: av_open_input_stream() (the predecessor of avformat_open_input()) would not call the read_header function if this flag is set. Instead the user could set private options of the demuxer via the format's private class after avformat_open_input() and then call av_demuxer_open() which called the format's read_header function. This approach was abandoned in e37f161e66e042d6c2c7470c4d9881df9427fc4a and av_demuxer_open() deprecated; instead the AVDictionary based way of passing private options to the demuxer was choosen. Yet AVFMT_FLAG_PRIV_OPT has never been deprecated and av_demuxer_open() never removed. This commit implements the deprecation of the flag and schedules av_demuxer_open for removal on the next major bump. Given that av_demuxer_open() has been deprecated in 2012 and that this flag is useless without it, the flag will be ignored after the next major version bump. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* ivfenc: write duration for frame_cnt=1.Ronald S. Bultje2021-03-03
|
* avformat/dashdec: Increase size of id bufferAndreas Rheinhardt2021-03-02
| | | | | | | | The current size is not enough, see e.g. http://ftp.itec.aau.at/datasets/DASHDataset2014/TearsOfSteel/1sec/TearsOfSteel_1s_simple_2014_05_09.mpd Reviewed-by: Steven Liu <lq@chinaffmpeg.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/dashdec: Ensure strings are zero-terminatedAndreas Rheinhardt2021-03-02
| | | | | | | | | | | | | | | | | strncpy only ensures that one does not write beyond the end of the destination buffer; in case of truncation it does not zero-terminate the destination buffer. This makes using it the way it is now in the DASH demuxer dangerous. So use av_strlcpy instead. Also don't write anything if there is no id: The buffer has already been zeroed initially. The DASH testset from the Universität Klagenfurt contains samples with ids that are too long. E.g. http://ftp.itec.aau.at/datasets/DASHDataset2014/TearsOfSteel/1sec/TearsOfSteel_1s_simple_2014_05_09.mpd Reviewed-by: Steven Liu <lq@chinaffmpeg.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/matroskaenc: Add support for FlagOriginalAndreas Rheinhardt2021-03-02
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/matroskadec: Add support for FlagOriginalAndreas Rheinhardt2021-03-02
| | | | | | | | | | | | | | | | Needs a CountedElement in order to distinguish the case of the element not being present and the element being present with a value of zero. (It has been argued by Ridley Combs that one should only ever use the AV_DISPOSITION_DUB field for audio tracks. Yet given that there is no definition for the disposition flags, one can also interpret it to mean that e.g. a subtitle track is meant to be used with the dubbed audio track or the original audio track. This commit interprets this flag in this sense, which also allows to maintain it on remuxing.) Reviewed-by: Anton Khirnov <anton@khirnov.net> Reviewed-by: Ridley Combs <rcombs@rcombs.me> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/mov: Extend data_size check in mov_read_udta_string()Michael Niedermayer2021-03-01
| | | | | | | | Fixes: signed integer overflow: -2147483634 - 16 cannot be represented in type 'int' Fixes: 28322/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5711888402612224 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>