Re: [FFmpeg-devel] [PATCH 2/6] avcodec/dxtory: Fix negative shift in dxtory_decode_v1_410()

2020-09-26 Thread Paul B Mahol
On Sat, Sep 26, 2020 at 12:26:34AM +0200, Michael Niedermayer wrote: > Fixes: left shift of negative value -256 > Fixes: > 25460/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXTORY_fuzzer-5073252341514240 > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/mas

Re: [FFmpeg-devel] [PATCH 1/6] avformat/argo_{asf, brp}: fix potential segfault in ff_argo_asf_fill_stream()

2020-09-26 Thread Paul B Mahol
On Sat, Sep 26, 2020 at 02:38:45AM +, Zane van Iperen wrote: > Signed-off-by: Zane van Iperen > --- > libavformat/argo_asf.c | 10 +- > libavformat/argo_asf.h | 2 +- > libavformat/argo_brp.c | 2 +- > 3 files changed, 7 insertions(+), 7 deletions(-) > lgtm ___

Re: [FFmpeg-devel] [PATCH 1/6] avcodec/dxtory: Fix get_raw_size() for YUV

2020-09-26 Thread Paul B Mahol
On Sat, Sep 26, 2020 at 12:26:33AM +0200, Michael Niedermayer wrote: > Fixes: out of array read > Fixes: > 25455/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXTORY_fuzzer-6327985731534848 > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/master/projects/ffm

Re: [FFmpeg-devel] [PATCH 3/6] avcodec/dxtory: Fix negative shift in dx2_decode_slice_410()

2020-09-26 Thread Paul B Mahol
On Sat, Sep 26, 2020 at 12:26:35AM +0200, Michael Niedermayer wrote: > Fixes: left shift of negative value -768 > Fixes: > 25574/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXTORY_fuzzer-6012596027916288 > > Found-by: continuous fuzzing process > https://github.com/google/oss-fuzz/tree/mas

Re: [FFmpeg-devel] [PATCH 1/2] examples/muxing: misc style fixes

2020-09-26 Thread Steven Liu
Jun Zhao 于2020年9月25日周五 下午8:24写道: > > From: Jun Zhao > > misc style fixes. > > Signed-off-by: Jun Zhao > --- > doc/examples/muxing.c | 47 +++ > 1 file changed, 23 insertions(+), 24 deletions(-) > > diff --git a/doc/examples/muxing.c b/doc/examples/mux

Re: [FFmpeg-devel] [PATCH 2/2] lavf/hls: add AC-3/EAC-3 to allowed extensions file list

2020-09-26 Thread Steven Liu
Jun Zhao 于2020年9月25日周五 下午8:25写道: > > From: Jun Zhao > > Add AC-3/EAC-3 to allowed extensions file list. > > From HTTP Live Streaming 2nd Edition draft-pantos-hls-rfc8216bis-07 > section 3.1.3.Packed Audio, HLS demuxer need to support MP3/AC-3/EAC-3. > > Signed-off-by: Jun Zhao > --- > libavform

Re: [FFmpeg-devel] [PATCH 1/3] avformat/aviobuf: read till the very end of the IO buffer

2020-09-26 Thread Marton Balint
On Sun, 20 Sep 2020, Marton Balint wrote: On Sun, 20 Sep 2020, Paul B Mahol wrote: On Sun, Sep 20, 2020 at 10:52:51AM +0200, Marton Balint wrote: There was an off-by-one error when checking if the IO buffer still has enough space till the end. How to reproduce such error(s)? It is n

Re: [FFmpeg-devel] [PATCH 2/3] avformat/aviobuf: fix checks in ffio_ensure_seekback

2020-09-26 Thread Marton Balint
On Sun, 20 Sep 2020, Marton Balint wrote: On Sun, 20 Sep 2020, Paul B Mahol wrote: On Sun, Sep 20, 2020 at 03:16:15PM +0200, Marton Balint wrote: On Sun, 20 Sep 2020, Paul B Mahol wrote: > On Sun, Sep 20, 2020 at 10:52:52AM +0200, Marton Balint wrote: > > Signed-off-by: Marton Balint

Re: [FFmpeg-devel] [PATCH 2/3] avformat/aviobuf: fix checks in ffio_ensure_seekback

2020-09-26 Thread Michael Niedermayer
On Sun, Sep 20, 2020 at 10:52:52AM +0200, Marton Balint wrote: > Signed-off-by: Marton Balint > --- > libavformat/aviobuf.c | 7 +-- > 1 file changed, 5 insertions(+), 2 deletions(-) The commit message is too terse. It is not clear from it what the problem is that is being fixed and how it i

[FFmpeg-devel] [PATCH 03/25] avcodec/magicyuv: Improve overread check when parsing Huffman tables

