Re: [FFmpeg-devel] [PATCH] libavcodec/libdavs2.c: Fix for the wrong line size is used

2018-11-24 Thread Steven Liu


> On Oct 9, 2018, at 10:33, Liu Steven  wrote:
> 
> 
> 
>> 在 2018年10月8日,上午10:55,lance.lmw...@gmail.com 写道:
>> 
>> From: Limin Wang 
>> 
>> ---
>> libavcodec/libdavs2.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c
>> index aa14782..91ad7a4 100644
>> --- a/libavcodec/libdavs2.c
>> +++ b/libavcodec/libdavs2.c
>> @@ -88,7 +88,7 @@ static int davs2_dump_frames(AVCodecContext *avctx, 
>> davs2_picture_t *pic,
>>}
>> 
>>frame->data[plane] = frame->buf[plane]->data;
>> -frame->linesize[plane] = pic->widths[plane];
>> +frame->linesize[plane] = size_line;
>> 
>>for (line = 0; line < pic->lines[plane]; ++line)
>>memcpy(frame->data[plane] + line * size_line,
>> -- 
>> 2.6.4
>> 
>> ___
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> LGTM
Pushed.
> 
> Thanks
> 
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Thanks
Steven





___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avfilter/vf_chromashift: Fix mixed declaration and code

2018-11-24 Thread Mark Harris
---
 libavfilter/vf_chromashift.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavfilter/vf_chromashift.c b/libavfilter/vf_chromashift.c
index 068c3c1b68..d073256b99 100644
--- a/libavfilter/vf_chromashift.c
+++ b/libavfilter/vf_chromashift.c
@@ -76,13 +76,14 @@ static int query_formats(AVFilterContext *ctx)
 AV_PIX_FMT_NONE
 };
 const enum AVPixelFormat *pix_fmts;
+AVFilterFormats *fmts_list;
 
 if (!strcmp(ctx->filter->name, "rgbashift"))
 pix_fmts = rgb_pix_fmts;
 else
 pix_fmts = yuv_pix_fmts;
 
-AVFilterFormats *fmts_list = ff_make_format_list(pix_fmts);
+fmts_list = ff_make_format_list(pix_fmts);
 if (!fmts_list)
 return AVERROR(ENOMEM);
 return ff_set_common_formats(ctx, fmts_list);
-- 
2.19.2

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avformat/vivo: Don't log null value

2018-11-24 Thread Mark Harris
---
 libavformat/vivo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/vivo.c b/libavformat/vivo.c
index c9e9c37f37..9b9189f307 100644
--- a/libavformat/vivo.c
+++ b/libavformat/vivo.c
@@ -166,7 +166,7 @@ static int vivo_read_header(AVFormatContext *s)
 value = strchr(key, ':');
 if (!value) {
 av_log(s, AV_LOG_WARNING, "missing colon in key:value pair 
'%s'\n",
-   value);
+   key);
 continue;
 }
 
-- 
2.19.2

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avdevice/decklink_enc: add support for setting genlock timing offset

2018-11-24 Thread Marton Balint
Signed-off-by: Marton Balint 
---
 doc/outdevs.texi| 4 
 libavdevice/decklink_common.cpp | 5 +
 libavdevice/decklink_common_c.h | 1 +
 libavdevice/decklink_enc_c.c| 2 ++
 libavdevice/version.h   | 2 +-
 5 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/doc/outdevs.texi b/doc/outdevs.texi
index 7509ac695d..1fd83c28cc 100644
--- a/doc/outdevs.texi
+++ b/doc/outdevs.texi
@@ -155,6 +155,10 @@ Defaults to @option{0.5}.
 Sets the decklink device duplex mode. Must be @samp{unset}, @samp{half} or 
@samp{full}.
 Defaults to @samp{unset}.
 
+@item timing_offset
+Sets the genlock timing pixel offset on the used output.
+Defaults to @samp{unset}.
+
 @end table
 
 @subsection Examples
diff --git a/libavdevice/decklink_common.cpp b/libavdevice/decklink_common.cpp
index 130e70b2ca..d3cc1eb3d1 100644
--- a/libavdevice/decklink_common.cpp
+++ b/libavdevice/decklink_common.cpp
@@ -171,6 +171,11 @@ int ff_decklink_set_configs(AVFormatContext *avctx,
 if (ret < 0)
 return ret;
 }
+if (direction == DIRECTION_OUT && cctx->timing_offset != INT_MIN) {
+res = ctx->cfg->SetInt(bmdDeckLinkConfigReferenceInputTimingOffset, 
cctx->timing_offset);
+if (res != S_OK)
+av_log(avctx, AV_LOG_WARNING, "Setting timing offset failed.\n");
+}
 return 0;
 }
 
