Re: [FFmpeg-devel] [PATCH 1/3] avcodec/screenpresso: Optimize sum_delta_flipped()

2020-01-30 Thread Paul B Mahol
lgtm

On 1/29/20, Michael Niedermayer  wrote:
> 553 -> 332 sec
>
> Testcase:
> 20280/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SCREENPRESSO_fuzzer-6238663432470528
>
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/screenpresso.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/screenpresso.c b/libavcodec/screenpresso.c
> index 5fac100897..d73c24df83 100644
> --- a/libavcodec/screenpresso.c
> +++ b/libavcodec/screenpresso.c
> @@ -94,8 +94,9 @@ static void sum_delta_flipped(uint8_t   *dst, int
> dst_linesize,
>  {
>  int i;
>  for (; height > 0; height--) {
> +const uint8_t *src1 = &src[(height - 1) * src_linesize];
>  for (i = 0; i < bytewidth; i++)
> -dst[i] += src[(height - 1) * src_linesize + i];
> +dst[i] += src1[i];
>  dst += dst_linesize;
>  }
>  }
> --
> 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 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] dashenc: check pts to prevent division by zero error

2020-01-30 Thread Alfred E. Heggestad

this usecase will cause a division by zero trap:

1. dashenc has received one frame
2. os->max_pts and os->start_pts have same value
3. delta between max_pts and start_pts is 0
4. av_rescale_q(0, x, y) returns 0
5. this value is used as denominator in division
6. Bang! -> segfault

this fix checks that max_pts > start_pts.
the fix has been tested and works.

please review and suggest better fixes.

Signed-off-by: Alfred E. Heggestad 
---
 libavformat/dashenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index f555f208a7..3b651b9514 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -1883,7 +1883,7 @@ static int dash_flush(AVFormatContext *s, int 
final, int stream)


st->time_base,

AV_TIME_BASE_Q));

-if (!os->muxer_overhead)
+if (!os->muxer_overhead && os->max_pts > os->start_pts)
 os->muxer_overhead = ((int64_t) (range_length - 
os->total_pkt_size) *

   8 * AV_TIME_BASE) /
  av_rescale_q(os->max_pts - os->start_pts,
--
2.20.1 (Apple Git-117)

___
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 3/3] avcodec/x86/diracdsp: Fix incorrect src addressing in dequant_subband_32()

2020-01-30 Thread Paul B Mahol
probably ok

On 1/29/20, Michael Niedermayer  wrote:
> Fixes: Segfault (not reproducable with asm, which made this hard to debug)
> Fixes: decoding errors
> Fixes:
> 19854/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5729372837511168
>
> Found-by: continuous fuzzing process
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/x86/diracdsp.asm | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/x86/diracdsp.asm b/libavcodec/x86/diracdsp.asm
> index cc8a26fca5..a18bda113e 100644
> --- a/libavcodec/x86/diracdsp.asm
> +++ b/libavcodec/x86/diracdsp.asm
> @@ -294,8 +294,9 @@ cglobal dequant_subband_32, 7, 7, 4, src, dst, stride,
> qf, qs, tot_v, tot_h
>
>  addsrcq, mmsize
>  adddstq, mmsize
> -subtot_hd, 4
> +subtot_hq, 4
>  jg .loop_h
> +leasrcq, [srcq + 4*tot_hq]
>
>  addr3, strideq
>  dectot_vd
> --
> 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 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] avfilter/vf_drawtext: use replacement chars for invalid UTF8 sequences

2020-01-30 Thread Paul B Mahol
probably ok