2020-09-26 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/magicyuv.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libavcodec/magicyuv.c b/libavcodec/magicyuv.c index b56d3e9d32..d2f6a9b01e 100644 --- a/libavcodec/magicyuv.c +++ b/libavcodec/magicyuv.c @@ -394,8 +394,13 @@ stat

[FFmpeg-devel] [PATCH 04/25] avcodec/diracdsp: Remove unused variable

2020-09-26 Thread Andreas Rheinhardt
Forgotten in ca3c6c981aa5b0af8a5576020b79fdd3cdf9ae9e. Signed-off-by: Andreas Rheinhardt --- libavcodec/diracdsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/diracdsp.c b/libavcodec/diracdsp.c index 4e08d3817e..80dfafd78b 100644 --- a/libavcodec/diracdsp.c +++

[FFmpeg-devel] [PATCH 05/25] avcodec/magicyuv: Check early for invalid slices

2020-09-26 Thread Andreas Rheinhardt
Every plane of each slice has to contain at least two bytes for flags and the type of prediction used. Signed-off-by: Andreas Rheinhardt --- libavcodec/magicyuv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/magicyuv.c b/libavcodec/magicyuv.c index d2f6a9b01e..6c29efc9f4 1006

[FFmpeg-devel] [PATCH 13/25] avcodec/utvideodec/enc: Fix building Huffman table

2020-09-26 Thread Andreas Rheinhardt
The Ut Video format stores Huffman tables in its bitstream by coding the length of a given symbol; it does not code the actual code directly, instead this is to be inferred by the rule that a symbol is to the left of every shorter symbol in the Huffman tree and that for symbols of the same length t

[FFmpeg-devel] [PATCH 11/25] avcodec/magicyuv: Avoid AV_QSORT when creating Huffman table

2020-09-26 Thread Andreas Rheinhardt
The MagicYUV format stores Huffman tables in its bitstream by coding the length of a given symbol; it does not code the actual code directly, instead this is to be inferred by the rule that a symbol is to the left of every shorter symbol in the Huffman tree and that for symbols of the same length t

[FFmpeg-devel] [PATCH 07/25] avcodec/magicyuv: Use const uint8_t* for pointer to immutable data

2020-09-26 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/magicyuv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/magicyuv.c b/libavcodec/magicyuv.c index f7dfef0eb8..3413d8f298 100644 --- a/libavcodec/magicyuv.c +++ b/libavcodec/magicyuv.c @@ -63,7 +63,7 @@ typedef struc

[FFmpeg-devel] [PATCH 15/25] avcodec/utvideodec: Avoid qsort when creating Huffman tables

2020-09-26 Thread Andreas Rheinhardt
The Ut video format uses Huffman trees which are only implicitly coded in the bitstream: Only the lengths of the codes are coded, the rest has to be inferred by the decoder according to the rule that the longer codes are to the left of shorter codes in the tree and on each level the symbols are des

[FFmpeg-devel] [PATCH 09/25] avcodec/magicyuv: Don't invert order unnecessarily

2020-09-26 Thread Andreas Rheinhardt
The MagicYUV decoder currently sets both the length and the symbol field of an array of HuffEntries; hereby the symbol of the ith entry (0-based) is just i. Then said array gets sorted so that entries with greater length are at the end and entries with the same length are ordered so that those with

[FFmpeg-devel] [PATCH 08/25] avcodec/magicyuv: Replace implicit checks for overread by explicit ones

2020-09-26 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/magicyuv.c | 49 --- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/libavcodec/magicyuv.c b/libavcodec/magicyuv.c index 3413d8f298..93ee739093 100644 --- a/libavcodec/magicyuv.c +++ b/libavco

[FFmpeg-devel] [PATCH 16/25] avcodec/utvideo: Remove unused array

2020-09-26 Thread Andreas Rheinhardt
Unused since 3594788b713e76449eda0bc9d64b38258c86a594. Signed-off-by: Andreas Rheinhardt --- libavcodec/utvideo.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavcodec/utvideo.c b/libavcodec/utvideo.c index b14e56e0d8..0cf0cbcd8b 100644 --- a/libavcodec/utvideo.c +++ b/libavcodec/utvid

[FFmpeg-devel] [PATCH 20/25] avcodec/utils: Improve check for freeing codec private options

2020-09-26 Thread Andreas Rheinhardt
Don't check for AVCodec.priv_data_size (which is always true if AVCodec.priv_class is set). Instead check for AVCodecContext.priv_data to actually exist. (Note: av_opt_free(NULL) is a no-op.) Signed-off-by: Andreas Rheinhardt --- libavcodec/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 dele

[FFmpeg-devel] [PATCH 21/25] avcodec/utils: Don't forget cleaning up when allocating priv_data fails

