[FFmpeg-devel] ION MP4 causing issues

2020-10-18 Thread Matthias Opitz

Experts,

I am capturing mp4 files since several years with an ION SPEED PRO 
without any issues. I did not use the camera a while. Today I realized 
that either W10 (tested different laptops) and even Linux ins not able 
to play these files any more. Old ION files ( same device) still do work 
properly on W10 and Linux.


ffprobe does return :

###

h264 @ 0x55aa501f22e0] Invalid NAL unit size (2011631728 > 19056).

[h264 @ 0x55aa501f22e0] Error splitting the input into NAL units.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55aa501f1080] decoding for stream 0 failed
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55aa501f1080] Could not find codec 
parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none, 
1280x720, 10335 kb/s): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' 
options

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'IONX0070.MP4':
  Metadata:
    major_brand : avc1
    minor_version   : 0
    compatible_brands: avc1isom
    creation_time   : 2020-10-13T21:07:17.00Z
  Duration: 00:00:06.06, start: 0.00, bitrate: 10468 kb/s
    Stream #0:0(eng): Video: h264 (avc1 / 0x31637661), none, 1280x720, 
10335 kb/s, 59.94 fps, 59.94 tbr, 90k tbn, 180k tbc (default)

    Metadata:
  creation_time   : 2020-10-13T21:07:17.00Z
  handler_name    :  Ambarella AVC
  encoder : Ambarella AVC encoder
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 
stereo, fltp, 127 kb/s (default)

    Metadata:
  creation_time   : 2020-10-13T21:07:17.00Z
  handler_name    :  Ambarella AAC

##

fplay does return :

##
[aac @ 0x7f5ab402eac0] invalid band type
[aac @ 0x7f5ab402eac0] Sample rate index in program config element does 
not match the sample rate index configured by the container.
[aac @ 0x7f5ab402eac0] Too large remapped id is not implemented. Update 
your FFmpeg version to the newest one from Git. If the problem still 
occurs, it means that your file has a feature which has not been 
implemented.
[aac @ 0x7f5ab402eac0] If you want to help, upload a sample of this file 
to ftp://upload.ffmpeg.org/incoming/ and contact the ffmpeg-devel 
mailing list. (ffmpeg-devel@ffmpeg.org)

###

Any idea what causing this ?

I am not an ffmepg, play, probe expert. I used these packages to analyze 
the problem.


My impression is the files are corrupted. On the other hand the Ion 
still does take still images. I also tried HD and FHD, no difference.


Any idea, hint is appreciated :


Kind Regards

Matthias




___
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 "unsubscribe".

[FFmpeg-devel] [PATCH] avfilter: add frequency and phase shift filters

2020-10-18 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
Now with better output quality.
---
 doc/filters.texi|  30 +++
 libavfilter/Makefile|   2 +
 libavfilter/af_afreqshift.c | 379 
 libavfilter/allfilters.c|   2 +
 4 files changed, 413 insertions(+)
 create mode 100644 libavfilter/af_afreqshift.c

diff --git a/doc/filters.texi b/doc/filters.texi
index 037a37be23..34207ed0b6 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -1314,6 +1314,21 @@ Force the output to either unsigned 8-bit or signed 
16-bit stereo
 aformat=sample_fmts=u8|s16:channel_layouts=stereo
 @end example
 
+@section afreqshift
+Apply frequency shift to input audio samples.
+
+The filter accepts the following options:
+
+@table @option
+@item shift
+Specify frequency shift. Allowed range is -INT_MAX to INT_MAX.
+Default value is 0.0.
+@end table
+
+@subsection Commands
+
+This filter supports the above option as @ref{commands}.
+
 @section agate
 
 A gate is mainly used to reduce lower parts of a signal. This kind of signal
@@ -2064,6 +2079,21 @@ It accepts the following values:
 @end table
 @end table
 
+@section aphaseshift
+Apply phase shift to input audio samples.
+
+The filter accepts the following options:
+
+@table @option
+@item shift
+Specify phase shift. Allowed range is from -1.0 to 1.0.
+Default value is 0.0.
+@end table
+
+@subsection Commands
+
+This filter supports the above option as @ref{commands}.
+
 @section apulsator
 
 Audio pulsator is something between an autopanner and a tremolo.
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 2691612179..480e191987 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -50,6 +50,7 @@ OBJS-$(CONFIG_AFFTDN_FILTER) += af_afftdn.o
 OBJS-$(CONFIG_AFFTFILT_FILTER)   += af_afftfilt.o
 OBJS-$(CONFIG_AFIR_FILTER)   += af_afir.o
 OBJS-$(CONFIG_AFORMAT_FILTER)+= af_aformat.o