On 1/30/20, Marton Balint  wrote:
> continue is explicitly disallowed for GET_UTF8, so let's fix that as well.
> Fixes crash with invalid UTF8 sequences.
>
> Signed-off-by: Marton Balint 
> ---
>  libavfilter/vf_drawtext.c | 9 ++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
> index aea17b6793..ed10175af0 100644
> --- a/libavfilter/vf_drawtext.c
> +++ b/libavfilter/vf_drawtext.c
> @@ -1225,7 +1225,8 @@ static int draw_glyphs(DrawTextContext *s, AVFrame
> *frame,
>  for (i = 0, p = text; *p; i++) {
>  FT_Bitmap bitmap;
>  Glyph dummy = { 0 };
> -GET_UTF8(code, *p++, continue;);
> +GET_UTF8(code, *p++, code = 0xfffd; goto continue_on_invalid;);
> +continue_on_invalid:
>
>  /* skip new line chars, just go to new line */
>  if (code == '\n' || code == '\r' || code == '\t')
> @@ -1363,7 +1364,8 @@ static int draw_text(AVFilterContext *ctx, AVFrame
> *frame,
>
>  /* load and cache glyphs */
>  for (i = 0, p = text; *p; i++) {
> -GET_UTF8(code, *p++, continue;);
> +GET_UTF8(code, *p++, code = 0xfffd; goto continue_on_invalid;);
> +continue_on_invalid:
>
>  /* get glyph */
>  dummy.code = code;
> @@ -1386,7 +1388,8 @@ static int draw_text(AVFilterContext *ctx, AVFrame
> *frame,
>  /* compute and save position for each glyph */
>  glyph = NULL;
>  for (i = 0, p = text; *p; i++) {
> -GET_UTF8(code, *p++, continue;);
> +GET_UTF8(code, *p++, code = 0xfffd; goto continue_on_invalid2;);
> +continue_on_invalid2:
>
>  /* skip the \n in the sequence \r\n */
>  if (prev_code == '\r' && code == '\n')
> --
> 2.16.4
>
> ___
> 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 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] avfilter/vf_drawtext: do not overread text if the last UTF8 sequence is invalid

2020-01-30 Thread Paul B Mahol
lgtm

On 1/30/20, Marton Balint  wrote:
> Signed-off-by: Marton Balint 
> ---
>  libavfilter/vf_drawtext.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
> index ed10175af0..b58556e0f1 100644
> --- a/libavfilter/vf_drawtext.c
> +++ b/libavfilter/vf_drawtext.c
> @@ -1225,7 +1225,7 @@ static int draw_glyphs(DrawTextContext *s, AVFrame
> *frame,
>  for (i = 0, p = text; *p; i++) {
>  FT_Bitmap bitmap;
>  Glyph dummy = { 0 };
> -GET_UTF8(code, *p++, code = 0xfffd; goto continue_on_invalid;);
> +GET_UTF8(code, *p ? *p++ : 0, code = 0xfffd; goto
> continue_on_invalid;);
>  continue_on_invalid:
>
>  /* skip new line chars, just go to new line */
> @@ -1364,7 +1364,7 @@ static int draw_text(AVFilterContext *ctx, AVFrame
> *frame,
>
>  /* load and cache glyphs */
>  for (i = 0, p = text; *p; i++) {
> -GET_UTF8(code, *p++, code = 0xfffd; goto continue_on_invalid;);
> +GET_UTF8(code, *p ? *p++ : 0, code = 0xfffd; goto
> continue_on_invalid;);
>  continue_on_invalid:
>
>  /* get glyph */
> @@ -1388,7 +1388,7 @@ continue_on_invalid:
>  /* compute and save position for each glyph */
>  glyph = NULL;
>  for (i = 0, p = text; *p; i++) {
> -GET_UTF8(code, *p++, code = 0xfffd; goto continue_on_invalid2;);
> +GET_UTF8(code, *p ? *p++ : 0, code = 0xfffd; goto
> continue_on_invalid2;);
>  continue_on_invalid2:
>
>  /* skip the \n in the sequence \r\n */
> --
> 2.16.4
>
> ___
> 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 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/6] avutil/common: use unsigned int in GET_UTF8

2020-01-30 Thread Paul B Mahol
bug in commit message, otherwise lgtm

On 1/30/20, Marton Balint  wrote:
> Right shift of signed value is impelentation defined.
>
> Signed-off-by: Marton Balint 
> ---
>  libavutil/common.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavutil/common.h b/libavutil/common.h
> index f09f0b486b..5568754bb9 100644
> --- a/libavutil/common.h
> +++ b/libavutil/common.h
> @@ -389,7 +389,7 @@ static av_always_inline av_const int
> av_parity_c(uint32_t v)
>  if ((val & 0xc0) == 0x80 || val >= 0xFE)\
>  ERROR\
>  while (val & top) {\
> -int tmp= (GET_BYTE) - 128;\
> +unsigned int tmp = (GET_BYTE) - 128;\
>  if(tmp>>6)\
>  ERROR\
>  val= (val<<6) + tmp;\
> --
> 2.16.4
>
> ___
> 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 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] avutil/common: warn about possible move of the data pointer after the last 0 byte in GET_UTF8

2020-01-30 Thread Paul B Mahol
lgtm

On 1/30/20, Marton Balint  wrote:
> Signed-off-by: Marton Balint 
> ---
>  libavutil/common.h | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/libavutil/common.h b/libavutil/common.h
> index e6f076a13c..142ff9abe7 100644
> --- a/libavutil/common.h
> +++ b/libavutil/common.h
> @@ -373,7 +373,9 @@ static av_always_inline av_const int
> av_parity_c(uint32_t v)
>   * @param GET_BYTE Expression reading one byte from the input.
>   * Evaluated up to 7 times (4 for the currently
>   * assigned Unicode range).  With a memory buffer
> - * input, this could be *ptr++.
> + * input, this could be *ptr++, or if you want to make sure
> + * that *ptr stops at the end of a NULL terminated string
> then
> + * *ptr ? *ptr++ : 0
>   * @param ERRORExpression to be evaluated on invalid input,
>   * typically a goto statement.
>   *
> --
> 2.16.4
>
> ___
> 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 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 3/6] avutil/common: put ERROR statements into separate code blocks in GET_UTF8/16

2020-01-30 Thread Paul B Mahol
missing rationale explanation.

On 1/30/20, Marton Balint  wrote:
> Signed-off-by: Marton Balint 
> ---
>  libavutil/common.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/libavutil/common.h b/libavutil/common.h
> index 02671190a6..e6f076a13c 100644
> --- a/libavutil/common.h
> +++ b/libavutil/common.h
> @@ -387,11 +387,11 @@ static av_always_inline av_const int
> av_parity_c(uint32_t v)
>  {\
>  uint32_t top = (val & 128) >> 1;\
>  if ((val & 0xc0) == 0x80 || val >= 0xFE)\
> -ERROR\
> +{ERROR}\
>  while (val & top) {\
>  unsigned int tmp = (GET_BYTE) - 128;\
>  if(tmp>>6)\
> -ERROR\
> +{ERROR}\
>  val= (val<<6) + tmp;\
>  top <<= 5;\
>  }\
> @@ -414,7 +414,7 @@ static av_always_inline av_const int
> av_parity_c(uint32_t v)
>  if (hi < 0x800) {\
>  val = (GET_16BIT) - 0xDC00;\
>  if (val > 0x3FFU || hi > 0x3FFU)\
> -ERROR\
> +{ERROR}\
>  val += (hi<<10) + 0x1;\
>  }\
>  }\
> --
> 2.16.4
>
> ___
> 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 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/6] avutil/common: add parenthesis around GET_16BIT in GET_UTF16

2020-01-30 Thread Paul B Mahol
why?

On 1/30/20, Marton Balint  wrote:
> Signed-off-by: Marton Balint 
> ---
>  libavutil/common.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libavutil/common.h b/libavutil/common.h
> index 5568754bb9..02671190a6 100644
> --- a/libavutil/common.h
> +++ b/libavutil/common.h
> @@ -408,11 +408,11 @@ static av_always_inline av_const int
> av_parity_c(uint32_t v)
>   *  typically a goto statement.
>   */
>  #define GET_UTF16(val, GET_16BIT, ERROR)\
> -val = GET_16BIT;\
> +val = (GET_16BIT);\
>  {\
>  unsigned int hi = val - 0xD800;\
>  if (hi < 0x800) {\
> -val = GET_16BIT - 0xDC00;\
> +val = (GET_16BIT) - 0xDC00;\
>  if (val > 0x3FFU || hi > 0x3FFU)\
>  ERROR\
>  val += (hi<<10) + 0x1;\
> --
> 2.16.4
>
> ___
> 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 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 v4] avcodec/libvpxenc: add VP9 temporal scalability encoding option

2020-01-30 Thread Wonkap Jang
Hi James,

My answers are in-line.

On Wed, Jan 29, 2020 at 8:36 AM James Zern 
wrote:

> On Fri, Jan 17, 2020 at 1:56 PM Wonkap Jang
>  wrote:
> >
> > Hi James,
> >
> > On Fri, Jan 17, 2020 at 1:50 PM Wonkap Jang  wrote:
> >
> > > This commit reuses the configuration options for VP8 that enables
> > > temporal scalability for VP9. It also adds a way to enable three
> > > preset temporal structures (refer to the documentation for more
> > > detail) that can be used in offline encoding.
> > > ---
> > >  doc/encoders.texi  |  18 ++-
> > >  libavcodec/libvpxenc.c | 250 +
> > >  2 files changed, 242 insertions(+), 26 deletions(-)
> > >
>
> I realized I missed a couple things previously.
>
> > > [...]
> > > +static int vpx_ts_param_parse(VPxContext *ctx, struct
> vpx_codec_enc_cfg
> > > *enccfg,
> > > +  char *key, char *value, enum AVCodecID
> > > codec_id)
> > >  {
> > >  size_t value_len = strlen(value);
> > > +int ts_layering_mode = 0;
> > >
> > >  if (!value_len)
> > >  return -1;
> > >
> > >  if (!strcmp(key, "ts_number_layers"))
>
> There isn't much validation here, libvpx should provide that, but can you
> try
> some incompatible input? ts_layering_mode is defined up to 3, so
> ts_number_layers > 3 should fail on init.
>
[WJ] actually.. it does not fail on init, since if ts_layering_mode is set
to 3, then it will override that parameter to be 3.
However, there are cases that are not correctly caught... such as if
ts_number_layers is set to 3 but if you put 4 parameters for bitrate and
such..
I do not think those cases are critical though.

>
> > > [...]
> > > +
> > > +#if (VPX_ENCODER_ABI_VERSION >= 12) && CONFIG_LIBVPX_VP9_ENCODER
> > > +enccfg->temporal_layering_mode = 1; // only bypass mode is
> supported
>
> There's VP9E_TEMPORAL_LAYERING_MODE_BYPASS for this.
>
[WJ] will make the change.


>
> > > for now.
> > > +enccfg->ss_number_layers = 1; // TODO: add spatial scalability
> > > support.
> > > +#endif
> > > +if (ts_layering_mode) {
> > > +// make sure the ts_layering_mode comes at the end of the
> > > ts_parameter string to ensure that
> > > +// correct configuration is done.
> > > +ctx->ts_layer_flags = av_malloc(sizeof(*ctx->ts_layer_flags) *
> > > VPX_TS_MAX_PERIODICITY);
>
> This would be better written as av_malloc_array. Looking at the use of the
> array, it doesn't look like it needs to be zeroed, but there's
> av_mallocz_array
> for that.
>
[WJ] will do.

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


 Thank you,

Wonkap
___
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/2] avformat/aviobuf: Remove AVIOInternal and one level of indirection

2020-01-30 Thread Paul B Mahol
I guess it is fine, see no negative implications.

On 1/30/20, Andreas Rheinhardt  wrote:
> Andreas Rheinhardt:
>> Andreas Rheinhardt:
>>> On Mon, Jan 6, 2020 at 3:51 PM Andreas Rheinhardt <
>>> andreas.rheinha...@gmail.com> wrote:
>>>
 In the Libav commit cae448cf, the opaque of every AVIOContext opened
 by ffio_fdopen() (which is used internally by avio_open() and
 avio_open2())
 changed: It was a simple pointer to an URLContext before, but now it was
 a structure (namely AVIOInternal) containing a pointer to an URLContext
 as its only member. The next commits (namely 8c0ceafb and ec4c4839)
 added
 members to AVIOInternal to allow white-/blacklisting of protocols.

 But these two commits were never merged into FFmpeg (they were only
 merged as no-ops in 510046c2 and 063b26d3), because FFmpeg chose
 a different way to implement this (in 93629735); and so our AVIOInternal
 still has exactly one member.

 This of course means that it is unnecessary to use AVIOInternal as
 opaque as it is just adding a level of indirection (not only pointer
 dereference, but also wrapper functions). Therefore this commit
 removes AVIOInternal entirely and essentially reverts cae448cf.

 Signed-off-by: Andreas Rheinhardt 
 ---
  libavformat/aviobuf.c | 86 ---
  1 file changed, 15 insertions(+), 71 deletions(-)

 diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
 index 70e1d2ca10..0e2f038988 100644
 --- a/libavformat/aviobuf.c
 +++ b/libavformat/aviobuf.c
 @@ -42,15 +42,10 @@
   */
  #define SHORT_SEEK_THRESHOLD 4096

 -typedef struct AVIOInternal {
 -URLContext *h;
 -} AVIOInternal;
 -
  static void *ff_avio_child_next(void *obj, void *prev)
  {
  AVIOContext *s = obj;
 -AVIOInternal *internal = s->opaque;
 -return prev ? NULL : internal->h;
 +return prev ? NULL : s->opaque;
  }

  static const AVClass *ff_avio_child_class_next(const AVClass *prev)
 @@ -940,49 +935,8 @@ uint64_t ffio_read_varlen(AVIOContext *bc){
  return val;
  }

 -static int io_read_packet(void *opaque, uint8_t *buf, int buf_size)
 -{
 -AVIOInternal *internal = opaque;
 -return ffurl_read(internal->h, buf, buf_size);
 -}
 -
 -static int io_write_packet(void *opaque, uint8_t *buf, int buf_size)
 -{
 -AVIOInternal *internal = opaque;
 -return ffurl_write(internal->h, buf, buf_size);
 -}
 -
 -static int64_t io_seek(void *opaque, int64_t offset, int whence)
 -{
 -AVIOInternal *internal = opaque;
 -return ffurl_seek(internal->h, offset, whence);
 -}
 -
 -static int io_short_seek(void *opaque)
 -{
 -AVIOInternal *internal = opaque;
 -return ffurl_get_short_seek(internal->h);
 -}
 -
 -static int io_read_pause(void *opaque, int pause)
 -{
 -AVIOInternal *internal = opaque;
 -if (!internal->h->prot->url_read_pause)
 -return AVERROR(ENOSYS);
 -return internal->h->prot->url_read_pause(internal->h, pause);
 -}
 -
 -static int64_t io_read_seek(void *opaque, int stream_index, int64_t
 timestamp, int flags)
 -{
 -AVIOInternal *internal = opaque;
 -if (!internal->h->prot->url_read_seek)
 -return AVERROR(ENOSYS);
 -return internal->h->prot->url_read_seek(internal->h, stream_index,
 timestamp, flags);
 -}
 -
  int ffio_fdopen(AVIOContext **s, URLContext *h)
  {
 -AVIOInternal *internal = NULL;
  uint8_t *buffer = NULL;
  int buffer_size, max_packet_size;

 @@ -996,14 +950,10 @@ int ffio_fdopen(AVIOContext **s, URLContext *h)
  if (!buffer)
  return AVERROR(ENOMEM);

 -internal = av_mallocz(sizeof(*internal));
 -if (!internal)
 -goto fail;
 -
 -internal->h = h;
 -
 -*s = avio_alloc_context(buffer, buffer_size, h->flags &
 AVIO_FLAG_WRITE,
 -internal, io_read_packet, io_write_packet,
 io_seek);
 +*s = avio_alloc_context(buffer, buffer_size, h->flags &
 AVIO_FLAG_WRITE, h,
 +(int (*)(void *, uint8_t *, int))
 ffurl_read,
 +(int (*)(void *, uint8_t *, int))
 ffurl_write,
 +(int64_t (*)(void *, int64_t,
 int))ffurl_seek);
  if (!*s)
  goto fail;

 @@ -1023,30 +973,28 @@ int ffio_fdopen(AVIOContext **s, URLContext *h)
  (*s)->max_packet_size = max_packet_size;
  (*s)->min_packet_size = h->min_packet_size;
  if(h->prot) {
 -(*s)->read_pause = io_read_pause;
 -(*s)->read_seek  = io_read_seek;
 +(*s)->read_pause = (int (*)(voi

Re: [FFmpeg-devel] [PATCH]lavf/nut: Explicitely add tags for NV12 and NV21

2020-01-30 Thread Michael Niedermayer
On Wed, Jan 29, 2020 at 02:44:02PM +0100, Paul B Mahol wrote:
> On 1/29/20, Michael Niedermayer  wrote:
> > On Wed, Jan 29, 2020 at 01:44:52AM +0100, Carl Eugen Hoyos wrote:
> >> Hi!
> >>
> >> Mentioned tags are already used in nut by fate.
> >>
> >> Please comment, Carl Eugen
> >
> >>  nut.c |3 +++
> >>  1 file changed, 3 insertions(+)
> >> ae60da7cb36c94b7cab3bd17f02bd9403c8d2ff8
> >> 0001-lavf-nut-Explicitely-add-NV12-NV21-tags.patch
> >> From dd52b20ce2eea008a0c58c09f768e5ef92133578 Mon Sep 17 00:00:00 2001
> >> From: Carl Eugen Hoyos 
> >> Date: Wed, 29 Jan 2020 01:43:24 +0100
> >> Subject: [PATCH] lavf/nut: Explicitely add NV12/NV21 tags.
> >>
> >> These are already used by fate.
> >> ---
> >>  libavformat/nut.c | 3 +++
> >>  1 file changed, 3 insertions(+)
> >
> > they should be added to nut4cc.txt first
> >
> > https://lists.mplayerhq.hu/mailman/listinfo/nut-devel
> >
> > after that, LGTM
> 
> No, patch is LGTM, push at will.
> 
> Mentioned list should be removed.

nut4cc.txt lists the 4ccs for nut, nut also uses the AVI 4ccs

https://git.ffmpeg.org/gitweb/nut.git/blob/HEAD:/docs/nut4cc.txt
It does not list NV12 or NV21
avi does list them
https://www.fourcc.org/pixel-format/yuv-nv12/

The patch starting this thread adds the NV12/21 fourccs to the nut specific
list. That is only correct if they are in the nut specific fourcc list
of the nut specification (nut4cc.txt).
Thats why i suggest to add them there first or maybe we do not need to
add them to the nut specific list in the implementation at all and its
good enough that they are in the avi list.

But the combination of the implementation listing a fourcc in its nut
specific list while the nut specification not listing it does not seem
correct to me.

Thanks

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

Avoid a single point of failure, be that a person or equipment.


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]lavf/nut: Explicitely add tags for NV12 and NV21

2020-01-30 Thread Paul B Mahol
On 1/30/20, Michael Niedermayer  wrote:
> On Wed, Jan 29, 2020 at 02:44:02PM +0100, Paul B Mahol wrote:
>> On 1/29/20, Michael Niedermayer  wrote:
>> > On Wed, Jan 29, 2020 at 01:44:52AM +0100, Carl Eugen Hoyos wrote:
>> >> Hi!
>> >>
>> >> Mentioned tags are already used in nut by fate.
>> >>
>> >> Please comment, Carl Eugen
>> >
>> >>  nut.c |3 +++
>> >>  1 file changed, 3 insertions(+)
>> >> ae60da7cb36c94b7cab3bd17f02bd9403c8d2ff8
>> >> 0001-lavf-nut-Explicitely-add-NV12-NV21-tags.patch
>> >> From dd52b20ce2eea008a0c58c09f768e5ef92133578 Mon Sep 17 00:00:00 2001
>> >> From: Carl Eugen Hoyos 
>> >> Date: Wed, 29 Jan 2020 01:43:24 +0100
>> >> Subject: [PATCH] lavf/nut: Explicitely add NV12/NV21 tags.
>> >>
>> >> These are already used by fate.
>> >> ---
>> >>  libavformat/nut.c | 3 +++
>> >>  1 file changed, 3 insertions(+)
>> >
>> > they should be added to nut4cc.txt first
>> >
>> > https://lists.mplayerhq.hu/mailman/listinfo/nut-devel
>> >
>> > after that, LGTM
>>
>> No, patch is LGTM, push at will.
>>
>> Mentioned list should be removed.
>
> nut4cc.txt lists the 4ccs for nut, nut also uses the AVI 4ccs
>
> https://git.ffmpeg.org/gitweb/nut.git/blob/HEAD:/docs/nut4cc.txt
> It does not list NV12 or NV21
> avi does list them
> https://www.fourcc.org/pixel-format/yuv-nv12/
>
> The patch starting this thread adds the NV12/21 fourccs to the nut specific
> list. That is only correct if they are in the nut specific fourcc list
> of the nut specification (nut4cc.txt).
> Thats why i suggest to add them there first or maybe we do not need to
> add them to the nut specific list in the implementation at all and its
> good enough that they are in the avi list.
>
> But the combination of the implementation listing a fourcc in its nut
> specific list while the nut specification not listing it does not seem
> correct to me.
>

Than riff.c is petter place for this. And is already there.
Why they are not used?

> Thanks
>
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Avoid a single point of failure, be that a person or equipment.
>
___
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 V1] cmdutils: fix crash if no name for "ffmpeg -h protocol"

2020-01-30 Thread Jun Zhao
From: Jun Zhao 

fix crash when used the command like:
- ffmpeg -h protocol
- ffmpeg -h protocol=

Signed-off-by: Jun Zhao 
---
 fftools/cmdutils.c |8 +++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
index 2284631..f0f2b4f 100644
--- a/fftools/cmdutils.c
+++ b/fftools/cmdutils.c
@@ -1872,8 +1872,14 @@ static void show_help_demuxer(const char *name)
 
 static void show_help_protocol(const char *name)
 {
-const AVClass *proto_class = avio_protocol_get_class(name);
+const AVClass *proto_class;
 
+if (!name) {
+av_log(NULL, AV_LOG_ERROR, "No protocol name specified.\n");
+return;
+}
+
+proto_class = avio_protocol_get_class(name);
 if (!proto_class) {
 av_log(NULL, AV_LOG_ERROR, "Unknown protocol '%s'.\n", name);
 return;
-- 
1.7.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 1/2] avutil/log: Add av_log_once() for printing a message just once per instance

2020-01-30 Thread Anton Khirnov
Quoting Michael Niedermayer (2020-01-29 12:25:42)
> On Tue, Jan 28, 2020 at 07:38:45PM +0100, Anton Khirnov wrote:
> > Quoting Michael Niedermayer (2020-01-24 13:04:08)
> > > On Tue, Jan 21, 2020 at 07:44:46PM +0100, Anton Khirnov wrote:
> > > > Quoting Michael Niedermayer (2020-01-21 15:43:48)
> > > > > On Tue, Jan 21, 2020 at 12:24:50PM +0100, Anton Khirnov wrote:
> > > > > > Quoting Michael Niedermayer (2020-01-16 17:51:28)
> > > > > > > Compared to ad-hoc if(printed) ... code this allows the user to 
> > > > > > > disable
> > > > > > > it with a flag and see all repeated messages, it is also simpler
> > > > > > 
> > > > > > That flag is global state - it should be deprecated and removed, not
> > > > > > embedded further into the API.
> > > > > 
> > > > > When the flag is replaced by a non global solution every of its uses
> > > > > would be replaced too.
> > > > > 
> > > > > Until such a non global API exists, this is the only way the user can
> > > > > indicate her choice of which log messages to print.
> > > > > Code should honor the existing API and user preferrance.
> > > > 
> > > > The problem is that right now, flags is only used by the default log
> > > > callback. The behaviour of the default log callback is not specified by
> > > > the API, so it can be changed later without much trouble. With this
> > > > patch, the function of flags is hardcoded into the API, making its
> > > > future removal significantly harder.
> > > 
> > > I dont really see this concern. Because if you disable the flag "today"
> > > you break the API as it is documented, the flag is documented to
> > > affect the message repeation.
> > > With this patch, disabling it still breaks a bunch of message repeating
> > > behavior, so to me this looks like its basically the same.
> > 
> > The flag is documented, but the situations where it applies are not.
> > Currently, it only applies to the default log callback. It has no effect
> > whatsoever on users who use their own callback. With your patch, its
> > influence spreads into the core API. Since I see the flag as something
> > to be removed, I would prefer it were not done.
> > 
> 
> > > 
> > > But what do you suggest ?
> > > 
> > > We could send all the repeated _once() messages to the callback and leave 
> > > it
> > > to the callback to drop them. Just needs a way to tag them as repeats
> > > 
> > > We could move the (no)repeat flag to each context but this feels unwieldy
> > > and feels like it solves a problem noone had. Because noone ever asked
> > > AFAIR that they wanted to change repeating behavior on a per context base.
> > > This is probably mostly used by developers wanting to check for "all"
> > > messages. Or users produding bug reports which also would ideally have
> > > no dropped messages.
> > > 
> > > I can also just drop the use of the flag entirely from the patch and just
> > > leave this as a unconditional _once() log. It feels a bit like a missing
> > > feature though because as a devleoper for debuging a simple switch to
> > > see all repeats seems usefull.
> > 
> > I would say that log_once() should be used only for messages that are
> > meaningful just once (per context). It then makes no sense to log them
> > multiple times. Otherwise normal logging should be used.
> 
> I cannot think of a single case for which this would be true.
> 
> All cases i can think of for which i intended to use log_once() for, and for
> some of these users have asked for this. In one case theres a offer to pay
> for it by a user. So this is a real case with real intrerrest behind
> is where the messages do carry information in each instance (for a developer).
> but are annoying to the user.
> 
> So, we sure can use log_once() with no flag to turn the "once" off. And let
> the developer who needs it off edit the source and rebuild but its not correct
> to say that the messages are not meaningful after their first occurance.
> A developer looking into some issue with a file would want to know if a
> header error occurs once or on every frame or maybe every time a vissual
> issue appears.
> 
> Maybe we could have log_once() not suppress the messages after their first
> occurance but reduce them to DEBUG or TRACE level.
> What do you think ?

Yes, a reduced loglevel sounds better to me. The only issue with that
the name no longer matches the functionality - since it no longer logs
just once - but I can't think of a better name (maybe
log_display_once(), but that's ugly and not much more descriptive) and
it's probably not a big deal.
No other objections from me.

-- 
Anton Khirnov
___
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/5] avformat/format: add av_find_input_format2

2020-01-30 Thread Anton Khirnov
Quoting Gyan (2020-01-29 16:48:14)
> 
> 
> On 29-01-2020 03:10 pm, Anton Khirnov wrote:
> > Quoting Gyan Doshi (2020-01-28 08:44:42)
> >> Identifies demuxer by extension if search by short name fails.
> >> ---
> >>   libavformat/avformat.h |  7 +++
> >>   libavformat/format.c   | 14 +-
> >>   libavformat/version.h  |  2 +-
> >>   3 files changed, 21 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/libavformat/avformat.h b/libavformat/avformat.h
> >> index 9b9b634ec3..c81c4f18fd 100644
> >> --- a/libavformat/avformat.h
> >> +++ b/libavformat/avformat.h
> >> @@ -2246,6 +2246,13 @@ ff_const59 AVInputFormat 
> >> *av_find_input_format(const char *short_name);
> >>*/
> >>   ff_const59 AVInputFormat *av_probe_input_format(ff_const59 AVProbeData 
> >> *pd, int is_opened);
> >>   
> >> +/**
> >> + * Find AVInputFormat based on the short name of the input format.
> >> + * If that fails and as_extension is set, find demuxer which has 
> >> registered the
> >> + * name as an extension.
> >> + */
> >> +ff_const59 AVInputFormat *av_find_input_format2(const char *short_name, 
> >> int as_extension);
> > This seems rather ad-hoc to me. I think it'd be cleaner to have a
> > dedicated function just for matching by extension. It could be called
> > av_demuxer_find_by_ext() for consistency with av_demuxer_iterate().
> 
> Sure.  But it could be both.  av_find_input_format2 could call 
> av_find_format_by_ext() if name fails.

Possible, yes. Though I'd suggest 'guess' rather than 'find' for a
function that does "get me some input format based on some heuristics".

Also, I really think it's better to use big-endian naming along the
lines of av[_]_ rather than av[_]_.

-- 
Anton Khirnov
___
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] cmdutils: fix crash if no name for "ffmpeg -h protocol"

2020-01-30 Thread Paul B Mahol
lgtm

On 1/30/20, Jun Zhao  wrote:
> From: Jun Zhao 
>
> fix crash when used the command like:
> - ffmpeg -h protocol
> - ffmpeg -h protocol=
>
> Signed-off-by: Jun Zhao 
> ---
>  fftools/cmdutils.c |8 +++-
>  1 files changed, 7 insertions(+), 1 deletions(-)
>
> diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
> index 2284631..f0f2b4f 100644
> --- a/fftools/cmdutils.c
> +++ b/fftools/cmdutils.c
> @@ -1872,8 +1872,14 @@ static void show_help_demuxer(const char *name)
>
>  static void show_help_protocol(const char *name)
>  {
> -const AVClass *proto_class = avio_protocol_get_class(name);
> +const AVClass *proto_class;
>
> +if (!name) {
> +av_log(NULL, AV_LOG_ERROR, "No protocol name specified.\n");
> +return;
> +}
> +
> +proto_class = avio_protocol_get_class(name);
>  if (!proto_class) {
>  av_log(NULL, AV_LOG_ERROR, "Unknown protocol '%s'.\n", name);
>  return;
> --
> 1.7.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 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 3/6] avutil/common: put ERROR statements into separate code blocks in GET_UTF8/16

2020-01-30 Thread Marton Balint



On Thu, 30 Jan 2020, Paul B Mahol wrote:


missing rationale explanation.


Patch 5 is using two statements as ERROR, without this the second 
statement is executed always and not only if the if condition is true.




On 1/30/20, Marton Balint  wrote:

Signed-off-by: Marton Balint 
---
 libavutil/common.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavutil/common.h b/libavutil/common.h
index 02671190a6..e6f076a13c 100644
--- a/libavutil/common.h
+++ b/libavutil/common.h
@@ -387,11 +387,11 @@ static av_always_inline av_const int
av_parity_c(uint32_t v)
 {\
 uint32_t top = (val & 128) >> 1;\
 if ((val & 0xc0) == 0x80 || val >= 0xFE)\
-ERROR\
+{ERROR}\
 while (val & top) {\
 unsigned int tmp = (GET_BYTE) - 128;\
 if(tmp>>6)\
-ERROR\
+{ERROR}\
 val= (val<<6) + tmp;\
 top <<= 5;\
 }\
@@ -414,7 +414,7 @@ static av_always_inline av_const int
av_parity_c(uint32_t v)
 if (hi < 0x800) {\
 val = (GET_16BIT) - 0xDC00;\
 if (val > 0x3FFU || hi > 0x3FFU)\
-ERROR\
+{ERROR}\
 val += (hi<<10) + 0x1;\
 }\
 }\
--
2.16.4

___
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 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/6] avutil/common: add parenthesis around GET_16BIT in GET_UTF16

2020-01-30 Thread Marton Balint



On Thu, 30 Jan 2020, Paul B Mahol wrote:


why?


Because it is a macro and otherwise operator precedence might 
interfere with what the user would expect. In the second GET_16BIT you 
can't use bitwise operators because their precedence is lower than 
substraction which is used there.




On 1/30/20, Marton Balint  wrote:

Signed-off-by: Marton Balint 
---
 libavutil/common.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavutil/common.h b/libavutil/common.h
index 5568754bb9..02671190a6 100644
--- a/libavutil/common.h
+++ b/libavutil/common.h
@@ -408,11 +408,11 @@ static av_always_inline av_const int
av_parity_c(uint32_t v)
  *  typically a goto statement.
  */
 #define GET_UTF16(val, GET_16BIT, ERROR)\
-val = GET_16BIT;\
+val = (GET_16BIT);\
 {\
 unsigned int hi = val - 0xD800;\
 if (hi < 0x800) {\
-val = GET_16BIT - 0xDC00;\
+val = (GET_16BIT) - 0xDC00;\
 if (val > 0x3FFU || hi > 0x3FFU)\
 ERROR\
 val += (hi<<10) + 0x1;\
--
2.16.4

___
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 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/6] avutil/common: add parenthesis around GET_16BIT in GET_UTF16

2020-01-30 Thread Paul B Mahol
On 1/30/20, Marton Balint  wrote:
>
>
> On Thu, 30 Jan 2020, Paul B Mahol wrote:
>
>> why?
>
> Because it is a macro and otherwise operator precedence might
> interfere with what the user would expect. In the second GET_16BIT you
> can't use bitwise operators because their precedence is lower than
> substraction which is used there.

patch lgtm

>
>>
>> On 1/30/20, Marton Balint  wrote:
>>> Signed-off-by: Marton Balint 
>>> ---
>>>  libavutil/common.h | 4 ++--
>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/libavutil/common.h b/libavutil/common.h
>>> index 5568754bb9..02671190a6 100644
>>> --- a/libavutil/common.h
>>> +++ b/libavutil/common.h
>>> @@ -408,11 +408,11 @@ static av_always_inline av_const int
>>> av_parity_c(uint32_t v)
>>>   *  typically a goto statement.
>>>   */
>>>  #define GET_UTF16(val, GET_16BIT, ERROR)\
>>> -val = GET_16BIT;\
>>> +val = (GET_16BIT);\
>>>  {\
>>>  unsigned int hi = val - 0xD800;\
>>>  if (hi < 0x800) {\
>>> -val = GET_16BIT - 0xDC00;\
>>> +val = (GET_16BIT) - 0xDC00;\
>>>  if (val > 0x3FFU || hi > 0x3FFU)\
>>>  ERROR\
>>>  val += (hi<<10) + 0x1;\
>>> --
>>> 2.16.4
>>>
>>> ___
>>> 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 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 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 3/6] avutil/common: put ERROR statements into separate code blocks in GET_UTF8/16

2020-01-30 Thread Paul B Mahol
On 1/30/20, Marton Balint  wrote:
>
>
> On Thu, 30 Jan 2020, Paul B Mahol wrote:
>
>> missing rationale explanation.
>
> Patch 5 is using two statements as ERROR, without this the second
> statement is executed always and not only if the if condition is true.
>

patch lgtm

>>
>> On 1/30/20, Marton Balint  wrote:
>>> Signed-off-by: Marton Balint 
>>> ---
>>>  libavutil/common.h | 6 +++---
>>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/libavutil/common.h b/libavutil/common.h
>>> index 02671190a6..e6f076a13c 100644
>>> --- a/libavutil/common.h
>>> +++ b/libavutil/common.h
>>> @@ -387,11 +387,11 @@ static av_always_inline av_const int
>>> av_parity_c(uint32_t v)
>>>  {\
>>>  uint32_t top = (val & 128) >> 1;\
>>>  if ((val & 0xc0) == 0x80 || val >= 0xFE)\
>>> -ERROR\
>>> +{ERROR}\
>>>  while (val & top) {\
>>>  unsigned int tmp = (GET_BYTE) - 128;\
>>>  if(tmp>>6)\
>>> -ERROR\
>>> +{ERROR}\
>>>  val= (val<<6) + tmp;\
>>>  top <<= 5;\
>>>  }\
>>> @@ -414,7 +414,7 @@ static av_always_inline av_const int
>>> av_parity_c(uint32_t v)
>>>  if (hi < 0x800) {\
>>>  val = (GET_16BIT) - 0xDC00;\
>>>  if (val > 0x3FFU || hi > 0x3FFU)\
>>> -ERROR\
>>> +{ERROR}\
>>>  val += (hi<<10) + 0x1;\
>>>  }\
>>>  }\
>>> --
>>> 2.16.4
>>>
>>> ___
>>> 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 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 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] avfilter/vf_geq: use per-thread AVExpr for expression evaluation

2020-01-30 Thread Michael Niedermayer
On Wed, Jan 29, 2020 at 08:25:17PM +0100, Marton Balint wrote:
> There was no consensus about separating AVExprState from AVExpr so here is a
> minimal patch using the existing AVExpr to fix ticket #7528.
> 
> Signed-off-by: Marton Balint 
> ---
>  doc/filters.texi |  5 +
>  libavfilter/vf_geq.c | 26 +++---
>  2 files changed, 20 insertions(+), 11 deletions(-)

not sure this is optimal but it fixes the issue so ok

thanks

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

If the United States is serious about tackling the national security threats 
related to an insecure 5G network, it needs to rethink the extent to which it
values corporate profits and government espionage over security.-Bruce Schneier


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] ac3enc: drop a global variable

2020-01-30 Thread Michael Niedermayer
On Wed, Jan 29, 2020 at 04:34:48PM +0100, Anton Khirnov wrote:
> Log the warning message once per encoder instance instead.
> ---
>  libavcodec/ac3enc.c | 5 ++---
>  libavcodec/ac3enc.h | 2 ++
>  2 files changed, 4 insertions(+), 3 deletions(-)

LGTM

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides


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/screenpresso: Optimize sum_delta_flipped()

2020-01-30 Thread Michael Niedermayer
On Thu, Jan 30, 2020 at 09:22:53AM +0100, Paul B Mahol wrote:
> lgtm

will apply

thx

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

"You are 36 times more likely to die in a bathtub than at the hands of a
terrorist. Also, you are 2.5 times more likely to become a president and
2 times more likely to become an astronaut, than to die in a terrorist
attack." -- Thoughty2



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 3/3] avcodec/x86/diracdsp: Fix incorrect src addressing in dequant_subband_32()

2020-01-30 Thread Michael Niedermayer
On Thu, Jan 30, 2020 at 11:30:03AM +0100, Paul B Mahol wrote:
> probably ok

will apply

thx

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

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.


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/2] avformat/aviobuf: Remove AVIOInternal and one level of indirection

2020-01-30 Thread Michael Niedermayer
On Thu, Jan 30, 2020 at 01:33:43PM +0100, Paul B Mahol wrote:
> I guess it is fine, see no negative implications.

will apply

thx

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

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.


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] lavc/dvdsubenc: accept palette from options

2020-01-30 Thread Michael Kuron
Is there anything else you need me to change before this can be
merged? If not, I am happy to split it into two patches if necessary.

On Sat, Jan 25, 2020 at 3:33 PM Michael Kuron  wrote:
>
> Previously, the default palette would always be used.
> Now, we can accept a custom palette, just like dvdsubdec does.
>
> Signed-off-by: Michael Kuron 
> ---
___
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/2] avcodec/mpeg12dec: Fix invalid shift in mpeg2_fast_decode_block_intra()

2020-01-30 Thread Michael Niedermayer
On Thu, Dec 26, 2019 at 02:13:59AM +, Kieran Kunhya wrote:
> On Thu, 26 Dec 2019 at 00:27, Michael Niedermayer 
> wrote:
> 
> > Fixes: left shift of negative value -695
> > Fixes:
> > 19232/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG1VIDEO_fuzzer-5702856963522560
> > Fixes:
> > 19555/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG1VIDEO_fuzzer-5741218147598336
> >
> > Found-by: continuous fuzzing process
> > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > Signed-off-by
> > :
> > Michael Niedermayer 
> > ---
> >  libavcodec/mpeg12dec.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
> > index 775579f9f0..4643992d28 100644
> > --- a/libavcodec/mpeg12dec.c
> > +++ b/libavcodec/mpeg12dec.c
> > @@ -586,7 +586,7 @@ static inline int
> > mpeg2_fast_decode_block_intra(MpegEncContext *s,
> 
> 
[...]

> Also it has the following comment associated with it:
> 
> /**
>  * Note: this function can read out of range and crash for corrupt streams.
>  * Changing this would eat up any speed benefits it has.
>  * Do not use "fast" flag if you need the code to be robust.
>  */
> 
> If you want to make it robust you might as well just use the real decode
> function

People wanted to maximize code coverage of the fuzzer. So it fuzzes such
cases too now. 
I dont see any harm in fixing issues like the one this patch is about.
and that the codepath is inherently not robust as part of what its intended
for shouldnt be an argument to not fix issues we can easily fix.

About removing it, its very easy to fix (the case here) but removing it from 
old releases
would not be easy and also i dont see how that could be justified to its
users.

So i think this patch should be applied

Thanks


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

While the State exists there can be no freedom; when there is freedom there
will be no State. -- Vladimir Lenin


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

[FFmpeg-devel] Unable to log into the bug tracker

2020-01-30 Thread Alberto Salvia Novella

Screencast 

(Please include my address into "To:" when replying)


smime.p7s
Description: S/MIME Cryptographic 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] tools/target_dec_fuzzer: Add threshold for ALS

2020-01-30 Thread Michael Niedermayer
On Sun, Jan 26, 2020 at 12:56:26AM +0100, Michael Niedermayer wrote:
> Fixes: Timeout (253sec -> 16sec)
> Fixes: 
> 18668/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-6227155369590784
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  tools/target_dec_fuzzer.c | 1 +
>  1 file changed, 1 insertion(+)

will apply

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

No human being will ever know the Truth, for even if they happen to say it
by chance, they would not even known they had done so. -- Xenophanes


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] doc/filters: Document geq *sum functions

2020-01-30 Thread Michael Niedermayer
On Sat, Dec 28, 2019 at 11:28:44AM +0100, Michael Niedermayer wrote:
> Signed-off-by: Michael Niedermayer 
> ---
>  doc/filters.texi | 4 
>  1 file changed, 4 insertions(+)

will apply

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

When the tyrant has disposed of foreign enemies by conquest or treaty, and
there is nothing more to fear from them, then he is always stirring up
some war or other, in order that the people may require a leader. -- Plato


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/iff: Over-allocate ham_palbuf for HAM6 IFF-PBM

2020-01-30 Thread Michael Niedermayer
On Sat, Jan 04, 2020 at 01:41:31AM +0100, Michael Niedermayer wrote:
> IFF-PBM-HAM6 can read out of array without this overallocation
> Fixes: Out of array read
> Fixes: 
> 19752/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5675331403120640
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/iff.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 1/2] avcodec/smacker: Check space before decoding type

2020-01-30 Thread Michael Niedermayer
On Thu, Jan 02, 2020 at 01:01:51AM +0100, Michael Niedermayer wrote:
> Fixes: Timeout (232sec -> 280ms)
> Fixes: 
> 19682/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SMACKER_fuzzer-5654129649385472
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/smacker.c | 4 
>  1 file changed, 4 insertions(+)

will apply patchset

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

The day soldiers stop bringing you their problems is the day you have stopped 
leading them. They have either lost confidence that you can help or concluded 
you do not care. Either case is a failure of leadership. - Colin Powell


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/2] remove tests/ref/lavf/fits

2020-01-30 Thread Michael Niedermayer
On Mon, Jan 06, 2020 at 02:55:38PM +0100, Michael Niedermayer wrote:
> This appears to be forgotten in ac4b5d86222006fa71ffe5922e1a34f1422507d8
> 
> Signed-off-by: Michael Niedermayer 
> ---
>  tests/ref/lavf/fits | 18 --
>  1 file changed, 18 deletions(-)
>  delete mode 100644 tests/ref/lavf/fits

will apply

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

The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides


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] Fix undefined behavior in ff_configure_buffers_for_index()

2020-01-30 Thread Dale Curtis
On Wed, Jan 29, 2020 at 10:23 PM Michael Niedermayer 
wrote:

> so i think it works but maybe ive missed something, for which values
> of e2_pts do you see a problem with e1_pts = INT64_MIN?
>

For e1_pts = INT64_MIN and e2_pts >= 0 you end up with a negative int64_t
result for e2_pts - (uint64_t)e1_pts, so it's always < time_tolerance. If
that's what you intended, then sgtm.

- dale
___
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] tests/fate/lavf-video.mak: better looking gif dependancies

2020-01-30 Thread Michael Niedermayer
On Mon, Jan 06, 2020 at 11:43:29AM -0300, James Almer wrote:
> On 1/6/2020 10:55 AM, Michael Niedermayer wrote:
[...]
> >  FATE_LAVF_VIDEO-$(CONFIG_YUV4MPEGPIPE_MUXER)+= y4m
> >  
> >  FATE_LAVF_VIDEO = $(FATE_LAVF_VIDEO-yes:%=fate-lavf-%)
> > 
> 
> Make the commit message "fix fate-lavf-gif dependencies" instead of
> "better looking gif dependancies". And mention the above commit as the
> source of the regression.

ok

> 
> LGTM otherwise.

will apply

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

I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates


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/4] avcodec/apedec: Fix undefined integer overflow in decode_array_0000()