diff --git a/libavdevice/decklink_common_c.h b/libavdevice/decklink_common_c.h
index 8e3bbeb7df..ca85ec2504 100644
--- a/libavdevice/decklink_common_c.h
+++ b/libavdevice/decklink_common_c.h
@@ -57,6 +57,7 @@ struct decklink_cctx {
 int64_t queue_size;
 int copyts;
 int64_t timestamp_align;
+int timing_offset;
 };
 
 #endif /* AVDEVICE_DECKLINK_COMMON_C_H */
diff --git a/libavdevice/decklink_enc_c.c b/libavdevice/decklink_enc_c.c
index 6169078159..63cbd39ecd 100644
--- a/libavdevice/decklink_enc_c.c
+++ b/libavdevice/decklink_enc_c.c
@@ -35,6 +35,8 @@ static const AVOption options[] = {
 { "unset"   ,  NULL , 0   , 
AV_OPT_TYPE_CONST , { .i64 = 0   }, 0, 0, ENC, "duplex_mode"},
 { "half",  NULL , 0   , 
AV_OPT_TYPE_CONST , { .i64 = 1   }, 0, 0, ENC, "duplex_mode"},
 { "full",  NULL , 0   , 
AV_OPT_TYPE_CONST , { .i64 = 2   }, 0, 0, ENC, "duplex_mode"},
+{ "timing_offset", "genlock timing pixel offset", OFFSET(timing_offset), 
AV_OPT_TYPE_INT,   { .i64 = INT_MIN }, INT_MIN, INT_MAX, ENC, "timing_offset"},
+{ "unset"   ,  NULL , 0, 
AV_OPT_TYPE_CONST, { .i64 = INT_MIN },   0,   0, ENC, "timing_offset"},
 { NULL },
 };
 
diff --git a/libavdevice/version.h b/libavdevice/version.h
index edf26bdc1a..e6ae2c44fc 100644
--- a/libavdevice/version.h
+++ b/libavdevice/version.h
@@ -29,7 +29,7 @@
 
 #define LIBAVDEVICE_VERSION_MAJOR  58
 #define LIBAVDEVICE_VERSION_MINOR   6
-#define LIBAVDEVICE_VERSION_MICRO 100
+#define LIBAVDEVICE_VERSION_MICRO 101
 
 #define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \
LIBAVDEVICE_VERSION_MINOR, \
-- 
2.16.4

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] avcodec/tiff: Fix integer overflows in left shift in init_image()

2018-11-24 Thread Michael Niedermayer
On Sat, Nov 24, 2018 at 11:46:36AM +0100, Tomas Härdin wrote:
> fre 2018-11-23 klockan 02:33 +0100 skrev Michael Niedermayer:
> > Fixes: left shift of 255 by 24 places cannot be represented in type 'int'
> > Fixes: 
> > 11377/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5694319101476864
> > 
> > Found-by: continuous fuzzing process 
> > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavcodec/tiff.c | 10 +-
> >  1 file changed, 5 insertions(+), 5 deletions(-)
> > 
> > diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
> > index 6271c937c3..64a3261fd9 100644
> > --- a/libavcodec/tiff.c
> > +++ b/libavcodec/tiff.c
> > @@ -706,7 +706,7 @@ static int init_image(TiffContext *s, ThreadFrame 
> > *frame)
> >  s->avctx->pix_fmt = s->palette_is_set ? AV_PIX_FMT_PAL8 : 
> > AV_PIX_FMT_GRAY8;
> >  break;
> >  case 10081:
> > -switch (s->pattern[0] | (s->pattern[1] << 8) | (s->pattern[2] << 
> > 16) | (s->pattern[3] << 24)) {
> > +switch (s->pattern[0] | (s->pattern[1] << 8) | (s->pattern[2] << 
> > 16) | ((unsigned)s->pattern[3] << 24)) {
> >  case 0x02010100:
> >  s->avctx->pix_fmt = AV_PIX_FMT_BAYER_RGGB8;
> >  break;
> > @@ -721,7 +721,7 @@ static int init_image(TiffContext *s, ThreadFrame 
> > *frame)
> >  break;
> >  default:
> >  av_log(s->avctx, AV_LOG_ERROR, "Unsupported Bayer pattern: 
> > 0x%X\n",
> > -   s->pattern[0] | s->pattern[1] << 8 | s->pattern[2] << 
> > 16 | s->pattern[3] << 24);
> > +   s->pattern[0] | s->pattern[1] << 8 | s->pattern[2] << 
> > 16 | (unsigned)s->pattern[3] << 24);
> >  return AVERROR_PATCHWELCOME;
> >  }
> >  break;
> > @@ -741,12 +741,12 @@ static int init_image(TiffContext *s, ThreadFrame 
> > *frame)
> >  break;
> >  default:
> >  av_log(s->avctx, AV_LOG_ERROR, "Unsupported Bayer pattern: 
> > 0x%X\n",
> > -   s->pattern[0] | s->pattern[1] << 8 | s->pattern[2] << 
> > 16 | s->pattern[3] << 24);
> > +   s->pattern[0] | s->pattern[1] << 8 | s->pattern[2] << 
> > 16 | (unsigned)s->pattern[3] << 24);
> >  return AVERROR_PATCHWELCOME;
> >  }
> >  break;
> >  case 10161:
> > -switch (s->pattern[0] | s->pattern[1] << 8 | s->pattern[2] << 16 | 
> > s->pattern[3] << 24) {
> > +switch (s->pattern[0] | s->pattern[1] << 8 | s->pattern[2] << 16 | 
> > (unsigned)s->pattern[3] << 24) {
> >  case 0x02010100:
> >  s->avctx->pix_fmt = s->le ? AV_PIX_FMT_BAYER_RGGB16LE : 
> > AV_PIX_FMT_BAYER_RGGB16BE;
> >  break;
> > @@ -761,7 +761,7 @@ static int init_image(TiffContext *s, ThreadFrame 
> > *frame)
> >  break;
> >  default:
> >  av_log(s->avctx, AV_LOG_ERROR, "Unsupported Bayer pattern: 
> > 0x%X\n",
> > -   s->pattern[0] | s->pattern[1] << 8 | s->pattern[2] << 
> > 16 | s->pattern[3] << 24);
> > +   s->pattern[0] | s->pattern[1] << 8 | s->pattern[2] << 
> > 16 | (unsigned)s->pattern[3] << 24);
> >  return AVERROR_PATCHWELCOME;
> >  }
> >  break;
> 
> So fixing undefined behavior mostly? A function might make this nicer
> looking, else there's not much to say

