aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* avformat/amvenc: Remove unnecessary av_packet_free()Andreas Rheinhardt2021-03-241-2/+0
| | | | | | The muxer's deinit function takes care of cleaning up when init fails. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/webpenc: Fix memleak when trailer is never writtenAndreas Rheinhardt2021-03-241-0/+8
| | | | | | | | When the trailer is never written (or when a stream switches from non-animation mode to animation mode mid-stream), a cached packet (if existing) would leak. Fix this by adding a deinit function. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/webpenc: ReindentationAndreas Rheinhardt2021-03-241-11/+11
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/webpenc: Fix memleak when using invalid packetsAndreas Rheinhardt2021-03-241-10/+11
| | | | | | | | | | | | | The WebP muxer sometimes caches a packet it receives to write it later; yet if a cached packet is too small (so small as to be invalid), it is cached, but not written and not unreferenced. Such a packet leaks, either by being overwritten by the next packet or because it is never unreferenced at all. Fix this by not caching unusable packets at all; and error out on invalid packets. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/webpenc: Use init instead of write_header functionAndreas Rheinhardt2021-03-241-2/+2
| | | | | | webp_write_header() didn't write anything. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/ipmovie: Avoid stack packetAndreas Rheinhardt2021-03-241-3/+1
| | | | | | | Replace it in ipmovie_read_header() by AVFormatInternal.parse_pkt which is unused when reading the header. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/ipmovie: Remove redundant initializationsAndreas Rheinhardt2021-03-241-7/+0
| | | | | | The demuxer's context has already been zeroed generically. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/ipmovie: Fix indentationAndreas Rheinhardt2021-03-241-17/+17
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/ipmovie: Deduplicate parsing video data opcodesAndreas Rheinhardt2021-03-241-20/+3
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/ipmovie: Avoid reading packets during read_headerAndreas Rheinhardt2021-03-241-9/+9
| | | | | | | | | | They will be discarded anyway because this can only happen for invalid data. This already implies that the pkt won't be used at all when parsing the very first chunk when reading the header, so one can use NULL as argument and remove the av_packet_unref() on error. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/ipmovie: Remove redundant av_packet_unref()Andreas Rheinhardt2021-03-241-3/+0
| | | | | | | | | When one of these errors happens during ipmovie_read_packet(), an error is returned and the packet is cleaned up generically. And since 712d3ac539f30239b764d8621829dc9dc913da61 the same happens in ipmovie_read_header(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/asfdec_f: Avoid stack packetAndreas Rheinhardt2021-03-241-4/+4
| | | | | | | Replace it by using AVFormatInternal.parse_pkt which is otherwise unused when reading a header. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/moflex: Simplify freeing packetsAndreas Rheinhardt2021-03-241-4/+1
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/matroskadec: Reuse AVFormatInternal.parse_pktAndreas Rheinhardt2021-03-242-5/+6
| | | | | | | | | | | | | | | | | Before 8d78e90a6ba96646f7f25aff6ca3e12e71cec164 the Matroska demuxer used stack packets to hold temporary packets; now it uses a temporary packet allocated by the Matroska demuxer. Yet because it used stack packets the code has always properly reset the packet on error, while on success these temporary packets were put into a packet list via avpriv_packet_list_put(), which already resets the source packet. This means that this code is compatible with just reusing AVFormatInternal.parse_pkt (which is unused while one is in the demuxer's read_packet() function). Compared to before 8d78e90a6 this no longer wastes one initialization per AVPacket read (the resetting of the stack packet performed by av_packet_move_ref() in avpriv_packet_list_put() was for naught). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/rtpdec: attach producer reference time if availableAlok Priyadarshi2021-03-233-0/+36
| | | | | | | This produces true wallclock time at rtp source instead of the local wallclock time at rtp client. Signed-off-by: James Almer <jamrial@gmail.com>
* lavc/mjpegdec: Decode format 211121 as YUV 4:4:4Carl Eugen Hoyos2021-03-231-0/+1
| | | | Fixes ticket #8930.
* avformat/utils: Don't allocate separate packet for extract_extradataAndreas Rheinhardt2021-03-232-14/+14
| | | | | | One can simply reuse AVFormatInternal.parse_pkt instead. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* libavformat/utils: Fix indentationAndreas Rheinhardt2021-03-231-17/+13
| | | | | | | | | | | Originally added in 12f996edfab67b65af0ff1ee829f9eeabb025b0f behind #if 0; aebb56e1844d61965c97e95534c3ae0da69df028 then removed the #if and replaced it by using av_dlog. Then commit 1a3eb042c704dea190c644def5b32c9cee8832b8 replaced this with av_log at trace level. Yet the code block always stayed within { } at an increased level of indentation. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/svq3: Don't copy watermarked frame data twiceAndreas Rheinhardt2021-03-231-18/+1
| | | | | | | | | | | | | | | 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-231-2/+2
| | | | | | | | 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-231-11/+2
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/s337m: Use and test Dolby-E-parserAndreas Rheinhardt2021-03-233-0/+35
| | | | | | | | 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-231-7/+7
| | | | | | | | | | | | | | | | | | | | 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-2217-123/+54
| | | | | | | | | 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-211-3/+1
| | | | | | 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-211-4/+0
| | | | | | | 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-212-0/+4
| | | | | | | | 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-211-1/+1
| | | | | | | | | | | | | | | | 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-211-6/+6
|
* configure: select child muxers for rtp_mpegtsGyan Doshi2021-03-211-0/+1
|
* lavc/aomenc: Force default qmax of 0 if crf was set to 0.Carl Eugen Hoyos2021-03-211-1/+4
| | | | Fixes lossless encoding without setting qmax to 0.
* lavf/swfdec: Allow decoding Nellymoser in swf.Carl Eugen Hoyos2021-03-201-1/+1
| | | | Such files exist in the wild, see ticket #9153.
* avformat/pp_bnk: Fix memleaks when reading non-stereo tracksAndreas Rheinhardt2021-03-201-22/+16
| | | | | | | | | | | | | | | | | | | | | | | | | 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-201-6/+4
| | | | | | | | | 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-201-0/+3
| | | | | | | | | | | | | 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-201-4/+3
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/options: Remove always-true checkAndreas Rheinhardt2021-03-201-2/+0
| | | | | | | | 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-202-8/+5
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avcodec/avcodec: Sanitize options before using themAndreas Rheinhardt2021-03-201-7/+7
| | | | | | | | | 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-202-40/+35
| | | | | | 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-201-12/+12
| | | | | | | 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 branchn4.5-devMichael Niedermayer2021-03-208-8/+8
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Bump Versions before release/4.4 branchMichael Niedermayer2021-03-2010-9/+11
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* doc/APIchanges: fill in missing fieldsMichael Niedermayer2021-03-201-8/+8
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpeg4videoenc: Check extradata malloc()Michael Niedermayer2021-03-201-0/+2
| | | | | | | | 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-191-2/+9
| | | | | | | | 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-191-1/+1
| | | | | | | | | 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-192-1/+7
| | | | | | | | | 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-191-1/+1
| | | | | | | | 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-191-1/+1
| | | | | | SRTO_TLPKTDROP works for receiver and sender both. Signed-off-by: Marton Balint <cus@passwd.hu>