2020-09-26 Thread Andreas Rheinhardt
Allocating an AVCodecContext's priv_data used to be the first object allocated in avcodec_open2(), so it was unnecessary to goto free_and_end (which does the cleanup) upon error here. But this is no longer so since f3a29b750a5979ae6847879fba758faf1fae88d0. Signed-off-by: Andreas Rheinhardt --- l

[FFmpeg-devel] [PATCH 19/25] avcodec/utils: Remove always-true check

2020-09-26 Thread Andreas Rheinhardt
The first thing avcodec_open2() allocates is the AVCodecInternal. If allocating it fails, a jump to end occurs; but if an error happens after its allocation, a jump to free_and_end happens which frees all allocations performed so far and then jumps to end. Yet free_and_end contained a check for AVC

[FFmpeg-devel] [PATCH 22/25] avcodec/utils: Also free encoder extradata on avcodec_open2() error

2020-09-26 Thread Andreas Rheinhardt
It is owned by libavcodec for encoders. Signed-off-by: Andreas Rheinhardt --- libavcodec/utils.c | 4 1 file changed, 4 insertions(+) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 05064b560f..a976ceb260 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1034,11 +1034

[FFmpeg-devel] [PATCH 18/25] avcodec/utils: Only call codec->close if init has been called

2020-09-26 Thread Andreas Rheinhardt
avcodec_open2() also called the AVCodec's close function if an error happened before init had ever been called if the AVCodec has the FF_CODEC_CAP_INIT_CLEANUP flag set. This is against the documentation of said flag: "The codec allows calling the close function for deallocation even if the init fu

[FFmpeg-devel] [PATCH 17/25] avcodec/utvideo: Move stuff only used by Ut encoder to Ut encoder

2020-09-26 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/Makefile | 4 ++-- libavcodec/utvideo.c| 39 --- libavcodec/utvideo.h| 12 libavcodec/utvideoenc.c | 23 +-- 4 files changed, 23 insertions(+), 55 deletions(-) delet

[FFmpeg-devel] [PATCH 23/25] avcodec/utils: Reindentation

2020-09-26 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/utils.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index a976ceb260..af2a4c2a88 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1037,7 +1037,7 @@

[FFmpeg-devel] [PATCH 25/25] avcodec/fraps: Use cached bitstream reader

2020-09-26 Thread Andreas Rheinhardt
This proved beneficial for performance: For the sample [1] the number of decicycles in one decode call decreased from 155851561 to 108158037 for Clang 10 and from 168270467 to 128847479 for GCC 9.3. For x86-32 compiled with GCC 9.3 and run on an x64 Haswell the number increased from 158405517 to 20

[FFmpeg-devel] [PATCH 24/25] avcodec/fraps: Use unchecked bitstream reader

2020-09-26 Thread Andreas Rheinhardt
The fraps decoder already checked for overreads manually (and errored out in this scenario), yet it still enabled implicit checks, leading to worse performance and more code size. This commit disables the implicit bitstream reader checks. For the sample [1] this improves performance from 195105896

Re: [FFmpeg-devel] [PATCH 13/25] avcodec/utvideodec/enc: Fix building Huffman table

2020-09-26 Thread Paul B Mahol
On Sat, Sep 26, 2020 at 12:27:52PM +0200, Andreas Rheinhardt wrote: > The Ut Video format stores Huffman tables in its bitstream by coding > the length of a given symbol; it does not code the actual code directly, > instead this is to be inferred by the rule that a symbol is to the left > of every

[FFmpeg-devel] [PATCH 12/25] avcodec/magicyuv: Don't waste stack space