yes, indeed, ill post a patch doing that

thx

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

Freedom in capitalist society always remains about the same as it was in
ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/2] avcodec/tiff: Limit filtering to decoded data

2018-11-24 Thread Michael Niedermayer
On Sat, Nov 24, 2018 at 11:44:42AM +0100, Tomas Härdin wrote:
> fre 2018-11-23 klockan 02:33 +0100 skrev Michael Niedermayer:
> > Fixes: Timeout
> > Fixes: 
> > 11068/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5698456681709568
> > 
> > Found-by: continuous fuzzing process 
> > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavcodec/tiff.c | 9 ++---
> >  1 file changed, 6 insertions(+), 3 deletions(-)
> > 
> > diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
> > index 74b76c9fdf..6271c937c3 100644
> > --- a/libavcodec/tiff.c
> > +++ b/libavcodec/tiff.c
> > @@ -1421,6 +1421,7 @@ again:
> >  planes = s->planar ? s->bppcount : 1;
> >  for (plane = 0; plane < planes; plane++) {
> >  int remaining = avpkt->size;
> > +int decoded_height;
> >  stride = p->linesize[plane];
> >  dst = p->data[plane];
> >  for (i = 0; i < s->height; i += s->rps) {
> > @@ -1448,6 +1449,8 @@ again:
> >  break;
> >  }
> >  }
> > +decoded_height = FFMIN(i, s->height);
> > +
> >  if (s->predictor == 2) {
> >  if (s->photometric == TIFF_PHOTOMETRIC_YCBCR) {
> >  av_log(s->avctx, AV_LOG_ERROR, "predictor == 2 with YUV is 
> > unsupported");
> > @@ -1464,7 +1467,7 @@ again:
> >  s->avctx->pix_fmt == AV_PIX_FMT_YA16LE ||
> >  s->avctx->pix_fmt == AV_PIX_FMT_GBRP16LE ||
> >  s->avctx->pix_fmt == AV_PIX_FMT_GBRAP16LE) {
> > -for (i = 0; i < s->height; i++) {
> > +for (i = 0; i < decoded_height; i++) {
> >  for (j = soff; j < ssize; j += 2)
> >  AV_WL16(dst + j, AV_RL16(dst + j) + AV_RL16(dst + 
> > j - soff));
> >  dst += stride;
> > @@ -1475,13 +1478,13 @@ again:
> > s->avctx->pix_fmt == AV_PIX_FMT_YA16BE ||
> > s->avctx->pix_fmt == AV_PIX_FMT_GBRP16BE ||
> > s->avctx->pix_fmt == AV_PIX_FMT_GBRAP16BE) {
> > -for (i = 0; i < s->height; i++) {
> > +for (i = 0; i < decoded_height; i++) {
> >  for (j = soff; j < ssize; j += 2)
> >  AV_WB16(dst + j, AV_RB16(dst + j) + AV_RB16(dst + 
> > j - soff));
> >  dst += stride;
> >  }
> >  } else {
> > -for (i = 0; i < s->height; i++) {
> > +for (i = 0; i < decoded_height; i++) {
> >  for (j = soff; j < ssize; j++)
> >  dst[j] += dst[j - soff];
> >  dst += stride;
> 
> Looks OK

will apply

thanks

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

There will always be a question for which you do not know the correct answer.


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH]configure: Disable direct stripping on sunos.

2018-11-24 Thread Carl Eugen Hoyos
2018-11-18 4:29 GMT+01:00, Carl Eugen Hoyos :

> Attached patch simplifies building on sunos (which is currently broken
> due to the sed call).

Patch applied.

Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH]configure: Add -Wno-char-subscripts

2018-11-24 Thread Carl Eugen Hoyos
2018-11-18 23:25 GMT+01:00, Tomas Härdin :
> sön 2018-11-18 klockan 04:40 +0100 skrev Carl Eugen Hoyos:
>> Hi!
>>
>> On systems with signed char, the compiler cannot distinguish between
>> (intended) int8_t used as subscript and unintended char, therefore the
>> warning doesn't help.
>
> Is this done anywhere in the codebase currently?

> Either way, probably a good idea

Patch applied, Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 1/2] ffplay: convert float math to int math in calculate_display_rect

2018-11-24 Thread Marton Balint
Signed-off-by: Marton Balint 
---
 fftools/ffplay.c | 18 +++---
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/fftools/ffplay.c b/fftools/ffplay.c
index ab1f9faccf..af72fbcc38 100644
--- a/fftools/ffplay.c
+++ b/fftools/ffplay.c
@@ -861,24 +861,20 @@ static void calculate_display_rect(SDL_Rect *rect,
int scr_xleft, int scr_ytop, int scr_width, 
int scr_height,
int pic_width, int pic_height, AVRational 
pic_sar)
 {
-float aspect_ratio;
-int width, height, x, y;
+AVRational aspect_ratio = pic_sar;
+int64_t width, height, x, y;
 
-if (pic_sar.num == 0)
-aspect_ratio = 0;
-else
-aspect_ratio = av_q2d(pic_sar);
+if (av_cmp_q(aspect_ratio, av_make_q(0, 1)) <= 0)
+aspect_ratio = av_make_q(1, 1);
 
-if (aspect_ratio <= 0.0)
-aspect_ratio = 1.0;
-aspect_ratio *= (float)pic_width / (float)pic_height;
+aspect_ratio = av_mul_q(aspect_ratio, av_make_q(pic_width, pic_height));
 
 /* XXX: we suppose the screen has a 1.0 pixel ratio */
 height = scr_height;
-width = lrint(height * aspect_ratio) & ~1;
+width = av_rescale(height, aspect_ratio.num, aspect_ratio.den) & ~1;
 if (width > scr_width) {
 width = scr_width;
-height = lrint(width / aspect_ratio) & ~1;
+height = av_rescale(width, aspect_ratio.den, aspect_ratio.num) & ~1;
 }
 x = (scr_width - width) / 2;
 y = (scr_height - height) / 2;
-- 
2.16.4

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 2/2] ffplay: fix -x and -y options when only one of them is used

2018-11-24 Thread Marton Balint
Previously if only -y was used then nothing happened, if only -x then zero
window height was set which is undefined in SDL and caused a black window.

From now on if only one dimension is set we calculate the other based on
size/aspect of the shown content.

Signed-off-by: Marton Balint 
---
 fftools/ffplay.c | 15 +++
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/fftools/ffplay.c b/fftools/ffplay.c
index af72fbcc38..c5a4746ef4 100644
--- a/fftools/ffplay.c
+++ b/fftools/ffplay.c
@@ -1322,7 +1322,11 @@ static void sigterm_handler(int sig)
 static void set_default_window_size(int width, int height, AVRational sar)
 {
 SDL_Rect rect;
-calculate_display_rect(&rect, 0, 0, INT_MAX, height, width, height, sar);
+int max_width  = screen_width  ? screen_width  : INT_MAX;
+int max_height = screen_height ? screen_height : INT_MAX;
+if (max_width == INT_MAX && max_height == INT_MAX)
+max_height = height;
+calculate_display_rect(&rect, 0, 0, max_width, max_height, width, height, 
sar);
 default_width  = rect.w;
 default_height = rect.h;
 }
@@ -1331,13 +1335,8 @@ static int video_open(VideoState *is)
 {
 int w,h;
 
-if (screen_width) {
-w = screen_width;
-h = screen_height;
-} else {
-w = default_width;
-h = default_height;
-}
+w = screen_width ? screen_width : default_width;
+h = screen_height ? screen_height : default_height;
 
 if (!window_title)
 window_title = input_filename;
-- 
2.16.4

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Fixes for audio/L16

2018-11-24 Thread Carl Eugen Hoyos
2018-11-24 10:27 GMT+01:00, Igor Derzhavin :

> Do you accept these patches? Or what can I do more?
> We use ffmpeg (libavformat/libavcodec) within our company and came across
> that http url with content type
> "audio/l16;rate=24000;channels=1;endianness=big-endian" incorrectly opens
> as s16le with sample rate 16000.

(Wasn't that my question to you?)

Patches applied, thank you very much!

Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] avcodec/proresaw_enc : improvment (vendor and color properties, 4444Xq)

2018-11-24 Thread Martin Vignali
Hello,

Patch in attach add some improvments to prores aw encoder

012 : Add vendor option (code come from prores_ks encoder)
013 : Only write color properties, if defined in rdd36 (other values are
"converted" to unspecified)
014 : Add  XQ encoding support

Martin


0012-avcodec-prores_aw-add-vendor-option.patch
Description: Binary data


0014-avcodec-prores_aw-add--xq-support.patch
Description: Binary data


0013-avcodec-prores_aw-only-set-color-prim-trc-space.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avutil/mem: Fix invalid use of av_alloc_size

2018-11-24 Thread Mark Harris
The alloc_size attribute is valid only on functions that return a
pointer.  GCC 9 (not yet released) warns about invalid usage:

./libavutil/mem.h:342:1: warning: 'alloc_size' attribute ignored on a function 
returning int' [-Wattributes]
  342 | av_alloc_size(2, 3) int av_reallocp_array(void *ptr, size_t nmemb, 
size_t size);
  | ^
---
 libavutil/mem.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/mem.h b/libavutil/mem.h
index 55ae573ac9..5fb1a02dd9 100644
--- a/libavutil/mem.h
+++ b/libavutil/mem.h
@@ -339,7 +339,7 @@ av_alloc_size(2, 3) void *av_realloc_array(void *ptr, 
size_t nmemb, size_t size)
  * @warning Unlike av_malloc(), the allocated memory is not guaranteed to be
  *  correctly aligned.
  */
-av_alloc_size(2, 3) int av_reallocp_array(void *ptr, size_t nmemb, size_t 
size);
+int av_reallocp_array(void *ptr, size_t nmemb, size_t size);
 
 /**
  * Reallocate the given buffer if it is not large enough, otherwise do nothing.
-- 
2.19.2

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] avcodec/proresdec : add 12b decoding support

2018-11-24 Thread Reto Kromer
Martin Vignali wrote:

>Only enable 12b decoding if the codec tag is Prores  or XQ
>let 10b decoding for 422 codecs tag.

Indeed! Best regards, Reto

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] avcodec/proresdec : add 12b decoding support

2018-11-24 Thread Martin Vignali
Hello,

New patchs in attach (002 to 010 unchanged)
011 : Remove user option for setting decoding precision
Only enable 12b decoding if the codec tag is Prores  or XQ
let 10b decoding for 422 codecs tag.

Martin


0006-avcodec-proresdec-put-unpack-alpha-func-in-prores-ct.patch
Description: Binary data


0002-avcodec-proresdsp-remove-unused-value.patch
Description: Binary data


0004-avcodec-proresdec-rename-dsp-part-for-10b-and-check-.patch
Description: Binary data


0003-avcodec-proresdec-move-dsp-init-after-codec-tag-chec.patch
Description: Binary data


0005-avcodec-proresdsp-indent-after-prev-commit.patch
Description: Binary data


0009-avcodec-proresdec-add-12b-prores-idct.patch
Description: Binary data


0007-avcodec-proresdec-make-inline-func-for-unpack-alpha.patch
Description: Binary data


0008-avcodec-proresdec-add-unpack-alpha-12-func.patch
Description: Binary data


0010-avcodec-proresdec-align-height-buffer-to-16-avoid-se.patch
Description: Binary data


0011-avcodec-proresdec-add-12b-decoding.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/2] os_support: djgpp: define socket shutdown SHUT_xxx macros

2018-11-24 Thread Dave Yeo

On 11/24/18 04:37 AM, Peter Ross wrote:

---
two more patches concerning networking.

i will push the other existing djgpp patches soon.

 libavformat/os_support.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/os_support.h b/libavformat/os_support.h
index 7a56dc9a7c..3c3e37fb7c 100644
--- a/libavformat/os_support.h
+++ b/libavformat/os_support.h
@@ -76,7 +76,7 @@ static inline int is_dos_path(const char *path)
 return 0;
 }

-#if defined(__OS2__)
+#if defined(__OS2__) || defined(__DJGPP__)
 #define SHUT_RD 0
 #define SHUT_WR 1
 #define SHUT_RDWR 2


Perhaps, for future proofing
-#if defined(__OS2__)
+#if !defined(SHUT_RD)
 #define SHUT_RD 0
 #define SHUT_WR 1
 #define SHUT_RDWR 2

Works fine here on OS/2 and these macros may be added to the headers at 
some point.

Dave
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] fate/prores metadata : Make output bit exact

2018-11-24 Thread Martin Vignali
Hello,

Patch in attach fix prores-metadata test
add bitexact mode, to avoid to write encoder in target mov

Martin


0001-fate-prores-metadata-make-output-bit-exact.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [RFC] VDD FFmpeg session and community survey

2018-11-24 Thread Tomas Härdin
tor 2018-11-22 klockan 21:58 + skrev Rostislav Pehlivanov:
> > On Thu, 22 Nov 2018 at 19:02, Thilo Borgmann  wrote:
> +The vote has to implement a direct, free, equal and secret election.
> > +The results are to be publicly available.
> > +The election should be completed not later than the end of the ongoing 
> > period.
> > +Any community member can call on itself or any other person to be a 
> > candidate for an election.
> 
> What if a majority of the committee is biased and bans everyone they
> disagree with to take over the project? They certainly could.
> What if the committee's decision is something the majority of the
> developers disagree with?
> 
> This is why I'm against formalizing such prodecures. They're too inflexible
> and absolute, and end up being abused or overused (like videolan's weekly
> temporary bannings I've heard of).
> Furthermore why do you bring this up now at all? We haven't had accidents
> of this nature in quite some time. In fact the last time it was the ML
> admin's random incorrect decision to block a discussion which ended up
> being a problem that everyone disagreed with. And that was 11 months ago.

The point of stuff like this is to have something in place *before*
nasty things happen. Coming from a country with a strong non-profit
organization culture (Sweden), it's actually quite striking how little
"everyday democracy" experience a lot of free software people seem to
have.

While I'm in here I have a small suggestion: talking is better than
writing when it comes to interpersonal conflicts. Using Mumble or
Jingle or whatever and getting the relevant people to talk can be a
good way to avoid more drastic measures. Unless of course someone's
just being an ass to be an ass, but I haven't noticed that yet on here.

/Tomas
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] avutil - swscale : add YUVA444P12 and YUVA422P12

2018-11-24 Thread Martin Vignali
> > +AV_PIX_FMT_YUVA422P12BE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb
> sample per 2x1 Y samples), 12b alpha, big-endian
> > +AV_PIX_FMT_YUVA422P12LE, ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb
> sample per 2x1 Y samples), 12b alpha,  little-endian
> > +AV_PIX_FMT_YUVA444P12BE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb
> sample per 1x1 Y samples), 12b alpha,  big-endian
> > +AV_PIX_FMT_YUVA444P12LE, ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb
> sample per 1x1 Y samples), 12b alpha,  little-endian
>
> vertical align
>
> > Subject: [PATCH 2/2] swscale : add support for YUVA444p12 and YUVA422P12
> ^
> typo
>
> besides these, if you checked that the output is vissually looking correct
> then the patchset should be ok
>
> thx
>
>
Fix and pushed, thanks.

Martin
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [RFC] VDD FFmpeg session and community survey

2018-11-24 Thread René J . V . Bertin
Hi,

I have had my ML subscriptions set to not receive emails for a few years now. 
So when I got the invitation to vote (which I don't consider Spam btw) my first 
reflex was to confirm that I do not have any current issues with perceived 
hostility in the community.

Then, when I checked the few replies to this thread before replying myself to 
explain my vote (and suggest that maybe this survey shouldn't have gone out to 
inactive members) I wondered if I shouldn't have voted yes...

R
(back to lurking in the shadows)
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 2/2] configure: use watt socket library instead of libsocket library for djgpp builds

2018-11-24 Thread Peter Ross
rational:

libsocket development ceased in 2001. it only ever worked using windows virtual 
dos mode.
http://rich.phekda.org/richdawe/lsck/lsck_lnk.htm

watt-32 is maintained. it can work using dos or using windows virtual dos mode.
http://www.watt-32.net/
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index d3c036f82a..de71b806b9 100755
--- a/configure
+++ b/configure
@@ -5293,7 +5293,7 @@ case $target_os in
 add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
 ;;
 *-dos|freedos|opendos)
-network_extralibs="-lsocket"
+network_extralibs="-lwatt"
 objformat="coff"
 enable dos_paths
 ;;
-- 
2.17.1

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 1/2] os_support: djgpp: define socket shutdown SHUT_xxx macros

2018-11-24 Thread Peter Ross
---
two more patches concerning networking.

i will push the other existing djgpp patches soon.

 libavformat/os_support.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/os_support.h b/libavformat/os_support.h
index 7a56dc9a7c..3c3e37fb7c 100644
--- a/libavformat/os_support.h
+++ b/libavformat/os_support.h
@@ -76,7 +76,7 @@ static inline int is_dos_path(const char *path)
 return 0;
 }
 
-#if defined(__OS2__)
+#if defined(__OS2__) || defined(__DJGPP__)
 #define SHUT_RD 0
 #define SHUT_WR 1
 #define SHUT_RDWR 2
-- 
2.17.1

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] avcodec/tiff: Fix integer overflows in left shift in init_image()

2018-11-24 Thread Tomas Härdin
fre 2018-11-23 klockan 02:33 +0100 skrev Michael Niedermayer:
> Fixes: left shift of 255 by 24 places cannot be represented in type 'int'
> Fixes: 
> 11377/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5694319101476864
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/tiff.c | 10 +-
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
> index 6271c937c3..64a3261fd9 100644
> --- a/libavcodec/tiff.c
> +++ b/libavcodec/tiff.c
> @@ -706,7 +706,7 @@ static int init_image(TiffContext *s, ThreadFrame *frame)
>  s->avctx->pix_fmt = s->palette_is_set ? AV_PIX_FMT_PAL8 : 
> AV_PIX_FMT_GRAY8;
>  break;
>  case 10081:
> -switch (s->pattern[0] | (s->pattern[1] << 8) | (s->pattern[2] << 16) 
> | (s->pattern[3] << 24)) {
> +switch (s->pattern[0] | (s->pattern[1] << 8) | (s->pattern[2] << 16) 
> | ((unsigned)s->pattern[3] << 24)) {
>  case 0x02010100:
>  s->avctx->pix_fmt = AV_PIX_FMT_BAYER_RGGB8;
>  break;
> @@ -721,7 +721,7 @@ static int init_image(TiffContext *s, ThreadFrame *frame)
>  break;
>  default:
>  av_log(s->avctx, AV_LOG_ERROR, "Unsupported Bayer pattern: 
> 0x%X\n",
> -   s->pattern[0] | s->pattern[1] << 8 | s->pattern[2] << 16 
> | s->pattern[3] << 24);
> +   s->pattern[0] | s->pattern[1] << 8 | s->pattern[2] << 16 
> | (unsigned)s->pattern[3] << 24);
>  return AVERROR_PATCHWELCOME;
>  }
>  break;
> @@ -741,12 +741,12 @@ static int init_image(TiffContext *s, ThreadFrame 
> *frame)
>  break;
>  default:
>  av_log(s->avctx, AV_LOG_ERROR, "Unsupported Bayer pattern: 
> 0x%X\n",
> -   s->pattern[0] | s->pattern[1] << 8 | s->pattern[2] << 16 
> | s->pattern[3] << 24);
> +   s->pattern[0] | s->pattern[1] << 8 | s->pattern[2] << 16 
> | (unsigned)s->pattern[3] << 24);
>  return AVERROR_PATCHWELCOME;
>  }
>  break;
>  case 10161:
> -switch (s->pattern[0] | s->pattern[1] << 8 | s->pattern[2] << 16 | 
> s->pattern[3] << 24) {
> +switch (s->pattern[0] | s->pattern[1] << 8 | s->pattern[2] << 16 | 
> (unsigned)s->pattern[3] << 24) {
>  case 0x02010100:
>  s->avctx->pix_fmt = s->le ? AV_PIX_FMT_BAYER_RGGB16LE : 
> AV_PIX_FMT_BAYER_RGGB16BE;
>  break;
> @@ -761,7 +761,7 @@ static int init_image(TiffContext *s, ThreadFrame *frame)
>  break;
>  default:
>  av_log(s->avctx, AV_LOG_ERROR, "Unsupported Bayer pattern: 
> 0x%X\n",
> -   s->pattern[0] | s->pattern[1] << 8 | s->pattern[2] << 16 
> | s->pattern[3] << 24);
> +   s->pattern[0] | s->pattern[1] << 8 | s->pattern[2] << 16 
> | (unsigned)s->pattern[3] << 24);
>  return AVERROR_PATCHWELCOME;
>  }
>  break;

So fixing undefined behavior mostly? A function might make this nicer
looking, else there's not much to say

/Tomas
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/2] avcodec/tiff: Limit filtering to decoded data

2018-11-24 Thread Tomas Härdin
fre 2018-11-23 klockan 02:33 +0100 skrev Michael Niedermayer:
> Fixes: Timeout
> Fixes: 
> 11068/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-5698456681709568
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/tiff.c | 9 ++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
> index 74b76c9fdf..6271c937c3 100644
> --- a/libavcodec/tiff.c
> +++ b/libavcodec/tiff.c
> @@ -1421,6 +1421,7 @@ again:
>  planes = s->planar ? s->bppcount : 1;
>  for (plane = 0; plane < planes; plane++) {
>  int remaining = avpkt->size;
> +int decoded_height;
>  stride = p->linesize[plane];
>  dst = p->data[plane];
>  for (i = 0; i < s->height; i += s->rps) {
> @@ -1448,6 +1449,8 @@ again:
>  break;
>  }
>  }
> +decoded_height = FFMIN(i, s->height);
> +
>  if (s->predictor == 2) {
>  if (s->photometric == TIFF_PHOTOMETRIC_YCBCR) {
>  av_log(s->avctx, AV_LOG_ERROR, "predictor == 2 with YUV is 
> unsupported");
> @@ -1464,7 +1467,7 @@ again:
>  s->avctx->pix_fmt == AV_PIX_FMT_YA16LE ||
>  s->avctx->pix_fmt == AV_PIX_FMT_GBRP16LE ||
>  s->avctx->pix_fmt == AV_PIX_FMT_GBRAP16LE) {
> -for (i = 0; i < s->height; i++) {
> +for (i = 0; i < decoded_height; i++) {
>  for (j = soff; j < ssize; j += 2)
>  AV_WL16(dst + j, AV_RL16(dst + j) + AV_RL16(dst + j 
> - soff));
>  dst += stride;
> @@ -1475,13 +1478,13 @@ again:
> s->avctx->pix_fmt == AV_PIX_FMT_YA16BE ||
> s->avctx->pix_fmt == AV_PIX_FMT_GBRP16BE ||
> s->avctx->pix_fmt == AV_PIX_FMT_GBRAP16BE) {
> -for (i = 0; i < s->height; i++) {
> +for (i = 0; i < decoded_height; i++) {
>  for (j = soff; j < ssize; j += 2)
>  AV_WB16(dst + j, AV_RB16(dst + j) + AV_RB16(dst + j 
> - soff));
>  dst += stride;
>  }
>  } else {
> -for (i = 0; i < s->height; i++) {
> +for (i = 0; i < decoded_height; i++) {
>  for (j = soff; j < ssize; j++)
>  dst[j] += dst[j - soff];
>  dst += stride;

Looks OK

/Tomas
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat: add DHAV demuxer

2018-11-24 Thread Paul B Mahol
On 11/23/18, Paul B Mahol  wrote:
> Signed-off-by: Paul B Mahol 
> ---
>  libavformat/Makefile |   1 +
>  libavformat/allformats.c |   1 +
>  libavformat/dhav.c   | 250 +++
>  3 files changed, 252 insertions(+)
>  create mode 100644 libavformat/dhav.c
>

Will apply very soon.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Fixes for audio/L16

2018-11-24 Thread Paul B Mahol
On 11/22/18, Igor Derzhavin  wrote:
> Hello!
> A little bunch of fixes for audio/L16 mime type handling:
> 0001 - RFC 2045 says MIME type should be case insensitive;
> 0002 - RFC 2586 says audio/L16 should be in network byte order (aka big
> endian);
> 0003 - though "endiannes" parameter not in RFC it is widely used;
>

LGTM, tell Carl to apply it.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v2] swscale/output: Altivec-optimize yuv2plane1_8

2018-11-24 Thread Lauri Kasanen
On Fri, 23 Nov 2018 23:01:02 +0100
Michael Niedermayer  wrote:

> On Fri, Nov 23, 2018 at 10:38:13AM +0200, Lauri Kasanen wrote:
> > I mean, if my patch adds no failures, is that enough to apply it?
> 
> yes that and the tests failing should still fail the same way with the
> same checksums
> This of course assumes noone finds an issue in the patch

Okay, ran both with -k. No new failures, and fate-rv20-1239 failed with
the same checksums in both cases. That was the only failing test, did
not try with THREADS.

Curiously "make CPUFLAGS=0 fate-rv20-1239" also fails, so it's not
Altivec code that breaks that test, but C (?).

- Lauri
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Fixes for audio/L16

2018-11-24 Thread Igor Derzhavin
Hello!
Do you accept these patches? Or what can I do more?
We use ffmpeg (libavformat/libavcodec) within our company and came across
that http url with content type
"audio/l16;rate=24000;channels=1;endianness=big-endian" incorrectly opens
as s16le with sample rate 16000.
This patches fixes that.

On Thu, Nov 22, 2018 at 4:45 PM Igor Derzhavin 
wrote:

> No, I don't now applications that can play pcm streams through HTTP. VLC
> misdetect such streams as mp3, and there is a two years old bug
> https://trac.videolan.org/vlc/ticket/17229.
>
> On Thu, Nov 22, 2018 at 4:00 PM Carl Eugen Hoyos 
> wrote:
>
>> 2018-11-22 10:16 GMT+01:00, Igor Derzhavin :
>>
>> > A little bunch of fixes for audio/L16 mime type handling:
>> > 0001 - RFC 2045 says MIME type should be case insensitive;
>> > 0002 - RFC 2586 says audio/L16 should be in network byte order (aka big
>> > endian);
>> > 0003 - though "endiannes" parameter not in RFC it is widely used;
>>
>> Great, did you test this with any other application?
>>
>> Thank you, Carl Eugen
>> ___
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel