[FFmpeg-devel] [PATCH] avformat/httpauth: support sha-256 and sha-512-256

2022-09-18 Thread Aki Sakurai
Signed-off-by: Aki Sakurai --- libavformat/httpauth.c | 82 -- 1 file changed, 48 insertions(+), 34 deletions(-) diff --git a/libavformat/httpauth.c b/libavformat/httpauth.c index 0a98ff80a5..6781d32ff1 100644 --- a/libavformat/httpauth.c +++ b/libavformat

[FFmpeg-devel] [PATCH 1/6] fate/ffmpeg: Use transcode instead of enc_dec in shortest-sub test

2022-09-18 Thread Andreas Rheinhardt
enc_dec is designed for raw input and output and computes the PSNR between these two. The input of the shortest-sub test is the idx file of a vobsub sub+idx combination and the output is the output of framecrc of said vobsub subtitle muxed into Matroska together with a synthesized video. Calculatin

[FFmpeg-devel] [PATCH 2/6] fate/ffmpeg: Set max_delay for shortest-sub

2022-09-18 Thread Andreas Rheinhardt
The aim of this test is to show the interleavement of the file generated in the first pass; so make the interleavement queue in the framecrc muxer in the second pass as small as possible so that the framecrc muxer does not fix wrong interleavement of the input file behind our backs. Signed-off-by:

[FFmpeg-devel] [PATCH 3/6] avcodec/smc: Move transient GetByteContext from context to stack

2022-09-18 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/smc.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/libavcodec/smc.c b/libavcodec/smc.c index e6d01791c2..2b10e74386 100644 --- a/libavcodec/smc.c +++ b/libavcodec/smc.c @@ -46,8 +46,6 @@ typedef struct SmcContext

[FFmpeg-devel] [PATCH 4/6] avcodec/rpzaenc: Avoid useless intermediate variable

2022-09-18 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/rpzaenc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavcodec/rpzaenc.c b/libavcodec/rpzaenc.c index 0084a271c6..d710eb4f82 100644 --- a/libavcodec/rpzaenc.c +++ b/libavcodec/rpzaenc.c @@ -773,10 +773,9 @@ static int rp

[FFmpeg-devel] [PATCH 6/6] avformat/spdifenc: Reorder struct members to make it smaller

2022-09-18 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavformat/spdifenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/spdifenc.c b/libavformat/spdifenc.c index 7b8e231cff..2861f828b4 100644 --- a/libavformat/spdifenc.c +++ b/libavformat/spdifenc.c @@ -410,8 +410,8 @@ static

[FFmpeg-devel] [PATCH 5/6] fate/segafilm: Add tests for segafilm (de)muxer

2022-09-18 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- tests/Makefile |1 + tests/fate/segafilm.mak | 15 + tests/ref/fate/segafilm-adx-remux| 1055 ++ tests/ref/fate/segafilm-cinepak-mux | 159 tests/ref/fate/segafilm-rawvideo-mux | 98

[FFmpeg-devel] [PATCH] fate/lavf-*: Add missing dependency on pipe protocol

2022-09-18 Thread Andreas Rheinhardt
Forgotten in bf1337f99c66ac574c6e4da65c305ca878f1d65d. Signed-off-by: Andreas Rheinhardt --- tests/fate/lavf-audio.mak | 2 +- tests/fate/lavf-container.mak | 2 +- tests/fate/lavf-image.mak | 2 +- tests/fate/lavf-image2pipe.mak | 3 ++- tests/fate/lavf-video.mak | 2 +- 5 files

[FFmpeg-devel] [PATCH 06/13] avformat/sbgdec: Check ts_int in genrate_intervals

2022-09-18 Thread Michael Niedermayer
There is probably a better place to check for this, but better here than nowhere Fixes: signed integer overflow: -9223372036824775808 - 864 cannot be represented in type 'long' Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_SBG_fuzzer-6601162580688896 Found-by: continuous fuzzin