2020-09-26 Thread Andreas Rheinhardt
Now that the HuffEntries are no longer sorted by the MagicYUV decoder, their symbols are trivial: The symbol of the element with index i is i. They can therefore be removed. Furthermore, despite the length of the codes being in the range 1..32 bits, the actual value of the codes is <= 4096 (for 12

[FFmpeg-devel] [PATCH 01/25] avcodec/photocd: Simplify parsing Huffman tables a bit

2020-09-26 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/photocd.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/libavcodec/photocd.c b/libavcodec/photocd.c index 057c9d33d4..8fd4536a65 100644 --- a/libavcodec/photocd.c +++ b/libavcodec/photocd.c @@ -245,21 +245,20 @@

[FFmpeg-devel] [PATCH 14/25] avcodec/utvideodec: Remove code duplication when creating Huffman tables

2020-09-26 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/utvideodec.c | 55 + 1 file changed, 6 insertions(+), 49 deletions(-) diff --git a/libavcodec/utvideodec.c b/libavcodec/utvideodec.c index b3c4c3519b..f014e90606 100644 --- a/libavcodec/utvideodec.c +++ b/li

[FFmpeg-devel] [PATCH 02/25] avcodec/bytestream: Add unchecked bytestream2 peek functions

2020-09-26 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/bytestream.h | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavcodec/bytestream.h b/libavcodec/bytestream.h index 0516a6e3dc..d0033f14f3 100644 --- a/libavcodec/bytestream.h +++ b/libavcodec/bytestream.h @@ -77,11 +77,15

[FFmpeg-devel] [PATCH 06/25] avcodec/magicyuv: Don't use GetBit API for byte-aligned reads

2020-09-26 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt --- libavcodec/magicyuv.c | 45 +-- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/libavcodec/magicyuv.c b/libavcodec/magicyuv.c index 6c29efc9f4..f7dfef0eb8 100644 --- a/libavcodec/magicyuv.c +++ b/libavco

Re: [FFmpeg-devel] [PATCH] avformat/aviobuf: fix broken logic in ffio_ensure_seekback()

2020-09-26 Thread Michael Niedermayer
On Sun, Sep 20, 2020 at 10:49:12AM +0200, Marton Balint wrote: [...] > fundamental problem is that ffio_ensure_seekback simply cannot be > implemented efficiently with the current design. The guarantees should be > reduced (e.g. ffio_ensure_seekback can flush the buffer and invalidate > previous f

[FFmpeg-devel] [PATCH 10/25] avcodec/magicyuv: Fix building Huffman table

2020-09-26 Thread Andreas Rheinhardt
The MagicYUV format stores Huffman tables in its bitstream by coding the length of a given symbol; it does not code the actual code directly, instead this is to be inferred by the rule that a symbol is to the left of every shorter symbol in the Huffman tree and that for symbols of the same length t

Re: [FFmpeg-devel] [PATCH 08/25] avcodec/magicyuv: Replace implicit checks for overread by explicit ones

2020-09-26 Thread Paul B Mahol
On Sat, Sep 26, 2020 at 12:27:47PM +0200, Andreas Rheinhardt wrote: > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/magicyuv.c | 49 --- > 1 file changed, 27 insertions(+), 22 deletions(-) > > diff --git a/libavcodec/magicyuv.c b/libavcodec/magicyuv

Re: [FFmpeg-devel] [PATCH 07/25] avcodec/magicyuv: Use const uint8_t* for pointer to immutable data

2020-09-26 Thread Paul B Mahol
On Sat, Sep 26, 2020 at 12:27:46PM +0200, Andreas Rheinhardt wrote: > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/magicyuv.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) lgtm > > diff --git a/libavcodec/magicyuv.c b/libavcodec/magicyuv.c > index f7dfef0eb8..3413d8f298 10064

Re: [FFmpeg-devel] [PATCH 05/25] avcodec/magicyuv: Check early for invalid slices

2020-09-26 Thread Paul B Mahol
On Sat, Sep 26, 2020 at 12:27:44PM +0200, Andreas Rheinhardt wrote: > Every plane of each slice has to contain at least two bytes for flags > and the type of prediction used. > > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/magicyuv.c | 2 ++ > 1 file changed, 2 insertions(+) lgtm > >

Re: [FFmpeg-devel] [PATCH 04/25] avcodec/diracdsp: Remove unused variable

2020-09-26 Thread Paul B Mahol
On Sat, Sep 26, 2020 at 12:27:43PM +0200, Andreas Rheinhardt wrote: > Forgotten in ca3c6c981aa5b0af8a5576020b79fdd3cdf9ae9e. > > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/diracdsp.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > lgtm > diff --git a/libavcodec/diracdsp.c

Re: [FFmpeg-devel] [PATCH 08/25] avcodec/magicyuv: Replace implicit checks for overread by explicit ones

2020-09-26 Thread Andreas Rheinhardt
Paul B Mahol: > On Sat, Sep 26, 2020 at 12:27:47PM +0200, Andreas Rheinhardt wrote: >> Signed-off-by: Andreas Rheinhardt >> --- >> libavcodec/magicyuv.c | 49 --- >> 1 file changed, 27 insertions(+), 22 deletions(-) >> >> diff --git a/libavcodec/magicyuv.c

Re: [FFmpeg-devel] [PATCH 03/25] avcodec/magicyuv: Improve overread check when parsing Huffman tables

2020-09-26 Thread Paul B Mahol
On Sat, Sep 26, 2020 at 12:27:42PM +0200, Andreas Rheinhardt wrote: > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/magicyuv.c | 7 ++- > 1 file changed, 6 insertions(+), 1 deletion(-) > lgtm > diff --git a/libavcodec/magicyuv.c b/libavcodec/magicyuv.c > index b56d3e9d32..d2f6a9b01e

Re: [FFmpeg-devel] [PATCH 24/25] avcodec/fraps: Use unchecked bitstream reader

2020-09-26 Thread Paul B Mahol
On Sat, Sep 26, 2020 at 12:28:03PM +0200, Andreas Rheinhardt wrote: > The fraps decoder already checked for overreads manually (and errored > out in this scenario), yet it still enabled implicit checks, leading to > worse performance and more code size. > > This commit disables the implicit bitstr

Re: [FFmpeg-devel] [PATCH 25/25] avcodec/fraps: Use cached bitstream reader

2020-09-26 Thread Paul B Mahol
On Sat, Sep 26, 2020 at 12:28:04PM +0200, Andreas Rheinhardt wrote: > This proved beneficial for performance: For the sample [1] the number > of decicycles in one decode call decreased from 155851561 to 108158037 > for Clang 10 and from 168270467 to 128847479 for GCC 9.3. For x86-32 > compiled with

Re: [FFmpeg-devel] [PATCH 2/3] avformat/aviobuf: fix checks in ffio_ensure_seekback

2020-09-26 Thread Marton Balint
On Sat, 26 Sep 2020, Michael Niedermayer wrote: On Sun, Sep 20, 2020 at 10:52:52AM +0200, Marton Balint wrote: Signed-off-by: Marton Balint --- libavformat/aviobuf.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) The commit message is too terse. It is not clear from it what