2020-01-30 Thread Michael Niedermayer
On Sun, Dec 08, 2019 at 12:20:12AM +0100, Michael Niedermayer wrote:
> Fixes: signed integer overflow: -2143289344 - 6246400 cannot be represented 
> in type 'int'
> Fixes: 
> 19239/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5173755680915456
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/apedec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply

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

The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus


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/wmalosslessdec: Fix multiple integer overflows

2020-01-30 Thread Michael Niedermayer
On Thu, Jan 09, 2020 at 03:44:04PM +0100, Michael Niedermayer wrote:
> Fixes: left shift of 3329 by 20 places cannot be represented in type 'int'
> Fixes: signed integer overflow: -199378355 + -1948950833 cannot be 
> represented in type 'int'
> Fixes: 
> 19837/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-5752565837070336
> Fixes: 
> 19839/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-5767483265122304
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/wmalosslessdec.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

will apply

[...]
-- 
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 1/2] avformat/mov: Check STCO location

2020-01-30 Thread Michael Niedermayer
On Sat, Jan 11, 2020 at 02:27:22PM +0100, Michael Niedermayer wrote:
> Fixes: bypassing of checks and assertion failure
> Fixes: asan_1003879.mp4
> 
> Found-by: Clusterfuzz + asan
> Reported-by: Thomas Guilbert 
> Signed-off-by: Michael Niedermayer 
> ---
>  libavformat/mov.c | 4 
>  1 file changed, 4 insertions(+)

