Re: [FFmpeg-devel] [PATCH 8/9] avformat/icodec: Check nb_pal

2022-09-17 Thread Peter Ross
On Sat, Sep 17, 2022 at 11:15:56PM +0200, Michael Niedermayer wrote: > Fixes: signed integer overflow: 538976288 * 4 cannot be represented in type > 'int' > Fixes: > 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_ICO_fuzzer-6690068904935424 > > Found-by: continuous fuzzing process > https://gi

Re: [FFmpeg-devel] [PATCH v4] lavu/pixdesc: favour formats where depth and subsampling exactly match

2022-09-17 Thread Philip Langdale
On Sat, 17 Sep 2022 21:13:37 +0200 Michael Niedermayer wrote: > > --- > > libavutil/pixdesc.c | 31 +++- > > libavutil/pixdesc.h | 15 ++-- > > libavutil/tests/pixfmt_best.c | 129 > > +- tests/ref/fate/pixfmt_best| > > 2 +- 4 files c

[FFmpeg-devel] [PATCH v5] lavu/pixdesc: favour formats where depth and subsampling exactly match

2022-09-17 Thread Philip Langdale
Since introducing the various packed formats used by VAAPI (and p012), we've noticed that there's actually a gap in how av_find_best_pix_fmt_of_2 works. It doesn't actually assign any value to having the same bit depth as the source format, when comparing against formats with a higher bit depth. Th

[FFmpeg-devel] [PATCH 2/9] avformat/apm: Use 64bit for bit_rate computation

2022-09-17 Thread Michael Niedermayer
Fixes: signed integer overflow: -1155522528 * 4 cannot be represented in type 'int' Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_APM_fuzzer-6580670570299392 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niede

[FFmpeg-devel] [PATCH 9/9] avformat/jacosubdec: Fix overflow in get_shift()

2022-09-17 Thread Michael Niedermayer
Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_JACOSUB_fuzzer-6722544461283328 Fixes: signed integer overflow: 48214448 * 60 cannot be represented in type 'int' Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Nie

[FFmpeg-devel] [PATCH 8/9] avformat/icodec: Check nb_pal

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

[FFmpeg-devel] [PATCH 7/9] avformat/genh: Check nb_channels for IMA ADPCM

2022-09-17 Thread Michael Niedermayer
The check could be made more strict Fixes: signed integer overflow: 36 * 538976288 cannot be represented in type 'int' Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_GENH_fuzzer-6539389873815552 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/project

[FFmpeg-devel] [PATCH 6/9] avformat/dxa: avoid bpc overflows

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

[FFmpeg-devel] [PATCH 4/9] avformat/cafdec: Check that nb_frasmes fits within 64bit

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

[FFmpeg-devel] [PATCH 3/9] avformat/asfdec_o: Limit packet offset

2022-09-17 Thread Michael Niedermayer
avoids overflows with it Fixes: signed integer overflow: 9223372036846866010 + 4294967047 cannot be represented in type 'long' Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_ASF_O_fuzzer-6538296768987136 Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_ASF_O_fuzzer-657169555665715

[FFmpeg-devel] [PATCH 5/9] avformat/dhav: Use 64bit seek_back

2022-09-17 Thread Michael Niedermayer
Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_DHAV_fuzzer-6604736532447232 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/pro

[FFmpeg-devel] [PATCH 1/9] avformat/ape: Check frames size

2022-09-17 Thread Michael Niedermayer
Fixes: signed integer overflow: 9223372036854775806 + 3 cannot be represented in type 'long' Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_APE_fuzzer-6389264140599296 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Mich

Re: [FFmpeg-devel] [PATCH v4] lavu/pixdesc: favour formats where depth and subsampling exactly match

2022-09-17 Thread Michael Niedermayer
On Fri, Sep 16, 2022 at 06:44:06PM -0700, Philip Langdale wrote: > Since introducing the various packed formats used by VAAPI (and p012), > we've noticed that there's actually a gap in how > av_find_best_pix_fmt_of_2 works. It doesn't actually assign any value > to having the same bit depth as the

Re: [FFmpeg-devel] [PATCHv2] lavc/audiodsp: fix aliasing violation

2022-09-17 Thread Rémi Denis-Courmont
Ping -- Rémi Denis-Courmont http://www.remlab.net/ ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubs

Re: [FFmpeg-devel] [PATCHv2] lavc: avoid rounding errors in float constants