+OBJS-$(CONFIG_AFREQSHIFT_FILTER) += af_afreqshift.o
 OBJS-$(CONFIG_AGATE_FILTER)  += af_agate.o
 OBJS-$(CONFIG_AIIR_FILTER)   += af_aiir.o
 OBJS-$(CONFIG_AINTEGRAL_FILTER)  += af_aderivative.o
@@ -69,6 +70,7 @@ OBJS-$(CONFIG_ANULL_FILTER)  += af_anull.o
 OBJS-$(CONFIG_APAD_FILTER)   += af_apad.o
 OBJS-$(CONFIG_APERMS_FILTER) += f_perms.o
 OBJS-$(CONFIG_APHASER_FILTER)+= af_aphaser.o 
generate_wave_table.o
+OBJS-$(CONFIG_APHASESHIFT_FILTER)+= af_afreqshift.o
 OBJS-$(CONFIG_APULSATOR_FILTER)  += af_apulsator.o
 OBJS-$(CONFIG_AREALTIME_FILTER)  += f_realtime.o
 OBJS-$(CONFIG_ARESAMPLE_FILTER)  += af_aresample.o
diff --git a/libavfilter/af_afreqshift.c b/libavfilter/af_afreqshift.c
new file mode 100644
index 00..e83575813d
--- /dev/null
+++ b/libavfilter/af_afreqshift.c
@@ -0,0 +1,379 @@
+/*
+ * Copyright (c) Paul B Mahol
+ * Copyright (c) Laurent de Soras, 2005
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/channel_layout.h"
+#include "libavutil/ffmath.h"
+#include "libavutil/opt.h"
+#include "avfilter.h"
+#include "audio.h"
+#include "formats.h"
+
+#define NB_COEFS 16
+
+typedef struct AFreqShift {
+const AVClass *class;
+
+double shift;
+
+double c[NB_COEFS];
+
+int64_t in_samples;
+
+AVFrame *i1, *o1;
+AVFrame *i2, *o2;
+
+void (*filter_channel)(AVFilterContext *ctx,
+   int nb_samples,
+   int sample_rate,
+   const double *src, double *dst,
+   double *i1, double *o1,
+   double *i2, double *o2);
+} AFreqShift;
+
+static int query_formats(AVFilterContext *ctx)
+{
+AVFilterFormats *formats = NULL;
+AVFilterChannelLayouts *layouts = NULL;
+static const enum AVSampleFormat sample_fmts[] = {
+AV_SAMPLE_FMT_DBLP,
+AV_SAMPLE_FMT_NONE
+};
+int ret;
+
+formats = ff_make_format_list(sample_fmts);
+if (!formats)
+return AVERROR(ENOMEM);
+ret = ff_set_common_formats(ctx, formats);
+if (ret < 0)
+return ret;
+
+layouts = ff_all_channel_counts();
+if (!layouts)
+

Re: [FFmpeg-devel] [PATCH 4/4] avcodec/photocd: Use ff_set_dimensions()

2020-10-18 Thread Michael Niedermayer
On Sat, Oct 10, 2020 at 01:00:14PM +0200, Michael Niedermayer wrote:
> On Mon, Sep 21, 2020 at 12:28:37AM +0200, Paul B Mahol wrote:
> > On Sun, Sep 20, 2020 at 10:26:08PM +0200, Michael Niedermayer wrote:
> > > Fixes: out of memory
> > > Fixes: 
> > > 25588/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PHOTOCD_fuzzer-6612945080156160
> > > 
> > > Found-by: continuous fuzzing process 
> > > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > > Signed-off-by: Michael Niedermayer 
> > > ---
> > >  libavcodec/photocd.c | 5 +++--
> > >  1 file changed, 3 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/libavcodec/photocd.c b/libavcodec/photocd.c
> > > index 057c9d33d4..07f10e28b7 100644
> > > --- a/libavcodec/photocd.c
> > > +++ b/libavcodec/photocd.c
> > > @@ -324,8 +324,9 @@ static int photocd_decode_frame(AVCodecContext 
> > > *avctx, void *data,
> > >  else
> > >  s->resolution = av_clip(4 - s->lowres, 0, 4);
> > >  
> > > -avctx->width  = img_info[s->resolution].width;
> > > -avctx->height = img_info[s->resolution].height;
> > > +ret = ff_set_dimensions(avctx, img_info[s->resolution].width, 
> > > img_info[s->resolution].height);
> > > +if (ret < 0)
> > > +return ret;
> > >  
> > >  if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
> > >  return ret;
> > 
> > Why is this needed at all, dimensions are alway static and completely 
> > allocable.
> 
> ff_set_dimensions() sets more than width and height, for example 
> it also sets coded_width and coded_height. And it checks dimension validity 
> and
> compliance to the users requirements.
> There are multiple things here the previous code failed to do and which could
> cause problems.
> 
> I would suggest to simply always use ff_set_dimensions().

will apply patch


[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The smallest minority on earth is the individual. Those who deny 
individual rights cannot claim to be defenders of minorities. - Ayn Rand


signature.asc
Description: PGP signature
___
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 "unsubscribe".

Re: [FFmpeg-devel] [PATCH 2/2] avformat/rmdec: sanity check coded_framesize

2020-10-18 Thread Michael Niedermayer
On Sun, Aug 16, 2020 at 08:04:09PM +0200, Michael Niedermayer wrote:
> Fixes: signed integer overflow: -14671840 * 8224 cannot be represented in 
> type 'int'
> Fixes: 
> 24793/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5101884323659776
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavformat/rmdec.c | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)

will apply

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

"I am not trying to be anyone's saviour, I'm trying to think about the
 future and not be sad" - Elon Musk



signature.asc
Description: PGP signature
___
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 "unsubscribe".

Re: [FFmpeg-devel] [PATCH] avformat/ape: Remove seektable and bittable

2020-10-18 Thread Michael Niedermayer
On Sat, Jul 25, 2020 at 08:02:40PM +0200, Michael Niedermayer wrote:
> Suggested-by: Andreas
> Signed-off-by: Michael Niedermayer 
> ---
>  libavformat/ape.c | 75 ---
>  1 file changed, 25 insertions(+), 50 deletions(-)

will apply

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact


signature.asc
Description: PGP signature
___
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 "unsubscribe".

Re: [FFmpeg-devel] [PATCH] avcodec/mpeg12dec: Limit maximum A53 CC size

2020-10-18 Thread Michael Niedermayer
On Tue, Sep 22, 2020 at 10:33:14AM +0200, Michael Niedermayer wrote:
> This is more than 10 times the size of the largest i found. And also alot more
> than our encoder could handle (our encoder is limited to max 31)
> Without any limit megabyte+ sized blocks can be reallocated millions of times.
> Sadly the SCTE-20 spec does not seem to contain any hard limit directly, so 
> this limit here
> is arbitrary
> 
> Fixes: Timeout (25sec -> 152ms)
> Fixes: 
> 25714/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG2VIDEO_fuzzer-571366885248
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/mpeg12dec.c | 8 +---
>  1 file changed, 5 insertions(+), 3 deletions(-)

will apply

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact


signature.asc
Description: PGP signature
___
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 "unsubscribe".

Re: [FFmpeg-devel] [PATCH 4/6] tools/target_dec_fuzzer: Correct maxsamples_per_frame if maxsamples has been changed

2020-10-18 Thread Michael Niedermayer
On Sat, Sep 26, 2020 at 12:26:36AM +0200, Michael Niedermayer wrote:
> Signed-off-by: Michael Niedermayer 
> ---
>  tools/target_dec_fuzzer.c | 1 +
>  1 file changed, 1 insertion(+)

will apply

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.


signature.asc
Description: PGP signature
___
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 "unsubscribe".

Re: [FFmpeg-devel] [PATCH 5/6] tools/target_dec_fuzzer: assume that discarded audio packets produced max samples

2020-10-18 Thread Michael Niedermayer
On Sat, Sep 26, 2020 at 12:26:37AM +0200, Michael Niedermayer wrote:
> We do not know how many samples these produce as its not exported.
> Alternatively we could export that but as long as its not we better
> assume its more than 0 as otherwise the thresholds would not work
> 
> Signed-off-by: Michael Niedermayer 
> ---
>  tools/target_dec_fuzzer.c | 5 +
>  1 file changed, 5 insertions(+)

will apply

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Nations do behave wisely once they have exhausted all other alternatives. 
-- Abba Eban


signature.asc
Description: PGP signature
___
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 "unsubscribe".

Re: [FFmpeg-devel] [PATCH 6/6] avcodec/decode: Consider discarded samples in max_samples

2020-10-18 Thread Michael Niedermayer
On Sat, Sep 26, 2020 at 12:26:38AM +0200, Michael Niedermayer wrote:
> Fixes: Timeout (several minutes -> 3 sec)
> Fixes: 
> 25246/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5943400661254144
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/decode.c | 11 +--
>  1 file changed, 9 insertions(+), 2 deletions(-)

will apply

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No great genius has ever existed without some touch of madness. -- Aristotle


signature.asc
Description: PGP signature
___
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 "unsubscribe".

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/h264_slice: fix undefined integer overflow with POC in error concealment

2020-10-18 Thread Michael Niedermayer
On Thu, Oct 08, 2020 at 09:19:13PM +0200, Michael Niedermayer wrote:
> Alternatively the POC could be changed to 64bit. the large values seem to be 
> within what is allowed.
> 
> Fixes: signed integer overflow: 2147483646 + 2 cannot be represented in type 
> 'int'
> Fixes: 
> 26076/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-5711127201447936
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/h264_slice.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire


signature.asc
Description: PGP signature
___
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 "unsubscribe".

Re: [FFmpeg-devel] [PATCH 2/2] avformat/kvag: Fix integer overflow in bitrate computation

2020-10-18 Thread Michael Niedermayer
On Sat, Oct 10, 2020 at 05:41:27PM +0200, Michael Niedermayer wrote:
> Fixes: signed integer overflow: 1077952576 * 4 cannot be represented in type 
> 'int'
> Fixes: 
> 26152/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5674758518341632
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavformat/kvag.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have often repented speaking, but never of holding my tongue.
-- Xenocrates


signature.asc
Description: PGP signature
___
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 "unsubscribe".

Re: [FFmpeg-devel] [PATCH] avcodec/aacdec_fixed: Limit index in vector_pow43()

2020-10-18 Thread Michael Niedermayer
On Mon, Oct 12, 2020 at 05:54:27PM +0200, Michael Niedermayer wrote:
> Fixes: out of array access
> Fixes: 
> 26087/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-5724825462767616
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/aacdec_fixed.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

will apply

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Modern terrorism, a quick summary: Need oil, start war with country that
has oil, kill hundread thousand in war. Let country fall into chaos,
be surprised about raise of fundamantalists. Drop more bombs, kill more
people, be surprised about them taking revenge and drop even more bombs
and strip your own citizens of their rights and freedoms. to be continued


signature.asc
Description: PGP signature
___
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 "unsubscribe".

Re: [FFmpeg-devel] ION MP4 causing issues

2020-10-18 Thread Carl Eugen Hoyos
Am So., 18. Okt. 2020 um 16:38 Uhr schrieb Matthias Opitz
:

> I am capturing mp4 files since several years with an ION SPEED PRO
> without any issues. I did not use the camera a while. Today I realized
> that either W10 (tested different laptops) and even Linux ins not able
> to play these files any more.

Please post on the user mailing list, test current FFmpeg git head and
provide the command line you tested together with the complete,
uncut console output.

Carl Eugen
___
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 "unsubscribe".

Re: [FFmpeg-devel] [PATCH v1] libavformat/hls: During operation, the user exits and interrupts, causing pls->segment to be released, resulting in a null pointer crash

2020-10-18 Thread 徐慧书
Steven Liu  于2020年10月17日周六 下午4:57写道:

>
>
> > 在 2020年10月17日,13:38,徐慧书  写道:
> >
> > Andreas Rheinhardt  于2020年10月16日周五
> 下午9:32写道:
> >
> >> javashu2...@gmail.com:
> >>> From: bevis 
> >>>
> >>> Signed-off-by: bevis 
> >>> ---
> >>> libavformat/hls.c | 5 +++--
> >>> 1 file changed, 3 insertions(+), 2 deletions(-)
> >>>
> >>> diff --git a/libavformat/hls.c b/libavformat/hls.c
> >>> index 72e28ab94f..0a522a4595 100644
> >>> --- a/libavformat/hls.c
> >>> +++ b/libavformat/hls.c
> >>> @@ -1979,17 +1979,18 @@ static int hls_read_header(AVFormatContext *s)
> >>> pls->ctx->interrupt_callback = s->interrupt_callback;
> >>> url = av_strdup(pls->segments[0]->url);
> >>> ret = av_probe_input_buffer(&pls->pb, &in_fmt, url, NULL, 0,
> 0);
> >>> -av_free(url);
> >>> if (ret < 0) {
> >>> /* Free the ctx - it isn't initialized properly at this
> >> point,
> >>>  * so avformat_close_input shouldn't be called. If
> >>>  * avformat_open_input fails below, it frees and zeros the
> >>>  * context, so it doesn't need any special treatment like
> >> this. */
> >>> -av_log(s, AV_LOG_ERROR, "Error when loading first segment
> >> '%s'\n", pls->segments[0]->url);
> >>> +av_log(s, AV_LOG_ERROR, "Error when loading first segment
> >> '%s'\n", url);
> >>> avformat_free_context(pls->ctx);
> >>> pls->ctx = NULL;
> >>> +av_free(url);
> >>> goto fail;
> >>> }
> >>> +av_free(url);
> >>> pls->ctx->pb   = &pls->pb;
> >>> pls->ctx->io_open  = nested_io_open;
> >>> pls->ctx->flags   |= s->flags & ~AVFMT_FLAG_CUSTOM_IO;
> >>>
> >> The change itself seems fine to me (I wonder why this hasn't been
> >> noticed when writing/reviewing b5e39880fb), but your commit message is
> >> way too long: The first line should be a short description followed by a
> >> more detailed description lateron (in the next lines).
> >>
> >> How exactly did you find this?
> >>
> >> - Andreas
> >>
> >
> > It was found in the crash logs of online users, and it was also simulated
> > locally. In China, we have a very large number of users, and the hls
> > protocol is widely used, with hundreds of millions of views every day,
> and
> > every small problem becomes more obvious.
> maybe more than 1.5 billions right now. :D
>
> Thanks
> Steven
>
> ___
> 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 "unsubscribe".


haha,I mean the number of users of our app, not the number of Chinese~~
___
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 "unsubscribe".

[FFmpeg-devel] [PATCH v2] libavformat/hls: use local var url for log to avoid crash

2020-10-18 Thread javashu2012
From: bevis 

During operation, the user exits and interrupts, causing pls->segment to be 
released, resulting in a null pointer crash

Signed-off-by: bevis 
---
 libavformat/hls.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavformat/hls.c b/libavformat/hls.c
index 72e28ab94f..0a522a4595 100644
--- a/libavformat/hls.c
+++ b/libavformat/hls.c
@@ -1979,17 +1979,18 @@ static int hls_read_header(AVFormatContext *s)
 pls->ctx->interrupt_callback = s->interrupt_callback;
 url = av_strdup(pls->segments[0]->url);
 ret = av_probe_input_buffer(&pls->pb, &in_fmt, url, NULL, 0, 0);
-av_free(url);
 if (ret < 0) {
 /* Free the ctx - it isn't initialized properly at this point,
  * so avformat_close_input shouldn't be called. If
  * avformat_open_input fails below, it frees and zeros the
  * context, so it doesn't need any special treatment like this. */
-av_log(s, AV_LOG_ERROR, "Error when loading first segment '%s'\n", 
pls->segments[0]->url);
+av_log(s, AV_LOG_ERROR, "Error when loading first segment '%s'\n", 
url);
 avformat_free_context(pls->ctx);
 pls->ctx = NULL;
+av_free(url);
 goto fail;
 }
+av_free(url);
 pls->ctx->pb   = &pls->pb;
 pls->ctx->io_open  = nested_io_open;
 pls->ctx->flags   |= s->flags & ~AVFMT_FLAG_CUSTOM_IO;
-- 
2.21.1 (Apple Git-122.3)

___
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 "unsubscribe".

[FFmpeg-devel] [PATCH 1/1] libavformat/mov: Add bound checks to avoid integer overflow and invalid memory allocation

2020-10-18 Thread Xiaohui Zhang
From: Zhang Xiaohui 

Hi, I think function mov_read_cmov fails to perform proper bounds
checking on atom.size and cmov_len, which may lead to integer
overflow and invalid memory allocation.

Signed-off-by: Zhang Xiaohui 
---
 libavformat/mov.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 7fd43a8fc5..245c720e42 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -5181,8 +5181,12 @@ static int mov_read_cmov(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 if (avio_rl32(pb) != MKTAG('c','m','v','d'))
 return AVERROR_INVALIDDATA;
 moov_len = avio_rb32(pb); /* uncompressed size */
+if (atom.size > LONG_MAX + 6 * 4)
+return AVERROR_INVALIDDATA;
 cmov_len = atom.size - 6 * 4;
 
+if (cmov_len <= 0)
+return AVERROR_INVALIDDATA;
 cmov_data = av_malloc(cmov_len);
 if (!cmov_data)
 return AVERROR(ENOMEM);
-- 
2.17.1

___
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 "unsubscribe".

Re: [FFmpeg-devel] [PATCH] libavformat/hls: add support for SAMPLE-AES decryption in HLS demuxer

2020-10-18 Thread Steven Liu
Nachiket Tarate  于2020年10月18日周日 上午8:07写道:
>
> ___
> From: ffmpeg-devel  on behalf of Michael 
> Niedermayer 
> Sent: Thursday, October 15, 2020 11:35 PM
> To: FFmpeg development discussions and patches
> Subject: Re: [FFmpeg-devel] [PATCH] libavformat/hls: add support for 
> SAMPLE-AES decryption in HLS demuxer
>
> On Thu, Oct 15, 2020 at 10:15:13PM +0530, Nachiket Tarate wrote:
> > Apple HTTP Live Streaming Sample Encryption:
> >
> > https://developer.apple.com/library/ios/documentation/AudioVideo/Conceptual/HLS_Sample_Encryption
> >
> > Signed-off-by: Nachiket Tarate 
> > ---
> >  libavformat/Makefile |   2 +-
> >  libavformat/hls.c|  93 ++-
> >  libavformat/hls_sample_aes.c | 497 +++
> >  libavformat/hls_sample_aes.h |  64 +
> >  libavformat/mpegts.c |  15 ++
> >  5 files changed, 657 insertions(+), 14 deletions(-)
> >  create mode 100644 libavformat/hls_sample_aes.c
> >  create mode 100644 libavformat/hls_sample_aes.h
>
> This seems to break fate (segfault)
> I guess patchwork will notice it too but as i already tested and noticed ...
>
> --- ./tests/ref/fate/segment-mp4-to-ts  2020-10-10 18:08:06.500253003 +0200
> +++ tests/data/fate/segment-mp4-to-ts   2020-10-15 20:03:24.586303460 +0200
> @@ -128,5 +128,3 @@
>  0, 428400, 435600, 3600,  156, 0xd2c3406c, F=0x0, S=1,   
>  1, 0x00e000e0
>  0, 432000, 439200, 3600,  330, 0x150d9b60, F=0x0, S=1,   
>  1, 0x00e000e0
>  0, 435600, 446400, 3600,  324, 0x558194ee, F=0x0, S=1,   
>  1, 0x00e000e0
> -0, 439200, 442800, 3600,  191, 0x108e54d1, F=0x0, S=1,   
>  1, 0x00e000e0
> -0, 442800, 45, 3600,  233, 0xac5b6486, F=0x0
> Test segment-mp4-to-ts failed. Look at tests/data/fate/segment-mp4-to-ts.err 
> for details.
> tests/Makefile:255: recipe for target 'fate-segment-mp4-to-ts' failed
> make: *** [fate-segment-mp4-to-ts] Error 139
>
>
> I ran FATE with samples again but I didn't get segfault. Can you please help 
> me to reproduce it ?

https://patchwork.ffmpeg.org/project/ffmpeg/patch/sg2pr01mb269339627c977c841e26b05df2...@sg2pr01mb2693.apcprd01.prod.exchangelabs.com/
fate failed message here.

TESTsegment-mp4-to-ts
--- 
/Users/liuqi/multimedia/upstream_ffmpeg/ffmpeg/tests/ref/fate/segment-mp4-to-ts
2020-10-19 09:24:15.0 +0800
+++ tests/data/fate/segment-mp4-to-ts 2020-10-19 10:09:43.0 +0800
@@ -128,5 +128,3 @@
 0, 428400, 435600, 3600,  156, 0xd2c3406c, F=0x0,
S=1,1, 0x00e000e0
 0, 432000, 439200, 3600,  330, 0x150d9b60, F=0x0,
S=1,1, 0x00e000e0
 0, 435600, 446400, 3600,  324, 0x558194ee, F=0x0,
S=1,1, 0x00e000e0
-0, 439200, 442800, 3600,  191, 0x108e54d1, F=0x0,
S=1,1, 0x00e000e0
-0, 442800, 45, 3600,  233, 0xac5b6486, F=0x0
Test segment-mp4-to-ts failed. Look at
tests/data/fate/segment-mp4-to-ts.err for details.
make: *** [fate-segment-mp4-to-ts] Error 134
(base) liuqi05:ufbuild liuqi$ history |grep make | tail -n 5
  318  make -j6
  319  make fate-rsync
  320  make fate

(base) liuqi05:ufbuild liuqi$ ./ffmpeg
ffmpeg version N-99556-gf7e2f090ed Copyright (c) 2000-2020 the FFmpeg developers
  built with Apple clang version 12.0.0 (clang-1200.0.32.2)
  configuration: --cc=clang --quiet --enable-htmlpages
--enable-libx264 --enable-libxml2 --enable-gpl --extra-ldflags='-O0
-g3 -fsanitize=address -Wno-error -fPIC -I/usr/local/include'
--extra-ldflags='-O0 -g3 -fsanitize=address -Wno-error -fPIC
-L/usr/local/lib' --enable-libfreetype --enable-fontconfig
--enable-libspeex --enable-libopus --enable-libzmq --enable-libx265
--enable-libass --enable-videotoolbox --disable-optimizations
--enable-audiotoolbox --enable-opengl --disable-stripping
--samples=../../fate-suite/


need use samples --samples=../../fate-suite/
and make fate-rsync

after above two step, you can make fate reproduce it.
>
> --
> Best Regards,
> Nachiket Tarate

Thanks

Steven
___
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 "unsubscribe".

Re: [FFmpeg-devel] [PATCH 01/11] avcodec/movtextdec: Reset counter of fonts when freeing them

2020-10-18 Thread Philip Langdale
On Sat, 17 Oct 2020 20:22:38 +0200
Andreas Rheinhardt  wrote:

> If allocating fonts fails when reading the header, all fonts are
> freed, yet the counter of fonts is not reset and no error is
> returned; when subtitles are decoded lateron, the inexistent list of
> fonts is searched for the matching font for this particular entry
> which of course leads to a segfault.

Hi Andreas,

I looked through the whole series. Looks good. Thanks for doing all of
this.

--phil
 
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavcodec/movtextdec.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c
> index 4a21dbf36d..068bdb7802 100644
> --- a/libavcodec/movtextdec.c
> +++ b/libavcodec/movtextdec.c
> @@ -148,6 +148,7 @@ static void mov_text_cleanup_ftab(MovTextContext
> *m) }
>  }
>  av_freep(&m->ftab);
> +m->ftab_entries = 0;
>  }
>  
>  static int mov_text_tx3g(AVCodecContext *avctx, MovTextContext *m)
> @@ -230,7 +231,6 @@ static int mov_text_tx3g(AVCodecContext *avctx,
> MovTextContext *m) box_size += 3;
>  if (avctx->extradata_size < box_size) {
>  mov_text_cleanup_ftab(m);
> -m->ftab_entries = 0;
>  return -1;
>  }
>  m->ftab_temp = av_mallocz(sizeof(*m->ftab_temp));
> @@ -245,7 +245,6 @@ static int mov_text_tx3g(AVCodecContext *avctx,
> MovTextContext *m) box_size = box_size + font_length;
>  if (avctx->extradata_size < box_size) {
>  mov_text_cleanup_ftab(m);
> -m->ftab_entries = 0;
>  return -1;
>  }
>  m->ftab_temp->font = av_malloc(font_length + 1);