Re: [FFmpeg-devel] [PATCH 01/25] avcodec/photocd: Simplify parsing Huffman tables a bit

2020-09-26 Thread Paul B Mahol
On Sat, Sep 26, 2020 at 12:27:40PM +0200, Andreas Rheinhardt wrote: > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/photocd.c | 13 ++--- > 1 file changed, 6 insertions(+), 7 deletions(-) > should be ok if tested. > diff --git a/libavcodec/photocd.c b/libavcodec/photocd.c > inde

Re: [FFmpeg-devel] [PATCH 02/25] avcodec/bytestream: Add unchecked bytestream2 peek functions

2020-09-26 Thread Paul B Mahol
On Sat, Sep 26, 2020 at 12:27:41PM +0200, Andreas Rheinhardt wrote: > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/bytestream.h | 6 +- > 1 file changed, 5 insertions(+), 1 deletion(-) lgtm > > diff --git a/libavcodec/bytestream.h b/libavcodec/bytestream.h > index 0516a6e3dc..d0033

Re: [FFmpeg-devel] [PATCH 06/25] avcodec/magicyuv: Don't use GetBit API for byte-aligned reads

2020-09-26 Thread Paul B Mahol
On Sat, Sep 26, 2020 at 12:27:45PM +0200, Andreas Rheinhardt wrote: > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/magicyuv.c | 45 +-- > 1 file changed, 22 insertions(+), 23 deletions(-) lgtm > > diff --git a/libavcodec/magicyuv.c b/libavcodec/m

Re: [FFmpeg-devel] [PATCH] avformat/aviobuf: fix broken logic in ffio_ensure_seekback()

2020-09-26 Thread Michael Niedermayer
On Thu, Sep 17, 2020 at 12:31:06PM +0200, Paul B Mahol wrote: > This removes big CPU overhead for demuxing chained ogg streams. > > Signed-off-by: Paul B Mahol > --- > libavformat/aviobuf.c | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) I think we need some fate test for ffi

Re: [FFmpeg-devel] [PATCH 08/25] avcodec/magicyuv: Replace implicit checks for overread by explicit ones

2020-09-26 Thread Paul B Mahol
On Sat, Sep 26, 2020 at 12:43:17PM +0200, Andreas Rheinhardt wrote: > Paul B Mahol: > > On Sat, Sep 26, 2020 at 12:27:47PM +0200, Andreas Rheinhardt wrote: > >> Signed-off-by: Andreas Rheinhardt > >> --- > >> libavcodec/magicyuv.c | 49 --- > >> 1 file chan

Re: [FFmpeg-devel] [PATCH 10/25] avcodec/magicyuv: Fix building Huffman table

2020-09-26 Thread Paul B Mahol
On Sat, Sep 26, 2020 at 12:27:49PM +0200, Andreas Rheinhardt wrote: > The MagicYUV format stores Huffman tables in its bitstream by coding > the length of a given symbol; it does not code the actual code directly, > instead this is to be inferred by the rule that a symbol is to the left > of every

Re: [FFmpeg-devel] [PATCH 11/25] avcodec/magicyuv: Avoid AV_QSORT when creating Huffman table

2020-09-26 Thread Paul B Mahol
On Sat, Sep 26, 2020 at 12:27:50PM +0200, Andreas Rheinhardt wrote: > The MagicYUV format stores Huffman tables in its bitstream by coding > the length of a given symbol; it does not code the actual code directly, > instead this is to be inferred by the rule that a symbol is to the left > of every

Re: [FFmpeg-devel] [PATCH 14/25] avcodec/utvideodec: Remove code duplication when creating Huffman tables

2020-09-26 Thread Paul B Mahol
On Sat, Sep 26, 2020 at 12:27:53PM +0200, Andreas Rheinhardt wrote: > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/utvideodec.c | 55 + > 1 file changed, 6 insertions(+), 49 deletions(-) > lgtm > diff --git a/libavcodec/utvideodec.c b/libavcodec/

