summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* avcodec/svq3: Don't copy watermarked frame data twiceAndreas Rheinhardt2021-03-23
| | | | | | | | | | | | | | | The SVQ3 decoder modifies the input bitstream at two places. One of them is only reached when the file is watermarked. Therefore commit 2264c1108135380c49fdf0aef97520bf77a6ed37 made a copy of all the frame data in this case. But there is a second possibility for modifying the frame and therefore Libav commit 1098f5c0495c61a98d4ff6b8e24c17974d4bace5 made the decoder always copy the data. This of course makes the additional copy for watermarked frames redundant, but it hasn't been removed. This commit does so. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/svq3: Use av_fast_padded_malloc() instead of av_fast_malloc()Andreas Rheinhardt2021-03-23
| | | | | | | | It takes care of zeroing padding (which has been forgotten here). Also rename the size variable to indicate that this is not the size of the current slice. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/s337m: Use av_get_packet() to read packetAndreas Rheinhardt2021-03-23
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/s337m: Use and test Dolby-E-parserAndreas Rheinhardt2021-03-23
| | | | | | | | This makes av_read_frame() return packets with proper timestamps. As a result, seeking now works in combination with streamcopy. A FATE-test for this has been added. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/utils: Fix confusing return value for ff_read_packet()Andreas Rheinhardt2021-03-23
| | | | | | | | | | | | | | | | | | | | Currently, ff_read_packet() sometimes forwards the return value of AVInputFormat.read_packet() (which should be zero on success, but isn't for all demuxers) and sometimes it overwrites this with zero. Furthermore, it uses two variables, one for the read_packet return value and one for other errors, which is a bit confusing; it is also unnecessary given that the documentation explicitly states that ff_read_packet() never returns positive values. Returning a positive value would lead to leaks with some callers (namely asfrtp_parse_packet and estimate_timings_from_pts). So always return zero in case of success. (This behaviour stems from a time before av_read_packet sanitized the return value of read_packet at all: It was added in commit 626004690c23c981f67228ea325dde3f35193988 and was unnecessary since 88b00723906f68b7563214c30333e48888dddf78.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec: Factor updating palette outAndreas Rheinhardt2021-03-22
| | | | | | | | | Because the properties of frames returned from ff_get/reget_buffer are not reset at all, lots of returned frames had palette_has_changed wrongly set to 1. This has been changed, too. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/apetag: Avoid stack packet when reading attached pictureAndreas Rheinhardt2021-03-21
| | | | | | Read it directly into AVStream.attached_pic. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat: remove FF_API_INIT_PACKET from AVStream.attached_picJames Almer2021-03-21
| | | | | | | This field needs to be replaced altogether, not just its type changed. This will be done in a separate change. Signed-off-by: James Almer <jamrial@gmail.com>
* FATE: Add test for probing MOV/MP4 files with extended box sizesDerek Buitenhuis2021-03-21
| | | | | | | | The test sample has to have no file extension, otherwise probing happens to work, based off file extension alone, and we want to test the actual probing function. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* avformat/mov: Fix extended atom size buffer length checkDerek Buitenhuis2021-03-21
| | | | | | | | | | | | | | | | When extended atom size support was added to probing in fec4a2d232d7ebf6d1084fb568d4d84844f25abc, the buffer size check was backwards, but probing continued to work because there was no minimum size check yet, so despite size being 1 on these atoms, and failing to read the 64-bit size, the tag was still correctly read. When 0b78016b2d7c36b32d07669c0c86bc4b4225ec98 introduced a minimum size check, this exposed the bug, and broke probing any files with extended atom sizes, such as entirely valid large files that start whith mdat atoms. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* avformat/rtp_mpegts: typedef MuxChain structGyan Doshi2021-03-21
|
* configure: select child muxers for rtp_mpegtsGyan Doshi2021-03-21
|
* lavc/aomenc: Force default qmax of 0 if crf was set to 0.Carl Eugen Hoyos2021-03-21
| | | | Fixes lossless encoding without setting qmax to 0.
* lavf/swfdec: Allow decoding Nellymoser in swf.Carl Eugen Hoyos2021-03-20
| | | | Such files exist in the wild, see ticket #9153.
* avformat/pp_bnk: Fix memleaks when reading non-stereo tracksAndreas Rheinhardt2021-03-20
| | | | | | | | | | | | | | | | | | | | | | | | | Commit 6973df112275c8ea4af0bf3cb1338baecc1d06b3 added support for music tracks by outputting its two containing tracks together in one packet. But the actual data is not contiguous in the file and therefore one can't simply use av_get_packet() (which has been used before) for it. Therefore the packet was now allocated via av_new_packet() and read via avio_read(); and this is also for non-music files. This causes problems because one can now longer rely on things done automatically by av_get_packet(): It automatically freed the packet in case of errors; this lead to memleaks in several FATE-tests covering this demuxer. Furthermore, in case the data read is less than the data desired, the returned packet was not zero-allocated (the packet's padding was uninitialized); for music files the actual data could even be uninitialized. The former problems are fixed by using av_get_packet() for non-music files; the latter problem is handled by erroring out unless both tracks could be fully read. Reviewed-by: Zane van Iperen <zane@zanevaniperen.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/utils: Always leave parse_pkt in blank state, avoid resettingAndreas Rheinhardt2021-03-20
| | | | | | | | | Always leaving said packet in a blank state after having used it allows to avoid having to reset it before one uses it; and it also allows to use it in more places than just in parse_packet() here. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/parser: Don't return pointer to stack bufferAndreas Rheinhardt2021-03-20
| | | | | | | | | | | | | When flushing, the parser receives a dummy buffer with padding that lives on the stack of av_parser_parse2(). Certain parsers (e.g. Dolby E) only analyze the input, but don't repack it. When flushing, such parsers return a pointer to the stack buffer and a size of 0. And this is also what av_parser_parse2() returns. Fix this by always resetting poutbuf in case poutbuf_size is zero. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/options: Reindent after previous commitAndreas Rheinhardt2021-03-20
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/options: Remove always-true checkAndreas Rheinhardt2021-03-20
| | | | | | | | Added in dc51a72ba45fbefb9f1c6c3ca5a5b2388d69b2da, yet even back then the check was always true as the AVCodecContext has already been memset to zero before that. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/avcodec: Move decoder channel count check to ff_decode_preinitAndreas Rheinhardt2021-03-20
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/avcodec: Sanitize options before using themAndreas Rheinhardt2021-03-20
| | | | | | | | | This is how it is supposed to happen, yet when using frame threading, the codec's init function has been called before preinit. This can lead to crashes when e.g. using unsupported lowres values for decoders together with frame threading. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/avcodec: Perform sub_charenc/iconv checks before AVCodec.init()Andreas Rheinhardt2021-03-20
| | | | | | Also move them to ff_decode_preinit(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/avcodec: Check earlier for codec id/type mismatchAndreas Rheinhardt2021-03-20
| | | | | | | These fields can't be set via AVOptions, ergo one can check them before having allocated anything. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* Bump minor versions after release branchMichael Niedermayer2021-03-20
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Bump Versions before release/4.4 branchMichael Niedermayer2021-03-20
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* doc/APIchanges: fill in missing fieldsMichael Niedermayer2021-03-20
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpeg4videoenc: Check extradata malloc()Michael Niedermayer2021-03-20
| | | | | | | | Fixes: Null pointer dereference Fixes: any mpeg4 testcase which fails the malloc at that exact spot Found-by: Rafael Dutra <rafael.dutra@cispa.de> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mov: Check offset addition for overflowMichael Niedermayer2021-03-19
| | | | | | | | Fixes: signed integer overflow: 9223372036854775807 + 536870912 cannot be represented in type 'long' Fixes: 31678/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5614204619980800 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/speedhq: Width < 8 is not supportedMichael Niedermayer2021-03-19
| | | | | | | | | Fixes: out of array access Fixes: 31733/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SPEEDHQ_fuzzer-4704307963363328 Fixes: 31736/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SPEEDHQ_fuzzer-6190960292790272 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/rtsp: support buffer_size and pkt_size options for RTPJiangjie Gao2021-03-19
| | | | | | | | | And forward it to the underlying UDP protocol. Fixes ticket #7517. Signed-off-by: Jiangjie Gao <gaojiangjie@live.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avfilter/vf_ocr: add white space to whitelistDominic Mayers2021-03-19
| | | | | | | | Fixes #9151. The current version of libavfilter/vf_ocr.c does not have white space in the default whitelist. But it is recommanded to include white space. See https://github.com/tesseract-ocr/tesseract/issues/2923 Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/libsrt: fix help messageZhao Zhili2021-03-19
| | | | | | SRTO_TLPKTDROP works for receiver and sender both. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/libsrt: fix setsockopt() typoZhao Zhili2021-03-19
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/http,tls: honor http_proxy command line variable for HTTPSMoritz Barsnick2021-03-19
| | | | | | | | | | | | | | | | | | Add the "http_proxy" option and its handling to the "tls" protocol, pass the option from the "https" protocol. The "https" protocol already defines the "http_proxy" command line option, like the "http" protocol does. The "http" protocol properly honors that command line option in addition to the environment variable. The "https" protocol doesn't, because the proxy is evaluated in the underlying "tls" protocol, which doesn't have this option, and thus only handles the environment variable, which it has access to. Fixes #7223. Signed-off-by: Moritz Barsnick <barsnick@gmx.net> Signed-off-by: Marton Balint <cus@passwd.hu>
* lavc/videotoolboxenc: Add support for HEVC with Alpha.Hironori Bono2021-03-19
| | | | | | | | | | | | | | | This change supports the "HEVC Video with Alpha" profile introduced in WWDC 2019 <https://developer.apple.com/videos/play/wwdc2019/506/>. (This change is a partial fix for Ticket #7965.) For example, the following command converts an animation PNG file to an HEVC with Alpha video: ./ffmpeg -i fate-suite/apng/clock.png -c:v hevc_videotoolbox -allow_sw 1 -alpha_quality 0.75 -vtag hvc1 clock.mov (This change uses the "HEVC Video with Alpha" profile only when the '-alpha_quality' value is not 0 for backward compatibility.) Signed-off-by: Hironori Bono <bouno@rouge.plala.or.jp>
* videotoolboxenc: enable constant quality with -q:v on Apple Silicon Macs and ↵Simone Karin Lehmann2021-03-19
| | | | | | | use b-frames für HEVC and H264 and b-pyramid for HEVC. Signed-off-by: Simone Karin Lehmann <simone@lisanet.de> Signed-off-by: Rick Kern <kernrj@gmail.com>
* avcodec: move core AVCodecContext functions from util.c to a new fileJames Almer2021-03-19
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: move AVCodecParameters related functions from util.c to a new fileJames Almer2021-03-19
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* fate: add adpcm_ima_cunning stereo test caseZane van Iperen2021-03-19
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avformat/pp_bnk: treat music files as stereoZane van Iperen2021-03-19
| | | | | | | | | | These files are technically a series of planar mono tracks. If the "music" flag is set, merge the packets from the two mono tracks, essentially replicating: [0:a:0][0:a:1]join=inputs=2:channel_layout=stereo[a] Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/adpcm_ima_cunning: reindentZane van Iperen2021-03-19
| | | | Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* avcodec/adpcm_ima_cunning: support stereoZane van Iperen2021-03-19
| | | | | | | Changes the sample format to S16P, but was only ever mono so it affects nothing. Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
* doc/filters: remove option band in delogoGyan Doshi2021-03-19
| | | | | Deprecated option removed in 74fe697f9650 but I forgot to remove the docs entry.
* doc/ffmpeg: document parameters set by -targetGyan Doshi2021-03-19
|
* avutil/adler32: Switch av_adler32_update() to size_t on bumpAndreas Rheinhardt2021-03-19
| | | | | | | | | | av_adler32_update() is used by av_hash_update() which will be switched to size_t at the next bump. So it also has to be made to use size_t. This is also necessary for framecrcenc.c, because the size of side data will become a size_t, too. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/packet: Also change av_packet_pack/unpack_dictionary to size_tAndreas Rheinhardt2021-03-19
| | | | | | | | | These are auxiliary side-data functions, so they should have been switched to size_t in d79e0fe65c51491f9bf8a470bbe36fb09f3e1280, but this has been forgotten. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/avpacket: Improve overflow checks when packing dictionaryAndreas Rheinhardt2021-03-19
| | | | | | Also avoid reallocations. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat: Make AVChapter.id an int64_t on next major bumpAndreas Rheinhardt2021-03-19
| | | | | | | | | 64 bits are needed in order to retain the uid values of Matroska chapters; the type is kept signed because the semantics of NUT chapters depend upon whether the id is > 0 or < 0. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/matroskaenc: Check chapter ids for duplicatesAndreas Rheinhardt2021-03-19
| | | | | | | | | | | | | | | Up until now, there has been no check that each chapter has a unique id; there was only a check for whether a chapter id is zero (this happens often when the chapters originated from a format that lacks the concept of chapter id and simply counts from zero) which is invalid in Matroska. In this case the chapter ids are offset by 1 to make them nonnegative. Yet offsetting won't fix duplicate ids, therefore this is changed to simply create new chapter uids when the input chapter uids don't conform to the requirements of Matroska (in which case it can be presumed that they did not originate from Matroska, so that we don't need to bother to preserve them). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/libxvid: Remove set-but-unused variableAndreas Rheinhardt2021-03-19
| | | | | | | Set-but-unused since 2101b99777860c853ca2321031eb3f4047dc5894. Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>