___
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 "unsubscribe".

[FFmpeg-devel] [PATCH 1/1] libavformat/mov: Add bound checks to avoid invalid memory allocation

2020-10-18 Thread Xiaohui Zhang
From: Zhang Xiaohui 

Hi, I think function mov_read_cmov fails to perform proper bounds
checking on cmov_len, which may lead to invalid memory allocation.

Signed-off-by: Zhang Xiaohui 
---
 libavformat/mov.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 7fd43a8fc5..a23daa25da 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -5183,6 +5183,8 @@ static int mov_read_cmov(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 moov_len = avio_rb32(pb); /* uncompressed size */
 cmov_len = atom.size - 6 * 4;
 
+if (cmov_len <= 0)
+return AVERROR_INVALIDDATA;
 cmov_data = av_malloc(cmov_len);
 if (!cmov_data)
 return AVERROR(ENOMEM);
-- 
2.17.1

___
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 "unsubscribe".

[FFmpeg-devel] [PATCH] tests/audiomatch: removes a warning when compiling tests/audiomatch

2020-10-18 Thread liuqi05
the warning message:
warning: using floating point absolute value function
'fabs' when argument is of integer type
use FFABS to set the absolute value.

Signed-off-by: liuqi05 
---
 tests/audiomatch.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tests/audiomatch.c b/tests/audiomatch.c
index d44c4070e0..bb9deca624 100644
--- a/tests/audiomatch.c
+++ b/tests/audiomatch.c
@@ -24,6 +24,7 @@
 
 #define FFMIN(a,b) ((a) > (b) ? (b) : (a))
 #define FFMAX(a,b) ((a) > (b) ? (a) : (b))
+#define FFABS(a) ((a) >= 0 ? (a) : (-(a)))
 
 static int64_t fsize(FILE *f) {
 int64_t end, pos = ftell(f);
@@ -101,9 +102,9 @@ int main(int argc, char **argv) {
 int j = pos + i;
 c += signal[i] * data[j];
 }
-if (fabs(c) > sigamp * 0.94)
-maxshift = FFMIN(maxshift, fabs(pos)+32);
-if (fabs(c) > fabs(bestc)) {
+if (FFABS(c) > sigamp * 0.94)
+maxshift = FFMIN(maxshift, FFABS(pos)+32);
+if (FFABS(c) > FFABS(bestc)) {
 bestc = c;
 bestpos = pos;
 }
-- 
2.25.0



___
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 "unsubscribe".

Re: [FFmpeg-devel] [PATCH v1] libavcodec/pthread_frame: fix crash that call method ff_frame_thread_init failed because of mem insufficient

2020-10-18 Thread 徐慧书
Andreas Rheinhardt  于2020年10月16日周五 下午4:46写道:

> javashu2...@gmail.com:
> > From: xuhuishu 
> >
> > Signed-off-by: xuhuishu 
> > ---
> >  libavcodec/pthread_frame.c | 23 ---
> >  1 file changed, 12 insertions(+), 11 deletions(-)
> >
> > diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c
> > index f8a01ad8cd..2babeb4a6a 100644
> > --- a/libavcodec/pthread_frame.c
> > +++ b/libavcodec/pthread_frame.c
> > @@ -795,6 +795,11 @@ int ff_frame_thread_init(AVCodecContext *avctx)
> >  pthread_cond_init(&p->progress_cond, NULL);
> >  pthread_cond_init(&p->output_cond, NULL);
> >
> > +if (!copy) {
> > +err = AVERROR(ENOMEM);
> > +goto error;
> > +}
> > +
> >  p->frame = av_frame_alloc();
> >  if (!p->frame) {
> >  av_freep(©);
> > @@ -802,22 +807,18 @@ int ff_frame_thread_init(AVCodecContext *avctx)
> >  goto error;
> >  }
> >
> > -p->parent = fctx;
> > -p->avctx  = copy;
> > -
> > -if (!copy) {
> > +AVCodecInternal *internal = av_malloc(sizeof(AVCodecInternal));
> > +if (!internal) {
> > +av_freep(©);
> >  err = AVERROR(ENOMEM);
> >  goto error;
> >  }
> >
> > -*copy = *src;
> > +p->parent = fctx;
> > +p->avctx  = copy;
> >
> > -copy->internal = av_malloc(sizeof(AVCodecInternal));
> > -if (!copy->internal) {
> > -copy->priv_data = NULL;
> > -err = AVERROR(ENOMEM);
> > -goto error;
> > -}
> > +*copy = *src;
> > +copy->internal = internal;
> >  *copy->internal = *src->internal;
> >  copy->internal->thread_ctx = p;
> >  copy->internal->last_pkt_props = &p->avpkt;
> >
> How did you test this? Because it does not completely fix the issue:
> ff_frame_thread_free() thinks that i+1 AVCodecContexts are to be freed,
> but in case of error the last one is not properly initialized. E.g. if
> allocating the copy's priv_data fails, ff_frame_thread_free() will
> nevertheless attempt to call the codec's close function. And the same
> happens when init fails even when the codec does not have the
> FF_CODEC_CAP_INIT_CLEANUP set.
>
> - Andreas
> ___
> 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 "unsubscribe".



so sorry, This is my first ffmpeg patch submission, and I started to plan
to submit it twice, which is very wrong.
I have resubmitted it, I hope you see if there is anything else
___
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 "unsubscribe".

Re: [FFmpeg-devel] [PATCH v1] libavformat/hls: During operation, the user exits and interrupts, causing pls->segment to be released, resulting in a null pointer crash

2020-10-18 Thread 徐慧书
Andreas Rheinhardt  于2020年10月16日周五 下午9:32写道:

> javashu2...@gmail.com:
> > From: bevis 
> >
> > Signed-off-by: bevis 
> > ---
> >  libavformat/hls.c | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/libavformat/hls.c b/libavformat/hls.c
> > index 72e28ab94f..0a522a4595 100644
> > --- a/libavformat/hls.c
> > +++ b/libavformat/hls.c
> > @@ -1979,17 +1979,18 @@ static int hls_read_header(AVFormatContext *s)
> >  pls->ctx->interrupt_callback = s->interrupt_callback;
> >  url = av_strdup(pls->segments[0]->url);
> >  ret = av_probe_input_buffer(&pls->pb, &in_fmt, url, NULL, 0, 0);
> > -av_free(url);
> >  if (ret < 0) {
> >  /* Free the ctx - it isn't initialized properly at this
> point,
> >   * so avformat_close_input shouldn't be called. If
> >   * avformat_open_input fails below, it frees and zeros the
> >   * context, so it doesn't need any special treatment like
> this. */
> > -av_log(s, AV_LOG_ERROR, "Error when loading first segment
> '%s'\n", pls->segments[0]->url);
> > +av_log(s, AV_LOG_ERROR, "Error when loading first segment
> '%s'\n", url);
> >  avformat_free_context(pls->ctx);
> >  pls->ctx = NULL;
> > +av_free(url);
> >  goto fail;
> >  }
> > +av_free(url);
> >  pls->ctx->pb   = &pls->pb;
> >  pls->ctx->io_open  = nested_io_open;
> >  pls->ctx->flags   |= s->flags & ~AVFMT_FLAG_CUSTOM_IO;
> >
> The change itself seems fine to me (I wonder why this hasn't been
> noticed when writing/reviewing b5e39880fb), but your commit message is
> way too long: The first line should be a short description followed by a
> more detailed description lateron (in the next lines).
>
> How exactly did you find this?
>
> - Andreas
> ___
> 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 "unsubscribe".


hi, Andreas,I have already updated and initiated the submission, what else
do I need to do to submit this fix?
___
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 "unsubscribe".