Re: [FFmpeg-devel] [PATCH 12/25] avcodec/magicyuv: Don't waste stack space

2020-09-26 Thread Paul B Mahol
On Sat, Sep 26, 2020 at 12:27:51PM +0200, Andreas Rheinhardt wrote: > Now that the HuffEntries are no longer sorted by the MagicYUV decoder, > their symbols are trivial: The symbol of the element with index i is i. > They can therefore be removed. Furthermore, despite the length of the > codes bein

Re: [FFmpeg-devel] [PATCH 15/25] avcodec/utvideodec: Avoid qsort when creating Huffman tables

2020-09-26 Thread Paul B Mahol
On Sat, Sep 26, 2020 at 12:27:54PM +0200, Andreas Rheinhardt wrote: > The Ut video format uses Huffman trees which are only implicitly coded > in the bitstream: Only the lengths of the codes are coded, the rest has > to be inferred by the decoder according to the rule that the longer > codes are to

Re: [FFmpeg-devel] [PATCH 01/25] avcodec/photocd: Simplify parsing Huffman tables a bit

2020-09-26 Thread Andreas Rheinhardt
Paul B Mahol: > On Sat, Sep 26, 2020 at 12:27:40PM +0200, Andreas Rheinhardt wrote: >> Signed-off-by: Andreas Rheinhardt >> --- >> libavcodec/photocd.c | 13 ++--- >> 1 file changed, 6 insertions(+), 7 deletions(-) >> > > should be ok if tested. > Tested with the (NSFW) files from http

Re: [FFmpeg-devel] [PATCH 16/25] avcodec/utvideo: Remove unused array

2020-09-26 Thread Paul B Mahol
On Sat, Sep 26, 2020 at 12:27:55PM +0200, Andreas Rheinhardt wrote: > Unused since 3594788b713e76449eda0bc9d64b38258c86a594. > > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/utvideo.c | 2 -- > 1 file changed, 2 deletions(-) > lgtm > diff --git a/libavcodec/utvideo.c b/libavcodec/utvi

Re: [FFmpeg-devel] [PATCH 17/25] avcodec/utvideo: Move stuff only used by Ut encoder to Ut encoder

2020-09-26 Thread Paul B Mahol
On Sat, Sep 26, 2020 at 12:27:56PM +0200, Andreas Rheinhardt wrote: > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/Makefile | 4 ++-- > libavcodec/utvideo.c| 39 --- > libavcodec/utvideo.h| 12 > libavcodec/utvideoenc.c | 23 ++

Re: [FFmpeg-devel] [PATCH 09/25] avcodec/magicyuv: Don't invert order unnecessarily

2020-09-26 Thread Paul B Mahol
On Sat, Sep 26, 2020 at 12:27:48PM +0200, Andreas Rheinhardt wrote: > The MagicYUV decoder currently sets both the length and the symbol field > of an array of HuffEntries; hereby the symbol of the ith entry (0-based) > is just i. Then said array gets sorted so that entries with greater > length ar

Re: [FFmpeg-devel] [PATCH 18/25] avcodec/utils: Only call codec->close if init has been called

2020-09-26 Thread Paul B Mahol
On Sat, Sep 26, 2020 at 12:27:57PM +0200, Andreas Rheinhardt wrote: > avcodec_open2() also called the AVCodec's close function if an error > happened before init had ever been called if the AVCodec has the > FF_CODEC_CAP_INIT_CLEANUP flag set. This is against the documentation of > said flag: "The

Re: [FFmpeg-devel] [PATCH] avformat/aviobuf: fix broken logic in ffio_ensure_seekback()

2020-09-26 Thread Paul B Mahol
On Sat, Sep 26, 2020 at 12:50:34PM +0200, Michael Niedermayer wrote: > On Thu, Sep 17, 2020 at 12:31:06PM +0200, Paul B Mahol wrote: > > This removes big CPU overhead for demuxing chained ogg streams. > > > > Signed-off-by: Paul B Mahol > > --- > > libavformat/aviobuf.c | 10 +- > > 1 fi

Re: [FFmpeg-devel] [PATCH 10/25] avcodec/magicyuv: Fix building Huffman table

2020-09-26 Thread Andreas Rheinhardt
Paul B Mahol: > On Sat, Sep 26, 2020 at 12:27:49PM +0200, Andreas Rheinhardt wrote: >> The MagicYUV format stores Huffman tables in its bitstream by coding >> the length of a given symbol; it does not code the actual code directly, >> instead this is to be inferred by the rule that a symbol is to t

Re: [FFmpeg-devel] [PATCH 1/4] avcodec/svq3: dont crash on free_picture(NULL)