[FFmpeg-devel] [PATCH 05/13] avformat/sbgdec: clamp end_ts

2022-09-18 Thread Michael Niedermayer
Fixes: signed integer overflow: 9223372036851135042 + 15666854 cannot be represented in type 'long' Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_SBG_fuzzer-6573717339111424 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-b

[FFmpeg-devel] [PATCH 07/13] avformat/sdsdec: Use av_rescale() to avoid intermediate overflow in duration calculation

2022-09-18 Thread Michael Niedermayer
Fixes: signed integer overflow: 72128794995445727 * 240 cannot be represented in type 'long' Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_SDS_fuzzer-6628185583779840 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Mich

[FFmpeg-devel] [PATCH 01/13] avformat/flvdec: Use 64bit for sum_flv_tag_size

2022-09-18 Thread Michael Niedermayer
Fixes: signed integer overflow: 2138820085 + 16130322 cannot be represented in type 'int' Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_LIVE_FLV_fuzzer-6704728165187584 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Mi

[FFmpeg-devel] [PATCH 09/13] avformat/rpl: Use 64bit for duration computation

2022-09-18 Thread Michael Niedermayer
Fixes: signed integer overflow: 24709512 * 88 cannot be represented in type 'int' Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-6737973728641024 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niederm

[FFmpeg-devel] [PATCH 08/13] avformat/xwma: Use av_rescale() for duration computation

2022-09-18 Thread Michael Niedermayer
Fixes: signed integer overflow: 34242363648 * 538976288 cannot be represented in type 'long' Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-6577923913547776 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Mich

[FFmpeg-devel] [PATCH 03/13] avformat/nutdec: Check fields

2022-09-18 Thread Michael Niedermayer
Fixes: signed integer overflow: -2147483648 - 1 cannot be represented in type 'int' Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_NUT_fuzzer-6566001610719232 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niede

[FFmpeg-devel] [PATCH 04/13] avformat/rmdec: check tag_size

2022-09-18 Thread Michael Niedermayer
Fixes: signed integer overflow: -2147483648 - 8 cannot be represented in type 'int' Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_RM_fuzzer-6598073725353984 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Nieder

[FFmpeg-devel] [PATCH 10/13] avformat/vividas: Check packet size

2022-09-18 Thread Michael Niedermayer
Fixes: signed integer overflow: 119760682 - -2084600173 cannot be represented in type 'int' Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVIDAS_fuzzer-6745781167587328 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: M

[FFmpeg-devel] [PATCH 11/13] avformat/spdifdec: Use 64bit to compute bit rate

2022-09-18 Thread Michael Niedermayer
Fixes: signed integer overflow: 32 * 553590816 cannot be represented in type 'int' Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_WAV_fuzzer-6564974517944320 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Nieder

[FFmpeg-devel] [PATCH 12/13] avformat/matroskadec: Error out if a timestamp is beyond duration

2022-09-18 Thread Michael Niedermayer
Maybe timestamp / duration validity should be checked earlier Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_WEBM_DASH_MANIFEST_fuzzer-6586894739177472 Fixes: signed integer overflow: 0 - -9223372036854775808 cannot be represented in type 'long' Found-by: continuous fuzzing process htt

[FFmpeg-devel] [PATCH 13/13] avformat/westwood_vqa: Check chunk size

2022-09-18 Thread Michael Niedermayer
Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int' Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_WSVQA_fuzzer-6593408795279360 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Nied

[FFmpeg-devel] [PATCH 02/13] avformat/mxfdec: Check run_in to fit in int and be valid

2022-09-18 Thread Michael Niedermayer
Fixes: signed integer overflow: 9223372036854775807 - -2146905566 cannot be represented in type 'long' Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-6570996594769920 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-of

[FFmpeg-devel] [PATCH] mediacodecdec_common: enable refcounting of buffers unconditionally

