summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* avformat/sccdec: Avoid zero-terminating unnecessarilyAndreas Rheinhardt2021-10-02
| | | | | | | | ff_subtitles_queue_insert() does not require its events to be zero-terminated as it has a parameter for the length. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/sccdec: Make constants more intelligibleAndreas Rheinhardt2021-10-02
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/sccdec: Fix position of returned subtitle packetsAndreas Rheinhardt2021-10-02
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/sccdec: Remove redundant checkAndreas Rheinhardt2021-10-02
| | | | | | | The av_sscanf() will filter lines like "Scenarist_SCC V1.0" out. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/sccdec: Don't use uninitialized data, fix crash, simplify logicAndreas Rheinhardt2021-10-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Up until now, the scc demuxer not only read the line that it intends to process, but also the next line, in order to be able to calculate the duration of the current line. This approach leads to unnecessary complexity and also to bugs: For the last line, the timing of the next subtitle is not only logically indeterminate, but also uninitialized and the same applies to the duration of the last packet derived from it.* Worse yet, in case of e.g. an empty file, it is not only the duration that is uninitialized, but the whole timing as well as the line buffer itself.** The latter is used in av_strtok(), which could lead to crashes. Furthermore, the current code always outputs at least one packet, even for empty files. This commit fixes all of this: It stops using two lines at a time; instead only the current line is dealt with and in case there is a packet after that, the duration of the last packet is fixed up after having already parsed it; consequently the duration of the last packet is left in its default state (meaning "unknown/up until the next subtitle"). If no further line could be read, processing is stopped; in particular, no packet is output for an empty file. *: Due to stack reuse it seems to be zero quite often; for the same reason Valgrind does not report any errors for a normal input file. **: While ff_subtitles_read_line() claims to always zero-terminate the buffer like snprintf(), it doesn't do so if it didn't read anything. And even if it did, it would not necessarily help here: The current code jumps over 12 bytes that it deems to have read even when it hasn't. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/md5: Avoid av_unused variableAndreas Rheinhardt2021-10-02
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* libpostproc/postprocess_template: Don't reimplement FFSWAPAndreas Rheinhardt2021-10-02
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/bmpenc: Remove redundant pixel format checkAndreas Rheinhardt2021-10-02
| | | | | | | ff_encode_preinit() already checked the pixel format via AVCodec.pix_fmts. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/dnxhdenc: Remove redundant pixel format checkAndreas Rheinhardt2021-10-02
| | | | | | | ff_encode_preinit() already checked the pixel format via AVCodec.pix_fmts. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/dpxenc: Remove redundant pixel format checkAndreas Rheinhardt2021-10-02
| | | | | | | ff_encode_preinit() already checked the pixel format via AVCodec.pix_fmts. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/magicyuvenc: Remove redundant pixel format checkAndreas Rheinhardt2021-10-02
| | | | | | | ff_encode_preinit() already checked the pixel format via AVCodec.pix_fmts. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/proresenc_anatoliy: Remove redundant pixel format checkAndreas Rheinhardt2021-10-02
| | | | | | | ff_encode_preinit() already checked the pixel format via AVCodec.pix_fmts. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/snowenc: Remove redundant pixel format checkAndreas Rheinhardt2021-10-02
| | | | | | | ff_encode_preinit() already checked the pixel format via AVCodec.pix_fmts. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avcodec/magicyuvenc: Use immediate when knownAndreas Rheinhardt2021-10-02
| | | | | | It allows the compiler to optimize the bytestream2 checks away. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/af_afade: Remove impossible branchAndreas Rheinhardt2021-10-02
| | | | | | | | Also don't call ff_inlink_queued_samples() unnecessarily often. Fixes Coverity issue 1427665. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/formats: Update outdated commentAndreas Rheinhardt2021-10-02
| | | | | | Forgotten in 06754f7bbf341062581accc27b5cce353e99fd82. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/formats: Don't unnecessarily reget pixfmt descriptorAndreas Rheinhardt2021-10-02
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/f_reverse: Don't use redundant query_formats functionAndreas Rheinhardt2021-10-02
| | | | | | | | | Said function did exactly what ff_default_query_formats() does for audio; so just remove it, so that ff_default_query_formats() will be called. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/avfilter: Remove unused bufferAndreas Rheinhardt2021-10-02
| | | | | | | | Unused since the removal of ff_get_ref_perms_string() in a05a44e205d6ae13d5eb1cd8d4ad2dba6ec940b3. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/avfiltergraph: Remove always-true checkAndreas Rheinhardt2021-10-02
| | | | | | Always true since bc1a985ba030e9861d24965d42792850b43a43ea. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/avfiltergraph: Free AVFilterGraph options properlyAndreas Rheinhardt2021-10-02
| | | | Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/avfiltergraph: Simplify adding filter to graphAndreas Rheinhardt2021-10-02
| | | | | | | | | | By reallocating the array of pointers to the AVFilterContexts before allocating the new AVFilterContext one can avoid freeing the new AVFilterContext in case the array could not be reallocated. Also switch to av_realloc_array() while just at it. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* lavf/movenc: Write 'dby1' minor brand if Dolby content is being muxed to MP4Derek Buitenhuis2021-10-01
| | | | | | | | | This is as per: * mp4ra: http://mp4ra.org/#/brands * Dolby Vision muxing spec (which is public): https://professional.dolby.com/siteassets/content-creation/dolby-vision-for-content-creators/dolby_vision_bitstreams_within_the_iso_base_media_file_format_dec2017.pdf Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* avfilter/vf_codecview: added new options for blockLimin Wang2021-10-01
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* swscale/swscale_internal: Avoid unsigned for slice parametersMichael Niedermayer2021-09-30
| | | | | | | | Mixing unsigned and signed often leads to unexpected arithmetic results. Fixes: out of array write Found-by: Paul B Mahol <onemda@gmail.com> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavformat/asfdec: Add braces to defineSoft Works2021-09-30
| | | | | Signed-off-by: softworkz <softworkz@hotmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavformat/asfdec: Use predefined constantsSoft Works2021-09-30
| | | | | Signed-off-by: softworkz <softworkz@hotmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* doc/filters: note values for afftflt window functionArif Driessen2021-09-30
|
* avfilter/vf_avgblur: switch to faster algorithmPaul B Mahol2021-09-30
|
* avfilter/vf_blend: add few more modesPaul B Mahol2021-09-30
|
* avcodec/siren: Improve the bits left threshold in decode_envelope()Michael Niedermayer2021-09-29
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/siren: Check available bits in decode_envelope()Michael Niedermayer2021-09-29
| | | | | | | | | Fixes: Timeout Fixes: 39089/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MSNSIREN_fuzzer-6677219854909440 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Suggested-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avfilter/vf_blend: add harmonic modePaul B Mahol2021-09-29
|
* avfilter/vf_blend: add geometric modePaul B Mahol2021-09-29
|
* avfilter/vf_morpho: add tophat and blackhat operationsPaul B Mahol2021-09-29
|
* avfilter/vf_morpho: add gradient operation typePaul B Mahol2021-09-29
|
* avcodec/zmbvenc: Remove redundant pixel format checkAndreas Rheinhardt2021-09-29
| | | | | | | | ff_encode_preinit() already checked the pixel format via AVCodec.pix_fmts. Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter/vf_floodfill: constify the AVFrame parameter in is_same() and ↵James Almer2021-09-29
| | | | | | pick_pixel() functions Signed-off-by: James Almer <jamrial@gmail.com>
* fate/checkasm: add missing tests to FATEJames Almer2021-09-29
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/libsvtav1: properly enforce CQP mode when set in wrapperLimin Wang2021-09-29
| | | | | | | SVT-AV1 seems to have switched their default from CQP to CRF in February, so enforce the controlling option accordingly. Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* doc/encoders: add available values for libsvtav1 optionsLimin Wang2021-09-29
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/hlsenc: add const for filename argumentLimin Wang2021-09-29
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avformat/utils: add const for argument passed to ff_is_http_proto()Limin Wang2021-09-29
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avfilter/vf_guided: Fix indentionLimin Wang2021-09-29
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avcodec: remove the unused low_delayLimin Wang2021-09-29
| | | | Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
* avfilter/vf_morpho: Rename functions to unbreak MSVCAndreas Rheinhardt2021-09-29
| | | | | | | | | MSVC's headers include function-like macros min and max which collide with function pointers in vf_morpho.c, leading to compilation failures. Fix this by renaming said function pointers. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* checkasm/hevc_pel: Fix stack buffer overreadsAndreas Rheinhardt2021-09-29
| | | | | | | | | | | | | This patch increases several stack buffers in order to fix stack-buffer-overflows (e.g. in put_hevc_qpel_uni_hv_9 in line 814 of hevcdsp_template.c) detected with ASAN in the hevc_pel checkasm test. The buffers are increased by the minimal amount necessary in order not to mask potential future bugs. Reviewed-by: Martin Storsjö <martin@martin.st> Reviewed-by: "zhilizhao(赵志立)" <quinkblack@foxmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avutil/utils: Remove racy check from avutil_version()Andreas Rheinhardt2021-09-29
| | | | | | | | | | | | | | | | avutil_version() currently performs several checks before just returning the version. There is a static int that aims to ensure that these tests are run only once. The reason is that there used to be a slightly expensive check, but it has been removed in 92e3a6fdac73f7e1d69d69717219a7538877d7a0. Today running only once is unnecessary and can be counterproductive: GCC 10 optimizes all the actual checks away, but the checks_done variable and the code setting it has been kept. Given that this check is inherently racy (it uses non-atomic variables), it is best to just remove it. Reviewed-by: Paul B Mahol <onemda@gmail.com> Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avfilter: add morpho filterPaul B Mahol2021-09-28
|
* avformat/aacdec: enable probesize-sized resyncs mid-streamJan Ekström2021-09-28
| | | | | | | | | | Before adts_aac_resync would always bail out after probesize amount of bytes had been progressed from the start of the input. Now just query the current position when entering resync, and at most advance probesize amount of data from that start position. Fixes #9433