2020-09-26 Thread Andreas Rheinhardt
Andreas Rheinhardt: > Andreas Rheinhardt: >> Michael Niedermayer: >>> Fixes: NULL dereference >>> Fixes: >>> 25762/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SVQ3_fuzzer-5716279070294016 >>> >>> Found-by: continuous fuzzing process >>> https://github.com/google/oss-fuzz/tree/master/project

[FFmpeg-devel] Question about HEIF/HEIC support

2020-09-26 Thread Tom Needham
Hello I have spent some time researching the possibility of adding demuxing and muxing support for the HEIF image format into FFmpeg when I came across this GSOC project from last year. https://summerofcode.withgoogle.com/archive/2019/projects/5632663078043648/. Although it appears the resulting w

Re: [FFmpeg-devel] [PATCH 2/3] avformat/aviobuf: fix checks in ffio_ensure_seekback

2020-09-26 Thread Michael Niedermayer
On Sat, Sep 26, 2020 at 12:46:40PM +0200, Marton Balint wrote: > > > On Sat, 26 Sep 2020, Michael Niedermayer wrote: > > > On Sun, Sep 20, 2020 at 10:52:52AM +0200, Marton Balint wrote: > > > Signed-off-by: Marton Balint > > > --- > > > libavformat/aviobuf.c | 7 +-- > > > 1 file changed,

Re: [FFmpeg-devel] [PATCH] avcodec/av1dec: check avctx->hwaccel when hwaccel pix_fmt selected

2020-09-26 Thread James Almer
On 9/25/2020 4:35 AM, Xiang, Haihao wrote: > On Fri, 2020-09-25 at 06:10 +, Wang, Fei W wrote: >>> -Original Message- >>> From: ffmpeg-devel On Behalf Of Wang, >>> Fei W >>> Sent: Tuesday, September 22, 2020 11:22 AM >>> To: FFmpeg development discussions and patches >>> Subject: Re:

Re: [FFmpeg-devel] [PATCH 1/2] avformat/utils: remove always true if()

2020-09-26 Thread Zhao Zhili
Ping for the patch set. > On Aug 25, 2020, at 1:16 AM, Zhao Zhili wrote: > > Ping again. > >> On Aug 5, 2020, at 11:16 PM, Zhao Zhili wrote: >> >> Ping for the trivial patch. >> >>> On Jul 29, 2020, at 1:02 AM, Zhao Zhili wrote: >>> >>> --- >>> libavformat/utils.c | 12 >>> 1 f

Re: [FFmpeg-devel] [PATCH] avformat/http: set hostname and lower_url buffer size properly

2020-09-26 Thread Zhao Zhili
Ping for review, thanks. > On Aug 24, 2020, at 11:10 PM, Zhao Zhili wrote: > > 1. The buffer size of lower_url shouldn't be smaller than hostname > 2. The maximum length of a DNS name is 255 octets > --- > libavformat/http.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --

Re: [FFmpeg-devel] [PATCH v2 1/2] avformat/rtsp: fix infinite loop with udp transport

2020-09-26 Thread Zhao Zhili
Ping for review, thanks. > On Sep 9, 2020, at 12:10 AM, Zhao Zhili wrote: > > sender: > ./ffmpeg -i test.mp4 -c copy -f rtsp -rtsp_transport udp > rtsp://localhost:12345/live.sdp > > receiver: > ./ffmpeg_g -y -rtsp_flags listen -timeout 100 -i > rtsp://localhost:12345/live.sdp -c copy test.m

Re: [FFmpeg-devel] [PATCH 1/2] avcodec/videotoolboxenc: fix align issue

2020-09-26 Thread Zhao Zhili
Ping for the patch set. > On Aug 27, 2020, at 5:38 AM, quinkbl...@foxmail.com wrote: > > From: Zhao Zhili > > bool a53_cc is accessed as int: > src/libavutil/opt.c:129:9: runtime error: store to misaligned > address 0x7fbf454121a3 for type 'int', which requires 4 byte alignment > --- > libavcod

Re: [FFmpeg-devel] [PATCH] avfilter/vf_delogo: remove duplicated code

2020-09-26 Thread Zhao Zhili
Ping. > On Sep 16, 2020, at 1:09 PM, quinkbl...@foxmail.com wrote: > > From: Zhao Zhili > > 1. Remove the modification of x, y, w and h parameters since they > are reset by filter_frame. > 2. config_input leads to error out when logo area is outside of the > frame, while filter_frame fix th

Re: [FFmpeg-devel] [PATCH] avformat/http: ensure reply code in the range of 100..599

2020-09-26 Thread Zhao Zhili
Ping for review, thanks. > On Sep 1, 2020, at 12:34 PM, quinkbl...@foxmail.com wrote: > > From: Zhao Zhili > > --- > libavformat/http.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/libavformat/http.c b/libavformat/http.c > index 6c39da1a8b..b77bdf1567 100644 > --- a/

