summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* avfilter/af_dynaudnorm: add support for filtering non-writable framesPaul B Mahol2021-10-05
| | | | | Previously it would continue processing frame even if call to make frame writable failed.
* avfilter/af_dynaudnorm: fix possible clipping at start when alt-boundary ↵Paul B Mahol2021-10-05
| | | | mode is disabled
* avfilter/af_speechnorm: fix possible memleak on error to make frame writablePaul B Mahol2021-10-05
| | | | Fix this by adding support for non-writable frames.
* avfilter/vf_morpho: Fix invalid frees on errorAndreas Rheinhardt2021-10-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current code used a pointer to an array (of arrays) that is offset relative to the start of the actually allocated buffer. Yet offsetting the pointer is only done on success, whereas the freeing code believes it to have happened even on error. So if any of the subarrays (or the subarrays' subarrays) can't be successfully allocated, one gets a bad free in free_lut(). Furthermore, said offsetting is only permissible in case the offsetted pointer points in the allocated buffer (here: in case the LUT's min_r is <= 0), as pointer arithmetic is undefined in case it exceeds the allocated object. Moreover, in case one of the subarrays couldn't be allocated, the code nevertheless tried to free the subarray's subarrays; and in case one of the subarray's subarrays could not be allocated successfully, there will be an invalid free, too, because the pointers for the subarrays' subarrays are also offset compared to the base pointer. This commit fixes all of this, by using the actually allocated pointer for freeing and by adding appropriate checks before freeing the subarrays. The former also allows to distinguish the cases in which the lut is currently only half-allocated due to an error in an earlier allocation attempt from the success case. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/vf_morpho: Take pre-padding into account for LUT-reallocationAndreas Rheinhardt2021-10-04
| | | | | | | Fixes heap-buffer underflows. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/vf_morpho: Factor out (re)allocating lutAndreas Rheinhardt2021-10-04
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/vf_morpho: Fix leak of output frame on errorAndreas Rheinhardt2021-10-04
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/{isom,mov,movenc}: add support for CMAF DASH rolesJan Ekström2021-10-04
| | | | | | | | | | | | | | | | This information is coded in a standard MP4 KindBox and utilizes the scheme and values as per the DASH role scheme defined in MPEG-DASH. Other schemes are technically allowed, but where multiple schemes define the same concepts, the DASH scheme should be utilized. Such flagging is additionally utilized by the DASH-IF CMAF ingest specification, enabling an encoder to inform the following component of the roles of the incoming media streams. A test is added for this functionality in a similar manner to the matroska test. Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
* avformat/{aviobuf,avio_internal}: add max_len argument to ↵Jan Ekström2021-10-04
| | | | | | | | | | ff_read_string_to_bprint_overwrite This is especially useful when reading things such as null-terminated strings from MOV/MP4-likes, where the size of the box is known, but not the exact size of the string. Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
* avformat/{aviobuf,avio_internal}: add ff_read_string_to_bprint_overwriteJan Ekström2021-10-04
| | | | | | | For now, same as ff_read_line_to_bprint_overwrite, but reads until the end of a null-terminated string. Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
* avformat/aviobuf: add a full string reading mode to read_line_to_bprintJan Ekström2021-10-04
| | | | | | | | | | Additionally: * rename it to read_string_to_bprint * split most of ff_read_line_to_bprint_overwrite into an internal function which can then be utilized to implement other functionality without duplicating code. Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
* avfilter/avfilter: Make ff_tlog_ref() staticAndreas Rheinhardt2021-10-03
| | | | | | | | | It allows compilers to inline the one and only call to this function in its caller or even to optimize it away completely (this function is empty in case TRACE is not defined). Reviewed-by: Nicolas George <george@nsup.org> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mux: Remove unnecessary av_packet_unref()Andreas Rheinhardt2021-10-03
| | | | | | AVFormatInternal.parse_pkt is always blank after having been used. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/tee: ReindentationAndreas Rheinhardt2021-10-03
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/tee: Process strings immediately if possibleAndreas Rheinhardt2021-10-03
| | | | | | This avoids having to free them manually lateron. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/tee: Fix leak of FIFO-options dictionaryAndreas Rheinhardt2021-10-03
| | | | | | Happened for all slaves which didn't use the FIFO. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/tee: Fix leak of stringsAndreas Rheinhardt2021-10-03
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/tee: Avoid stack packetAndreas Rheinhardt2021-10-03
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/tee: Unref packet on av_bsf_send_packet() failureAndreas Rheinhardt2021-10-03
| | | | | | | | Given that the packet sent to av_bsf_send_packet() is always already refcounted, it is doubtful whether the error can even be triggered currently. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/tee: Fix inconsistency wrt av_packet_ref() failure handlingAndreas Rheinhardt2021-10-03
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/webpenc: Don't use sizeof(AVPacket)Andreas Rheinhardt2021-10-03
| | | | | | | | | In this case it means replacing a packet in the muxer's context by a pointer to an AVPacket, namely AVFormatInternal.pkt. Because this packet is freed generically, one can remove the muxer's deinit function. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/flacenc: Avoid stack packetAndreas Rheinhardt2021-10-03
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/img2enc: Don't use sizeof(AVPacket)Andreas Rheinhardt2021-10-03
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mp3enc: Avoid stack packetAndreas Rheinhardt2021-10-03
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/ttaenc: Avoid stack packetAndreas Rheinhardt2021-10-03
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/matroskaenc: Avoid allocation of AVPacketAndreas Rheinhardt2021-10-03
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/avienc: Avoid allocating AVPacketAndreas Rheinhardt2021-10-03
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/amvenc: Avoid allocating packetAndreas Rheinhardt2021-10-03
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/internal: Allow AVFormatInternal.pkt to be used by muxersAndreas Rheinhardt2021-10-03
| | | | | | It is unused by the generic muxing code. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/asfenc: Return proper error codesAndreas Rheinhardt2021-10-03
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/asfenc: Add deinit functionAndreas Rheinhardt2021-10-03
| | | | | | Fixes leaks when the trailer is never written. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/asfenc: Avoid allocations when writing metadataAndreas Rheinhardt2021-10-03
| | | | | | Also improves the error check for avio_open_dyn_buf(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/asfenc: Remove unused fields from ASFStreamAndreas Rheinhardt2021-10-03
| | | | | | | | | It has never been done in b08569a23948db107e5e6175cd4c695427d5339d, 30b8f3e7dcd0318b91e205dcbf774ef92fb6193c. After this change, this muxer does no longer use sizeof(AVPacket). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mux: Use AVFormatInternal.parse_pkt for temporary packetsAndreas Rheinhardt2021-10-03
| | | | | | | | The documentation of said packet ("Every user has to ensure that this packet is blank after using it") perfectly fits how we use said packet in the generic muxing code. Better than the documentation of pkt. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mux: Don't use stack packet when writing interleaved packetsAndreas Rheinhardt2021-10-03
| | | | | | | | | | | | | | | | | | | Currently the interleave_packet functions use a packet for a new packet to be interleaved (may be NULL if there is none) and a packet for output; said packet is always a stack packet in interleaved_write_packet(). But all the interleave_packet functions in use first move the packet to the packet list and then check whether a packet can be returned, i.e. the effective lifetime of the new packet ends before the packet for output is touched. So one can use one packet both for input and output by adding a new parameter that indicates whether there is a packet to add to the packet list; there is just one complication: In case the muxer is flushed, there is no packet available. This can be solved by reusing one of the packets from AVFormatInternal. They are currently unused when flushing in av_interleaved_write_frame(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* examples/qsvdec: Don't use stack packetAndreas Rheinhardt2021-10-03
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* examples/hw_decode: Don't use stack packetAndreas Rheinhardt2021-10-03
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* examples/filtering_video: Don't use stack packetAndreas Rheinhardt2021-10-03
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* examples/filtering_audio: Don't use stack packetAndreas Rheinhardt2021-10-03
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* examples/extract_mvs: Do not use stack packetAndreas Rheinhardt2021-10-03
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* examples/muxing: Don't use stack packetAndreas Rheinhardt2021-10-03
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* examples/remuxing: Don't use stack packetAndreas Rheinhardt2021-10-03
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* examples/remuxing: Use av_packet_rescale_ts()Andreas Rheinhardt2021-10-03
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* fftools/ffmpeg, doc/examples: Remove redundant av_packet_unrefAndreas Rheinhardt2021-10-03
| | | | | | av_interleaved_write_frame() already returns blank packets. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/avformat: Clarify documentation of av_interleaved_write_frame()Andreas Rheinhardt2021-10-03
| | | | | | | | | | | | | | | | | | | The earlier documentation claimed that av_interleaved_write_frame() always orders by dts, which is not necessarily true when using muxers with custom interleavement functions or the audio_preload option. Furthermore, the documentation stated that libavformat takes ownership of the reference of the provided packet (if it is refcounted) and that the caller may not access the data through this reference after the function returns. This suggests that the returned packet is not blank, but instead still contains some set, but invalid fields, which implies that it would be dangerous to unreference this packet again. But this is not true: av_interleaved_write_frame()'s actual behaviour is to always output blank packet (even on error). This commit documents this fact so that callers know that they can directly reuse this packet. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/mux: Sanitize packets without data and side-dataAndreas Rheinhardt2021-10-03
| | | | | | | | | The BSF API treats such packets as signalling EOF and therefore such a packet might corrupt the BSF state. In such a case, the guarantee that av_interleaved_write_frame() always frees the packet is not upheld. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* swscale/swscale: Pass slice location into unscaled code also for dst scalingMichael Niedermayer2021-10-03
| | | | | | | Fixes: alphablend=checkerboard Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* swscale/alphablend: Fix slice handlingMichael Niedermayer2021-10-03
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/af_afwtdn: add internal timeline supportPaul B Mahol2021-10-03
|
* avfilter/vf_morpho: switch to internal timelinePaul B Mahol2021-10-03
|