2022-09-18 Thread sfan5
This allows av_mediacodec_release_buffer to be called safely after the decoder is closed, this was already the case with delay_flush=1. Note that this causes holding onto frames to keep the decoding context alive which is generally considered to be the intended behavior. --- libavcodec/mediacodec

[FFmpeg-devel] [PATCH] mediacodecdec_common: enable refcounting of buffers unconditionally

2022-09-18 Thread sfan5
This allows av_mediacodec_release_buffer to be called safely after the decoder is closed, this was already the case with delay_flush=1. Note that this causes holding onto frames to keep the decoding context alive which is generally considered to be the intended behavior (resending as my patch go

[FFmpeg-devel] [PATCH 01/17] avcodec/avcodec: Uninitialize AVChannelLayout before overwriting it

2022-09-18 Thread Andreas Rheinhardt
Otherwise, there might be leaks. Signed-off-by: Andreas Rheinhardt --- libavcodec/avcodec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c index 29643199be..a165cdea95 100644 --- a/libavcodec/avcodec.c +++ b/libavcodec/avcodec.c @@ -235,6 +235,7 @

[FFmpeg-devel] [PATCH 02/17] avcodec/encode: Remove dead deprecated check

2022-09-18 Thread Andreas Rheinhardt
The wrapper for the legacy channel layout API already sets AVCodecContext.channels based upon AVCodecContext.channel_layout if the latter is set while the former is unset. Signed-off-by: Andreas Rheinhardt --- libavcodec/encode.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavcodec/en

[FFmpeg-devel] [PATCH 03/17] avcodec/avcodec: Check for more invalid channel layouts

2022-09-18 Thread Andreas Rheinhardt
In particular, check the provided channel layout for encoders without AVCodec.ch_layouts set. This fixes an infinite loop in the WavPack encoder (and maybe other issues in other encoders as well) in case the channel count is zero. Signed-off-by: Andreas Rheinhardt --- libavcodec/avcodec.c | 11 +

[FFmpeg-devel] [PATCH 04/17] avcodec/avcodec: Always use old channel count/layout if set

2022-09-18 Thread Andreas Rheinhardt
This ensures that if AVCodecContext.channels or AVCodecContext.channel_layout are set, AVCodecContext.ch_layout has the equivalent values after this block. (In case these values are set inconsistently, the consistency check for ch_layout below will error out.) Signed-off-by: Andreas Rheinhardt -

[FFmpeg-devel] [PATCH 05/17] avcodec/encode: Remove deprecated always-false checks

2022-09-18 Thread Andreas Rheinhardt
Now that it is ensured that the old and new channel count/layout values coincide if the old ones are set, the consistency of the AVChannelLayout (which is checked before we reach this point) implies the consistency of the old values, making these checks here dead code. So remove them. Signed-off-b

[FFmpeg-devel] [PATCH 07/17] avcodec/pcm-blurayenc: Don't presume every channel layout to be native

2022-09-18 Thread Andreas Rheinhardt
The pcm_bluray encoder has AVCodec.ch_layouts set, so that ff_encode_preinit() checks that the channel layout in use is equivalent to one of the layouts from AVCodec.ch_layouts. Yet equivalent is not the same as identical; in particular, custom layouts equivalent to native layouts are possible (and

[FFmpeg-devel] [PATCH 08/17] avcodec/pcm: Remove always-false check

2022-09-18 Thread Andreas Rheinhardt
None of the decoders here have the AV_CODEC_CAP_CHANNEL_CONF set, so that it is already checked generically that the number of channels is positive. Signed-off-by: Andreas Rheinhardt --- libavcodec/pcm.c | 5 - 1 file changed, 5 deletions(-) diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c

[FFmpeg-devel] [PATCH 09/17] avcodec/libcodec2: Remove dead channel count check

2022-09-18 Thread Andreas Rheinhardt
This encoder has AVCodec.ch_layouts set, so that this is checked generically. Signed-off-by: Andreas Rheinhardt --- libavcodec/libcodec2.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libavcodec/libcodec2.c b/libavcodec/libcodec2.c index be9677ddeb..581ef04ce2 100644 --- a/libavcodec/libco

[FFmpeg-devel] [PATCH 10/17] avcodec/libshine: Remove dead channel count check

2022-09-18 Thread Andreas Rheinhardt
This encoder has AVCodec.ch_layouts set, so that this is checked generically. Signed-off-by: Andreas Rheinhardt --- libavcodec/libshine.c | 5 - 1 file changed, 5 deletions(-) diff --git a/libavcodec/libshine.c b/libavcodec/libshine.c index 621c57816a..e266229f03 100644 --- a/libavcodec/lib

[FFmpeg-devel] [PATCH 11/17] avcodec/libspeexenc: Remove dead channel count check

2022-09-18 Thread Andreas Rheinhardt
This encoder has AVCodec.ch_layouts set, so that this is checked generically. Signed-off-by: Andreas Rheinhardt --- libavcodec/libspeexenc.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/libavcodec/libspeexenc.c b/libavcodec/libspeexenc.c index 8d2c6347fa..2191e7dac7 100644 --- a/lib

[FFmpeg-devel] [PATCH 12/17] avcodec/mpegaudioenc_template: Remove dead channel count check

2022-09-18 Thread Andreas Rheinhardt
The encoders using this have AVCodec.ch_layouts set, so that this is checked generically. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpegaudioenc_template.c | 4 1 file changed, 4 deletions(-) diff --git a/libavcodec/mpegaudioenc_template.c b/libavcodec/mpegaudioenc_template.c index

[FFmpeg-devel] [PATCH 13/17] avcodec/mlpenc: Fix channel layouts

2022-09-18 Thread Andreas Rheinhardt
The encoder actually creates files with side channels, not back channels. See thd_layout in mlp_parse.h. Signed-off-by: Andreas Rheinhardt --- libavcodec/mlpenc.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libavcodec/mlpenc.c b/libavcodec/mlpenc.c index b66f3a

[FFmpeg-devel] [PATCH 14/17] avcodec/mlpenc: Simplify channel layout comparisons

2022-09-18 Thread Andreas Rheinhardt
These encoders have AVCodec.ch_layouts set, so ff_encode_preinit() has already checked that the used channel layout is equivalent to one of these native layouts. Therefore one can simply compare the channel masks (with the added complication that one has to use av_channel_layout_subset() to get it,

[FFmpeg-devel] [PATCH 15/17] avcodec/mlpenc: Remove dead channel layout checks

2022-09-18 Thread Andreas Rheinhardt
ff_encode_preinit() has already checked that the channel layout is equivalent to one of the layouts in AVCodec.ch_layouts. Signed-off-by: Andreas Rheinhardt --- libavcodec/mlpenc.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/libavcodec/mlpenc.c b/libavcodec/ml

[FFmpeg-devel] [PATCH 06/17] avcodec/dfpwmdec: Remove always-false check

2022-09-18 Thread Andreas Rheinhardt
This decoder does not have the AV_CODEC_CAP_CHANNEL_CONF set, so that number of channels has to be set by the user before avcodec_open2(). Signed-off-by: Andreas Rheinhardt --- libavcodec/dfpwmdec.c | 5 - 1 file changed, 5 deletions(-) diff --git a/libavcodec/dfpwmdec.c b/libavcodec/dfpwmd

[FFmpeg-devel] [PATCH 16/17] avcodec/dcaenc: Remove dead checks for unspec channel layouts

2022-09-18 Thread Andreas Rheinhardt
This encoder has AVCodec.ch_layouts set, so ff_encode_preinit() ensures that the used channel layout is equivalent to one of these. Signed-off-by: Andreas Rheinhardt --- The new channel layout API is more stricter wrt these checks than the old one; the old one let you pass if channels was set and

[FFmpeg-devel] [PATCH 17/17] avcodec/dcaenc: Simplify channel layout check

2022-09-18 Thread Andreas Rheinhardt
ff_encode_preinit() ensures that the channel layout is equivalent to one of the channel layouts in AVCodec.ch_layout; given that all of these channel layouts have distinct numbers of channels, one can therefore uniquely determine the channel layout by the number of channels. Signed-off-by: Andreas

Re: [FFmpeg-devel] [PATCH 1/9] fate/audio: Add tests for APTX (HD)

2022-09-18 Thread Andreas Rheinhardt
Andreas Rheinhardt: > We have de- and encoders for APTX and APTX HD, yet not FATE tests. > This commit therefore adds a transcoding test to utilize them. > > Furthermore, during creating these tests it turned out that > the duration is set incorrectly for APTX HD. This will be fixed > in a future

Re: [FFmpeg-devel] [PATCH 2/2] swscale/input: Avoid calls to av_pix_fmt_desc_get()

2022-09-18 Thread Andreas Rheinhardt
Michael Niedermayer: > On Fri, Sep 16, 2022 at 09:00:24AM +0200, Anton Khirnov wrote: >> Quoting Andreas Rheinhardt (2022-09-09 20:15:22) >>> Michael Niedermayer: On Thu, Sep 08, 2022 at 11:44:51PM +0200, Andreas Rheinhardt wrote: > Michael Niedermayer: >> On Thu, Sep 08, 2022 at 09:38

[FFmpeg-devel] [PATCH 1/2] avcodec/mjpegdec: Check for unsupported bayer case

2022-09-18 Thread Michael Niedermayer
Fixes: out of array access Fixes: 51462/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-662559341582745 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/mjpegdec.c | 2 ++ 1 file

[FFmpeg-devel] [PATCH 2/2] avutil/aes: Silence fuzzer about accessing round_key

2022-09-18 Thread Michael Niedermayer
Fixes: index 32 out of bounds for type 'uint8_t [16]' Fixes: 51253/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5968304170205184 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavutil/aes.c |

[FFmpeg-devel] [PATCH] x86/tx_float: add 15xN PFA FFT AVX SIMD

2022-09-18 Thread Lynne
~4x faster than the C version. Patch attached. >From 00112ce7895f48861dd5f4bbfe272874f95c428a Mon Sep 17 00:00:00 2001 From: Lynne Date: Mon, 19 Sep 2022 05:53:01 +0200 Subject: [PATCH] x86/tx_float: add 15xN PFA FFT AVX SIMD ~4x faster than the C version. --- doc/transforms.md | 3

Re: [FFmpeg-devel] [PATCH] improve VAAPI error handling

2022-09-18 Thread Xiang, Haihao
> In case something is wrong in vaapi_device_create() you usually just get > EINVAL, but not the real cause. > This patch allows to return the cause as set in errno. > EINVAL is used for kernel driver name mismatch. > ENODEV in case vaGetDisplayDRM() fails. > Also changed: >Try X11 interface

[FFmpeg-devel] [PATCH] lavf/async: Fix wrapped_url_read return value

2022-09-18 Thread Guangyu Sun
This fixes a regression from commit 36117968ad. wrapped_url_read() used to be able to return positive number from ffurl_read(). It relies on the result to check if EOF is reached in async_buffer_task(). Test case: ffmpeg -f lavfi -i testsrc -t 1 test.mp4 ffmpeg -i async:test.mp4 Signed-off-b

Re: [FFmpeg-devel] [PATCH v3 2/3] lavc/decode: Add internal surface re-allocate method for hwaccel

2022-09-18 Thread Wang, Fei W
On Wed, 2022-09-07 at 22:56 +0100, Mark Thompson wrote: > On 23/08/2022 09:19, Fei Wang wrote: > > From: Linjie Fu > > > > Add HWACCEL_CAP_INTERNAL_ALLOC flag to indicate hwaccels are able > > to > > re-allocate surface internally through ff_decode_get_hw_frames_ctx. > > So that hwaccels don't ne