2022-09-17 Thread Rémi Denis-Courmont
Ping... -- Rémi Denis-Courmont http://www.remlab.net/ ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "uns

[FFmpeg-devel] [PATCH] mpegts: identify and demux DSMCC-B/MHEG streams

2022-09-17 Thread Scott Theisen
These changes are from MythTV. --- The `AV_CODEC_ID`s are probably in the wrong place since these are data codecs, but that is where they are In MythTV. There was also a related change to libavformat/demux.c's avformat_find_stream_info() trying to optimize it for MHEG streams, but it is unnecessa

Re: [FFmpeg-devel] [PATCH] format/imfdec: improve error handling when selecting tracks for playback

2022-09-17 Thread Pierre-Anthony Lemieux
On Sat, Sep 17, 2022 at 7:43 AM Michael Niedermayer wrote: > > On Fri, Sep 16, 2022 at 01:19:09PM -0700, Pierre-Anthony Lemieux wrote: > > On Fri, Sep 16, 2022 at 1:15 PM Michael Niedermayer > > wrote: > > > > > > On Fri, Sep 16, 2022 at 10:39:22AM -0700, Pierre-Anthony Lemieux wrote: > > > > On

Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg: Fix EOF pts for libavfilter in send_filter_eof()

2022-09-17 Thread Li-Heng Chen
Ping. Any comments on the updated patch? On Tue, Sep 13, 2022 at 9:46 AM Li-Heng Chen wrote: > > On Tue, Sep 13, 2022 at 4:40 AM Paul B Mahol wrote: > > > > On 9/11/22, Li-Heng Chen wrote: > > > When input is video bitstream (e.g. *.264) with framerate set by -r, > > > ist->pts could be a nonse

Re: [FFmpeg-devel] [PATCH 1/2] avformat/aiffdec: Check block_duration

2022-09-17 Thread Paul B Mahol
On 9/17/22, Michael Niedermayer wrote: > Fixes: signed integer overflow: 3 * -2147483648 cannot be represented in > type 'int' > Fixes: > 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_AIFF_fuzzer-6668935979728896 > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/

Re: [FFmpeg-devel] [PATCH 2/2] avformat/aiffdec: Use 64bit for block_duration use

2022-09-17 Thread Paul B Mahol
On 9/17/22, Michael Niedermayer wrote: > Fixes: signed integer overflow: 3 * -2147483648 cannot be represented in > type 'int' > Fixes: > 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_AIFF_fuzzer-6668935979728896 > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/

Re: [FFmpeg-devel] [PATCH] format/imfdec: improve error handling when selecting tracks for playback

2022-09-17 Thread Michael Niedermayer
On Fri, Sep 16, 2022 at 01:19:09PM -0700, Pierre-Anthony Lemieux wrote: > On Fri, Sep 16, 2022 at 1:15 PM Michael Niedermayer > wrote: > > > > On Fri, Sep 16, 2022 at 10:39:22AM -0700, Pierre-Anthony Lemieux wrote: > > > On Fri, Sep 16, 2022 at 10:27 AM Michael Niedermayer > > > wrote: > > > > >

[FFmpeg-devel] [PATCH 2/2] avformat/aiffdec: Use 64bit for block_duration use

2022-09-17 Thread Michael Niedermayer
Fixes: signed integer overflow: 3 * -2147483648 cannot be represented in type 'int' Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_AIFF_fuzzer-6668935979728896 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Nied

[FFmpeg-devel] [PATCH 1/2] avformat/aiffdec: Check block_duration

2022-09-17 Thread Michael Niedermayer
Fixes: signed integer overflow: 3 * -2147483648 cannot be represented in type 'int' Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_AIFF_fuzzer-6668935979728896 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Nied

[FFmpeg-devel] [PATCH 5/6] lavc/audiodsp: add RISC-V F float vector clip

2022-09-17 Thread remi
From: Rémi Denis-Courmont RV64G supports MIN & MAX instructions natively only on floating point registers, not general purpose ones. The later would require the Zbb extension. Due to that, it is actually faster to perform the clipping "properly" in FPU. Benchmarked on SiFive U74-MC: audiodsp.ve

[FFmpeg-devel] [PATCH 4/6] lavu/riscv: initial common header for assembler macros

2022-09-17 Thread remi
From: Rémi Denis-Courmont --- libavutil/riscv/asm.S | 74 +++ 1 file changed, 74 insertions(+) create mode 100644 libavutil/riscv/asm.S diff --git a/libavutil/riscv/asm.S b/libavutil/riscv/asm.S new file mode 100644 index 00..7623c161cf --- /dev/