Re: [FFmpeg-devel] [PATCH 2/3] avformat/aviobuf: fix checks in ffio_ensure_seekback

2020-09-26 Thread Marton Balint
On Sat, 26 Sep 2020, Michael Niedermayer wrote: On Sat, Sep 26, 2020 at 12:46:40PM +0200, Marton Balint wrote: On Sat, 26 Sep 2020, Michael Niedermayer wrote: On Sun, Sep 20, 2020 at 10:52:52AM +0200, Marton Balint wrote: Signed-off-by: Marton Balint --- libavformat/aviobuf.c | 7 +

Re: [FFmpeg-devel] [PATCH 1/6] avcodec/dxtory: Fix get_raw_size() for YUV

2020-09-26 Thread Michael Niedermayer
On Sat, Sep 26, 2020 at 09:39:45AM +0200, Paul B Mahol wrote: > On Sat, Sep 26, 2020 at 12:26:33AM +0200, Michael Niedermayer wrote: > > Fixes: out of array read > > Fixes: > > 25455/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXTORY_fuzzer-6327985731534848 > > > > Found-by: continuous fuzz

Re: [FFmpeg-devel] [PATCH 2/6] avcodec/dxtory: Fix negative shift in dxtory_decode_v1_410()

2020-09-26 Thread Michael Niedermayer
On Sat, Sep 26, 2020 at 09:40:23AM +0200, Paul B Mahol wrote: > On Sat, Sep 26, 2020 at 12:26:34AM +0200, Michael Niedermayer wrote: > > Fixes: left shift of negative value -256 > > Fixes: > > 25460/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXTORY_fuzzer-5073252341514240 > > > > Found-by:

Re: [FFmpeg-devel] [PATCH 3/6] avcodec/dxtory: Fix negative shift in dx2_decode_slice_410()

2020-09-26 Thread Michael Niedermayer
On Sat, Sep 26, 2020 at 09:40:43AM +0200, Paul B Mahol wrote: > On Sat, Sep 26, 2020 at 12:26:35AM +0200, Michael Niedermayer wrote: > > Fixes: left shift of negative value -768 > > Fixes: > > 25574/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXTORY_fuzzer-6012596027916288 > > > > Found-by:

Re: [FFmpeg-devel] [PATCH] avfilter/vf_delogo: remove duplicated code

2020-09-26 Thread Paul B Mahol
On Sun, Sep 27, 2020 at 12:38:57AM +0800, Zhao Zhili wrote: > Ping. > > > On Sep 16, 2020, at 1:09 PM, quinkbl...@foxmail.com wrote: > > > > From: Zhao Zhili > > > > 1. Remove the modification of x, y, w and h parameters since they > > are reset by filter_frame. > > 2. config_input leads to e

Re: [FFmpeg-devel] [PATCH v2 1/2] avformat/rtsp: fix infinite loop with udp transport

2020-09-26 Thread Andriy Gelman
On Sun, 27. Sep 00:31, Zhao Zhili wrote: > Ping for review, thanks. > > > On Sep 9, 2020, at 12:10 AM, Zhao Zhili wrote: > > > > sender: > > ./ffmpeg -i test.mp4 -c copy -f rtsp -rtsp_transport udp > > rtsp://localhost:12345/live.sdp > > > > receiver: > > ./ffmpeg_g -y -rtsp_flags listen -tim

[FFmpeg-devel] [PATCH 1/2] avformat/rtspdec: add newline in log message

2020-09-26 Thread Andriy Gelman
From: Andriy Gelman Signed-off-by: Andriy Gelman --- libavformat/rtspdec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c index dfa29913bf..ef084a8b2b 100644 --- a/libavformat/rtspdec.c +++ b/libavformat/rtspdec.c @@ -291,7

[FFmpeg-devel] [PATCH 2/2] avformat/rtsp: allocate correct max number of pollfds

2020-09-26 Thread Andriy Gelman
From: Andriy Gelman There is one general rtsp connection plus two connections per stream (rtp/rtcp). Signed-off-by: Andriy Gelman --- libavformat/rtsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 5d8491b74b..90f912feb9 1006

Re: [FFmpeg-devel] [PATCH 2/2] libswcale/input: fix incorrect rgbf32 yuv conversions

2020-09-26 Thread Mark Reid
On Mon, Sep 14, 2020 at 6:31 PM Mark Reid wrote: > > > On Mon, Sep 14, 2020 at 2:44 PM Michael Niedermayer > wrote: > >> On Sun, Sep 13, 2020 at 04:04:42PM -0700, Mark Reid wrote: >> > On Sun, Sep 13, 2020 at 8:55 AM Michael Niedermayer >> >> > wrote: >> > >> > > On Sat, Sep 12, 2020 at 02:07:1