will apply

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

He who knows, does not speak. He who speaks, does not know. -- Lao Tsu


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 3/3] tools/target_dec_fuzzer: limit per frame samples for APE

2020-01-30 Thread Michael Niedermayer
On Fri, Jan 10, 2020 at 11:03:53PM +0100, Michael Niedermayer wrote:
> APE in its highest compression mode is really slow so even one frame
> of millions of samples takes a long time
> 
> Fixes: Timeout (too long -> 3sec)
> Fixes: 
> 19937/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5751668818051072
> 
> Signed-off-by: Michael Niedermayer 
> ---
>  tools/target_dec_fuzzer.c | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)

will apply

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

Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato


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/ralf: Fix overflows of biased values

2020-01-30 Thread Michael Niedermayer
On Fri, Dec 27, 2019 at 12:43:25AM +0100, Michael Niedermayer wrote:
> Fixes: signed integer overflow: 2003010644 * 2 cannot be represented in type 
> 'int'
> Fixes: 
> 19593/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RALF_fuzzer-5660628006207488
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/ralf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply

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

No snowflake in an avalanche ever feels responsible. -- 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 3/3] avcodec/x86/diracdsp: Fix incorrect src addressing in dequant_subband_32()

2020-01-30 Thread James Almer
On 1/29/2020 6:55 PM, Michael Niedermayer wrote:
> Fixes: Segfault (not reproducable with asm, which made this hard to debug)
> Fixes: decoding errors
> Fixes: 
> 19854/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5729372837511168
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/x86/diracdsp.asm | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/x86/diracdsp.asm b/libavcodec/x86/diracdsp.asm
> index cc8a26fca5..a18bda113e 100644
> --- a/libavcodec/x86/diracdsp.asm
> +++ b/libavcodec/x86/diracdsp.asm
> @@ -294,8 +294,9 @@ cglobal dequant_subband_32, 7, 7, 4, src, dst, stride, 
> qf, qs, tot_v, tot_h
>  
>  addsrcq, mmsize
>  adddstq, mmsize
> -subtot_hd, 4
> +subtot_hq, 4