[FFmpeg-devel] [PATCH 6/6] lavc/pixblockdsp: RISC-V scalar optimisations

2022-09-17 Thread remi
From: Rémi Denis-Courmont Benchmarks: get_pixels_c: 180.0 get_pixels_rvi: 136.7 --- libavcodec/pixblockdsp.c| 2 + libavcodec/pixblockdsp.h| 2 + libavcodec/riscv/Makefile | 2 + libavcodec/riscv/pixblockdsp_init.c | 43 ++ libavcodec/risc

[FFmpeg-devel] [PATCH 3/6] configure: probe RISC-V Vector extension

2022-09-17 Thread remi
From: Rémi Denis-Courmont --- Makefile | 2 +- configure| 15 +++ ffbuild/arch.mak | 2 ++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 61f79e27ae..1fb742f390 100644 --- a/Makefile +++ b/Makefile @@ -91,7 +91,7 @@ ffbuild/

[FFmpeg-devel] [PATCH 2/6] lavu/cpu: CPU flags for the RISC-V Vector extension

2022-09-17 Thread remi
From: Rémi Denis-Courmont RVV defines a total of 12 different extensions, including: - 5 different instruction subsets: - Zve32x: 8-, 16- and 32-bit integers, - Zve32f: Zve32x plus single precision floats, - Zve64x: Zve32x plus 64-bit integers, - Zve64f: Zve32f plus Zve64x, - Zve64d: Z

[FFmpeg-devel] [PATCH 1/6] lavu/cpu: detect RISC-V base extensions

2022-09-17 Thread remi
From: Rémi Denis-Courmont This introduces compile-time and run-time CPU detection on RISC-V. In practice, I doubt that FFmpeg will ever see a RISC-V CPU without all of I, F and D extensions, and if it does, it probably won't have run-time detection. So the flags are essentially always set. But a

[FFmpeg-devel] [PATCHv2 0/6] RISC-V CPU extensions

2022-09-17 Thread Rémi Denis-Courmont
Hi, This adds configure, compile-time, run-time detection for RISC-V scalar and vector extensions. Also a couple of scalar optimisations. Rémi Denis-Courmont (6): lavu/cpu: detect RISC-V base extensions lavu/cpu:

[FFmpeg-devel] [PATCH] avcodec/mlpdec: relax channel checking

2022-09-17 Thread Paul B Mahol
Patch attached. From 5be1fbb848b50e02d302873653e94ed77dea861c Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Sat, 17 Sep 2022 14:08:58 +0200 Subject: [PATCH] avcodec/mlpdec: relax channels checking Internal TrueHD decoder channel rematrix can mix 2 stereo substreams into single mono stream. F

Re: [FFmpeg-devel] [PATCH 1/2] lavc/vorbisdec: use ptrdiff_t to iterate over intptr_t

2022-09-17 Thread Andreas Rheinhardt
r...@remlab.net: > From: Rémi Denis-Courmont > > While this probably never overflows, we are better safe than sorry. > > The callback prototype should probably also use ptrdiff_t or size_t but > I diggress. > --- > libavcodec/vorbisdec.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-)

Re: [FFmpeg-devel] [PATCH 2/2] lavc/vorbisdec: use intermediate variables

2022-09-17 Thread Andreas Rheinhardt
r...@remlab.net: > From: Rémi Denis-Courmont > > The compiler cannot infer that the two float vectors do not alias, > causing unnecessary extra loads and serialisation. This patch caches > the two input values in local variables so that compiler can optimise > individual loop iterations. > --- W

[FFmpeg-devel] [PATCH 1/2] lavc/vorbisdec: use ptrdiff_t to iterate over intptr_t

2022-09-17 Thread remi
From: Rémi Denis-Courmont While this probably never overflows, we are better safe than sorry. The callback prototype should probably also use ptrdiff_t or size_t but I diggress. --- libavcodec/vorbisdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/vorbisdec.

[FFmpeg-devel] [PATCH 2/2] lavc/vorbisdec: use intermediate variables

2022-09-17 Thread remi
From: Rémi Denis-Courmont The compiler cannot infer that the two float vectors do not alias, causing unnecessary extra loads and serialisation. This patch caches the two input values in local variables so that compiler can optimise individual loop iterations. --- libavcodec/vorbisdec.c | 22