tot_h comes from stack, and on Windows x86_64 the higher 32 bits will be
garbage. This should remain as tot_hd, so the sub instruction will
implicitly clear said high bits (if the value could be negative, then
you'd have to sign extend it instead).

>  jg .loop_h
> +leasrcq, [srcq + 4*tot_hq]
>  
>  addr3, strideq
>  dectot_vd
> 

___
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/hlsenc: fix hls_ts_options with mpegts

2020-01-30 Thread Marton Balint



On Wed, 22 Jan 2020, Marton Balint wrote:


Was broken since cdbf8847ea97a985dfd55432e1384bb7fe5d2d3b.


Ping, will apply soon.

Thanks,
Marton



Signed-off-by: Marton Balint 
---
libavformat/hlsenc.c | 36 +---
1 file changed, 17 insertions(+), 19 deletions(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 2b3d3742d9..87b861d437 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -764,6 +764,7 @@ static int hls_mux_init(AVFormatContext *s, VariantStream 
*vs)
AVFormatContext *oc;
AVFormatContext *vtt_oc = NULL;
int byterange_mode = (hls->flags & HLS_SINGLE_FILE) || (hls->max_seg_size > 
0);
+int remaining_options;
int i, ret;

ret = avformat_alloc_output_context2(&vs->avf, vs->oformat, NULL, NULL);
@@ -852,21 +853,25 @@ static int hls_mux_init(AVFormatContext *s, VariantStream 
*vs)
return ret;
}

+av_dict_copy(&options, hls->format_options, 0);
if (hls->segment_type == SEGMENT_TYPE_FMP4) {
-int remaining_options;
-
-av_dict_copy(&options, hls->format_options, 0);
av_dict_set(&options, "fflags", "-autobsf", 0);
av_dict_set(&options, "movflags", "+frag_custom+dash+delay_moov", 
AV_DICT_APPEND);
-ret = avformat_init_output(oc, &options);
-remaining_options = av_dict_count(options);
-av_dict_free(&options);
-if (ret < 0)
-return ret;
-if (remaining_options) {
-av_log(s, AV_LOG_ERROR, "Some of the provided format options are not 
recognized\n");
-return AVERROR(EINVAL);
-}
+} else {
+/* We only require one PAT/PMT per segment. */
+char period[21];
+snprintf(period, sizeof(period), "%d", (INT_MAX / 2) - 1);
+av_dict_set(&options, "sdt_period", period, 0);
+av_dict_set(&options, "pat_period", period, 0);
+}
+ret = avformat_init_output(oc, &options);
+remaining_options = av_dict_count(options);
+av_dict_free(&options);
+if (ret < 0)
+return ret;
+if (remaining_options) {
+av_log(s, AV_LOG_ERROR, "Some of the provided format options are not 
recognized\n");
+return AVERROR(EINVAL);
}
avio_flush(oc->pb);
return 0;
@@ -1683,15 +1688,8 @@ static int hls_start(AVFormatContext *s, VariantStream 
*vs)
}
}
if (c->segment_type != SEGMENT_TYPE_FMP4) {
-/* We only require one PAT/PMT per segment. */
if (oc->oformat->priv_class && oc->priv_data) {
-char period[21];
-
-snprintf(period, sizeof(period), "%d", (INT_MAX / 2) - 1);
-
av_opt_set(oc->priv_data, "mpegts_flags", "resend_headers", 0);
-av_opt_set(oc->priv_data, "sdt_period", period, 0);
-av_opt_set(oc->priv_data, "pat_period", period, 0);
}
if (c->flags & HLS_SINGLE_FILE) {
set_http_options(s, &options, c);
--
2.16.4

___
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 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/vf_ssim: improve precision

2020-01-30 Thread Paul B Mahol
Use doubles for accumulating floats.

Signed-off-by: Paul B Mahol 
---
 libavfilter/ssim.h |  2 +-
 libavfilter/vf_ssim.c  | 18 -
 libavfilter/x86/vf_ssim.asm| 36 ++
 libavfilter/x86/vf_ssim_init.c |  2 +-
 4 files changed, 35 insertions(+), 23 deletions(-)

diff --git a/libavfilter/ssim.h b/libavfilter/ssim.h
index ac0395a22a..a6a41aabe6 100644
--- a/libavfilter/ssim.h
+++ b/libavfilter/ssim.h
@@ -28,7 +28,7 @@ typedef struct SSIMDSPContext {
 void (*ssim_4x4_line)(const uint8_t *buf, ptrdiff_t buf_stride,
   const uint8_t *ref, ptrdiff_t ref_stride,
   int (*sums)[4], int w);
-float (*ssim_end_line)(const int (*sum0)[4], const int (*sum1)[4], int w);
+double (*ssim_end_line)(const int (*sum0)[4], const int (*sum1)[4], int w);
 } SSIMDSPContext;
 
 void ff_ssim_init_x86(SSIMDSPContext *dsp);
diff --git a/libavfilter/vf_ssim.c b/libavfilter/vf_ssim.c
index c08fbcdcc2..17dce8e8e8 100644
--- a/libavfilter/vf_ssim.c
+++ b/libavfilter/vf_ssim.c
@@ -55,13 +55,13 @@ typedef struct SSIMContext {
 uint64_t nb_frames;
 double ssim[4], ssim_total;
 char comps[4];
-float coefs[4];
+double coefs[4];
 uint8_t rgba_map[4];
 int planewidth[4];
 int planeheight[4];
 int *temp;
 int is_rgb;
-float (*ssim_plane)(SSIMDSPContext *dsp,
+double (*ssim_plane)(SSIMDSPContext *dsp,
 uint8_t *main, int main_stride,
 uint8_t *ref, int ref_stride,
 int width, int height, void *temp,
@@ -206,9 +206,9 @@ static float ssim_endn_16bit(const int64_t (*sum0)[4], 
const int64_t (*sum1)[4],
 return ssim;
 }
 
-static float ssim_endn_8bit(const int (*sum0)[4], const int (*sum1)[4], int 
width)
+static double ssim_endn_8bit(const int (*sum0)[4], const int (*sum1)[4], int 
width)
 {
-float ssim = 0.0;
+double ssim = 0.0;
 int i;
 
 for (i = 0; i < width; i++)
@@ -221,14 +221,14 @@ static float ssim_endn_8bit(const int (*sum0)[4], const 
int (*sum1)[4], int widt
 
 #define SUM_LEN(w) (((w) >> 2) + 3)
 
-static float ssim_plane_16bit(SSIMDSPContext *dsp,
+static double ssim_plane_16bit(SSIMDSPContext *dsp,
   uint8_t *main, int main_stride,
   uint8_t *ref, int ref_stride,
   int width, int height, void *temp,
   int max)
 {
 int z = 0, y;
-float ssim = 0.0;
+double ssim = 0.0;
 int64_t (*sum0)[4] = temp;
 int64_t (*sum1)[4] = sum0 + SUM_LEN(width);
 
@@ -249,14 +249,14 @@ static float ssim_plane_16bit(SSIMDSPContext *dsp,
 return ssim / ((height - 1) * (width - 1));
 }
 
-static float ssim_plane(SSIMDSPContext *dsp,
+static double ssim_plane(SSIMDSPContext *dsp,
 uint8_t *main, int main_stride,
 uint8_t *ref, int ref_stride,
 int width, int height, void *temp,
 int max)
 {
 int z = 0, y;
-float ssim = 0.0;
+double ssim = 0.0;
 int (*sum0)[4] = temp;
 int (*sum1)[4] = sum0 + SUM_LEN(width);
 
@@ -288,7 +288,7 @@ static int do_ssim(FFFrameSync *fs)
 SSIMContext *s = ctx->priv;
 AVFrame *master, *ref;
 AVDictionary **metadata;
-float c[4], ssimv = 0.0;
+double c[4], ssimv = 0.0;
 int ret, i;
 
 ret = ff_framesync_dualinput_get(fs, &master, &ref);
diff --git a/libavfilter/x86/vf_ssim.asm b/libavfilter/x86/vf_ssim.asm
index 3293e66701..4cd6293b59 100644
--- a/libavfilter/x86/vf_ssim.asm
+++ b/libavfilter/x86/vf_ssim.asm
@@ -169,8 +169,9 @@ SSIM_4X4_LINE 8
 %endif
 
 INIT_XMM sse4
-cglobal ssim_end_line, 3, 3, 6, sum0, sum1, w
+cglobal ssim_end_line, 3, 3, 7, sum0, sum1, w
 pxor  m0, m0
+pxor  m6, m6
 .loop:
 mova  m1, [sum0q+mmsize*0]
 mova  m2, [sum0q+mmsize*1]
@@ -214,34 +215,45 @@ cglobal ssim_end_line, 3, 3, 6, sum0, sum1, w
 mulps m4, m5
 mulps m3, m1
 divps m4, m3; ssim_endl
-addps m0, m4; ssim
+mova  m5, m4
+cvtps2pd  m3, m5
+movhlps   m5, m5
+cvtps2pd  m5, m5
+addpd m0, m3; ssim
+addpd m6, m5; ssim
 addsum0q, mmsize*4
 addsum1q, mmsize*4
 sub   wd, 4
 jg .loop
 
-; subps the ones we added too much
+; subpd the ones we added too much
 test  wd, wd
 jz .end
 add   wd, 4
+test  wd, 3
+jz .skip3
 test  wd, 2
 jz .skip2
-psrldqm4, 8
-.skip2:
 test  wd, 1
 jz .skip1
-psrldqm4, 4
+.skip3:
+psrldqm5, 8
+subpd  

Re: [FFmpeg-devel] [PATCH 3/3] avcodec/x86/diracdsp: Fix incorrect src addressing in dequant_subband_32()

2020-01-30 Thread Michael Niedermayer
On Thu, Jan 30, 2020 at 05:14:18PM -0300, James Almer wrote:
> On 1/29/2020 6:55 PM, Michael Niedermayer wrote:
> > Fixes: Segfault (not reproducable with asm, which made this hard to debug)
> > Fixes: decoding errors
> > Fixes: 
> > 19854/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5729372837511168
> > 
> > Found-by: continuous fuzzing process 
> > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavcodec/x86/diracdsp.asm | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/libavcodec/x86/diracdsp.asm b/libavcodec/x86/diracdsp.asm
> > index cc8a26fca5..a18bda113e 100644
> > --- a/libavcodec/x86/diracdsp.asm
> > +++ b/libavcodec/x86/diracdsp.asm
> > @@ -294,8 +294,9 @@ cglobal dequant_subband_32, 7, 7, 4, src, dst, stride, 
> > qf, qs, tot_v, tot_h
> >  
> >  addsrcq, mmsize
> >  adddstq, mmsize
> > -subtot_hd, 4
> > +subtot_hq, 4
> 
> tot_h comes from stack, and on Windows x86_64 the higher 32 bits will be
> garbage. This should remain as tot_hd, so the sub instruction will
> implicitly clear said high bits (if the value could be negative, then
> you'd have to sign extend it instead).

well for this to work we need the tot_h value (which is not a multiple of 4
in the case of the bug) after the subtract to correct for that
non mod 4 == 0 case

is this fix below ok ?

diff --git a/libavcodec/x86/diracdsp.asm b/libavcodec/x86/diracdsp.asm
index a18bda113e..17145baf87 100644
--- a/libavcodec/x86/diracdsp.asm
+++ b/libavcodec/x86/diracdsp.asm
@@ -274,7 +274,7 @@ cglobal dequant_subband_32, 7, 7, 4, src, dst, stride, qf, 
qs, tot_v, tot_h
 movd   m3, qsd
 SPLATD m2
 SPLATD m3
-movr4, tot_hq
+movr4d, tot_hd
 movr3, dstq
 
 .loop_v:
 

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

Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato


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] Unable to log into the bug tracker

2020-01-30 Thread Michael Niedermayer
On Thu, Jan 30, 2020 at 08:07:36PM +0100, Alberto Salvia Novella wrote:
> Screencast 

you succeeded in creating your account but it has no verified email address
associated with it.
check your spam folder for a email with a verify link maybe

Thanks

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates


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 3/3] avcodec/x86/diracdsp: Fix incorrect src addressing in dequant_subband_32()

2020-01-30 Thread Carl Eugen Hoyos
Am Mi., 29. Jan. 2020 um 22:56 Uhr schrieb Michael Niedermayer
:
>
> Fixes: Segfault (not reproducable with asm, which made this hard to debug)

without?


> Fixes: decoding errors
> Fixes: 
> 19854/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5729372837511168
>
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/x86/diracdsp.asm | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/x86/diracdsp.asm b/libavcodec/x86/diracdsp.asm
> index cc8a26fca5..a18bda113e 100644
> --- a/libavcodec/x86/diracdsp.asm
> +++ b/libavcodec/x86/diracdsp.asm
> @@ -294,8 +294,9 @@ cglobal dequant_subband_32, 7, 7, 4, src, dst, stride, 
> qf, qs, tot_v, tot_h
>
>  addsrcq, mmsize
>  adddstq, mmsize
> -subtot_hd, 4
> +subtot_hq, 4
>  jg .loop_h
> +leasrcq, [srcq + 4*tot_hq]
>
>  addr3, strideq
>  dectot_vd

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 1/2] avcodec/mpeg12dec: Fix invalid shift in mpeg2_fast_decode_block_intra()

2020-01-30 Thread Carl Eugen Hoyos
Am Do., 26. Dez. 2019 um 03:22 Uhr schrieb Kieran Kunhya :

> Can we not remove this "fast" code? Decoding MPEG-2 is not exactly hard in
> 2019.

The world is not a VAX, or multi-cpu x86-

> Also it has the following comment associated with it:
>
> /**
>  * Note: this function can read out of range and crash for corrupt streams.
>  * Changing this would eat up any speed benefits it has.
>  * Do not use "fast" flag if you need the code to be robust.
>  */
>
> If you want to make it robust you might as well just use the real decode
> function

Is it possible that the comment is wrong?
I seem to remember a change when the issue was last discussed.

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 3/3] avcodec/x86/diracdsp: Fix incorrect src addressing in dequant_subband_32()

2020-01-30 Thread Michael Niedermayer
On Thu, Jan 30, 2020 at 11:11:27PM +0100, Carl Eugen Hoyos wrote:
> Am Mi., 29. Jan. 2020 um 22:56 Uhr schrieb Michael Niedermayer
> :
> >
> > Fixes: Segfault (not reproducable with asm, which made this hard to debug)
> 
> without?

well
i had the testcase from ossfuzz but that didnt reproduce any anomaly at all
and the back traces from ossfuzz from the server where it did crash are
just useless when asm is involved.

so with a bit of guessing and guessing wrong (thought first its alignment)
and more guessing and looking at the asm i modified the C 
implementation to behave like the SSE4 that then allowed reproducing the crash
and seperately after that building a valid testfile which triggers this
codepath to allow testing the fix.
And a few more things here and there
And still theres was a bug left in the fix :(


Thanks

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

It is what and why we do it that matters, not just one of them.


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 3/3] avcodec/x86/diracdsp: Fix incorrect src addressing in dequant_subband_32()

2020-01-30 Thread Michael Niedermayer
On Thu, Jan 30, 2020 at 10:11:05PM +0100, Michael Niedermayer wrote:
> On Thu, Jan 30, 2020 at 05:14:18PM -0300, James Almer wrote:
> > On 1/29/2020 6:55 PM, Michael Niedermayer wrote:
> > > Fixes: Segfault (not reproducable with asm, which made this hard to debug)
> > > Fixes: decoding errors
> > > Fixes: 
> > > 19854/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5729372837511168
> > > 
> > > Found-by: continuous fuzzing process 
> > > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > > Signed-off-by: Michael Niedermayer 
> > > ---
> > >  libavcodec/x86/diracdsp.asm | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/libavcodec/x86/diracdsp.asm b/libavcodec/x86/diracdsp.asm
> > > index cc8a26fca5..a18bda113e 100644
> > > --- a/libavcodec/x86/diracdsp.asm
> > > +++ b/libavcodec/x86/diracdsp.asm
> > > @@ -294,8 +294,9 @@ cglobal dequant_subband_32, 7, 7, 4, src, dst, 
> > > stride, qf, qs, tot_v, tot_h
> > >  
> > >  addsrcq, mmsize
> > >  adddstq, mmsize
> > > -subtot_hd, 4
> > > +subtot_hq, 4
> > 
> > tot_h comes from stack, and on Windows x86_64 the higher 32 bits will be
> > garbage. This should remain as tot_hd, so the sub instruction will
> > implicitly clear said high bits (if the value could be negative, then
> > you'd have to sign extend it instead).
> 
> well for this to work we need the tot_h value (which is not a multiple of 4
> in the case of the bug) after the subtract to correct for that
> non mod 4 == 0 case
> 
> is this fix below ok ?

i succeded to reproduce this and the bugfix below on a netbsd VM, which
unexpectedly seems to be affected by this too

on mingw32/64 no issue is reproducable unless i hack the asm to make one which 
then gets fixed with the code.

i dont want to leave the regression i caused in the tree and go to bed 
so i guess ill apply this. But this issue is cursed and my asm is a bit
rusty so i have a bit an uneasy feeling.
If this fix doesnt fix it for real, dont hesitate to revert it and the
buggy fix before

Thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Any man who breaks a law that conscience tells him is unjust and willingly 
accepts the penalty by staying in jail in order to arouse the conscience of 
the community on the injustice of the law is at that moment expressing the 
very highest respect for law. - Martin Luther King Jr


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/6] avutil/common: use unsigned int in GET_UTF8

2020-01-30 Thread Marton Balint



On Thu, 30 Jan 2020, Paul B Mahol wrote:


bug in commit message, otherwise lgtm


Thanks, pushed the series.

Regards,
Marton
___
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] cmdutils: fix crash if no name for "ffmpeg -h protocol"

2020-01-30 Thread Liu Steven


> 在 2020年1月30日,下午10:03,Jun Zhao  写道:
> 
> From: Jun Zhao 
> 
> fix crash when used the command like:
> - ffmpeg -h protocol
> - ffmpeg -h protocol=
> 
> Signed-off-by: Jun Zhao 
> ---
> fftools/cmdutils.c |8 +++-
> 1 files changed, 7 insertions(+), 1 deletions(-)
> 
> diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
> index 2284631..f0f2b4f 100644
> --- a/fftools/cmdutils.c
> +++ b/fftools/cmdutils.c
> @@ -1872,8 +1872,14 @@ static void show_help_demuxer(const char *name)
> 
> static void show_help_protocol(const char *name)
> {
> -const AVClass *proto_class = avio_protocol_get_class(name);
> +const AVClass *proto_class;
> 
> +if (!name) {
> +av_log(NULL, AV_LOG_ERROR, "No protocol name specified.\n");
> +return;
> +}
> +
> +proto_class = avio_protocol_get_class(name);
> if (!proto_class) {
> av_log(NULL, AV_LOG_ERROR, "Unknown protocol '%s'.\n", name);
> return;
> -- 
> 1.7.1
> 

fix it in avio_protocol_get_class is better than here.
so i have send the other patch to fix this problem.

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



Steven
Thanks



___
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] avformat/protocols: check protocol name before foreach

2020-01-30 Thread Steven Liu
Signed-off-by: Steven Liu 
---
 libavformat/protocols.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/protocols.c b/libavformat/protocols.c
index 29fb99e7fa..c692342132 100644
--- a/libavformat/protocols.c
+++ b/libavformat/protocols.c
@@ -110,6 +110,8 @@ const char *avio_enum_protocols(void **opaque, int output)
 const AVClass *avio_protocol_get_class(const char *name)
 {
 int i = 0;
+if (!name)
+return NULL;
 for (i = 0; url_protocols[i]; i++) {
 if (!strcmp(url_protocols[i]->name, name))
 return url_protocols[i]->priv_data_class;
-- 
2.17.2 (Apple Git-113)



___
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] avfilter/scale: fix CID 1457833

2020-01-30 Thread Gyan Doshi
Remove expressions with constant results and
improve overflow checks.
---
 libavfilter/vf_scale.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c
index 0348f19d33..b6c6414258 100644
--- a/libavfilter/vf_scale.c
+++ b/libavfilter/vf_scale.c
@@ -497,10 +497,8 @@ static int config_props(AVFilterLink *outlink)
scale->force_original_aspect_ratio,
scale->force_divisible_by);
 
-if (scale->w > INT_MAX ||
-scale->h > INT_MAX ||
-(scale->h * inlink->w) > INT_MAX ||
-(scale->w * inlink->h) > INT_MAX)
+if ((scale->h > INT_MAX / inlink->w) ||
+(scale->w > INT_MAX / inlink->h))
 av_log(ctx, AV_LOG_ERROR, "Rescaled value for width or height is too 
big.\n");
 
 outlink->w = scale->w;
-- 
2.24.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".