[FFmpeg-cvslog] avfilter/vf_delogo: round to the closest value

2015-12-09 Thread Jean Delvare
ffmpeg | branch: master | Jean Delvare  | Wed Dec  9 12:07:47 
2015 +0100| [e74f1a121e94587d0df8a7f5a12f2d48a974695c] | committer: Michael 
Niedermayer

avfilter/vf_delogo: round to the closest value

When the interpolated value is divided by the sum of weights, no
rounding is done, which means the value is truncated. This results in
a slight bias towards dark green in the interpolated area. Rounding
properly removes the bias.

I measured this change to reduce the interpolation error by 1 to 2 %
on average on a number of sample input and logo area combinations.

Signed-off-by: Jean Delvare 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e74f1a121e94587d0df8a7f5a12f2d48a974695c
---

 libavfilter/vf_delogo.c  |5 +-
 tests/ref/fate/filter-delogo |  218 +-
 2 files changed, 112 insertions(+), 111 deletions(-)

diff --git a/libavfilter/vf_delogo.c b/libavfilter/vf_delogo.c
index c7fb6e3..1b8e408 100644
--- a/libavfilter/vf_delogo.c
+++ b/libavfilter/vf_delogo.c
@@ -61,7 +61,7 @@ static void apply_delogo(uint8_t *dst, int dst_linesize,
  unsigned int band, int show, int direct)
 {
 int x, y;
-uint64_t interp, weightl, weightr, weightt, weightb;
+uint64_t interp, weightl, weightr, weightt, weightb, weight;
 uint8_t *xdst, *xsrc;
 
 uint8_t *topleft, *botleft, *topright;
@@ -125,7 +125,8 @@ static void apply_delogo(uint8_t *dst, int dst_linesize,
 (botleft[x-logo_x1]+
  botleft[x-logo_x1-1]  +
  botleft[x-logo_x1+1]) * weightb;
-interp /= (weightl + weightr + weightt + weightb) * 3U;
+weight = (weightl + weightr + weightt + weightb) * 3U;
+interp = ROUNDED_DIV(interp, weight);
 
 if (y >= logo_y+band && y < logo_y+logo_h-band &&
 x >= logo_x+band && x < logo_x+logo_w-band) {
diff --git a/tests/ref/fate/filter-delogo b/tests/ref/fate/filter-delogo
index a39bdc5..bf2b751 100644
--- a/tests/ref/fate/filter-delogo
+++ b/tests/ref/fate/filter-delogo
@@ -1,110 +1,110 @@
 #tb 0: 32768/982057
-0,  0,  0,1,   126720, 0xd975ec13
-0,  1,  1,1,   126720, 0xae91ecb1
-0,  2,  2,1,   126720, 0xae91ecb1
-0,  3,  3,1,   126720, 0xae91ecb1
-0,  4,  4,1,   126720, 0x6b51ecf3
-0,  5,  5,1,   126720, 0x3015f463
-0,  6,  6,1,   126720, 0x68eaf4a3
-0,  7,  7,1,   126720, 0xd68bf483
-0,  8,  8,1,   126720, 0xa8c0b7e3
-0,  9,  9,1,   126720, 0x1bf4b8a3
-0, 10, 10,1,   126720, 0x1546b8e3
-0, 11, 11,1,   126720, 0x9ac0b8c7
-0, 12, 12,1,   126720, 0x7de8b913
-0, 13, 13,1,   126720, 0xfd78bb83
-0, 14, 14,1,   126720, 0x5bd9bc03
-0, 15, 15,1,   126720, 0xa6eebba7
-0, 16, 16,1,   126720, 0x42e4b8f3
-0, 17, 17,1,   126720, 0xd97fadf0
-0, 18, 18,1,   126720, 0xf28299ce
-0, 19, 19,1,   126720, 0x9843a809
-0, 20, 20,1,   126720, 0x619aba40
-0, 21, 21,1,   126720, 0xe216a860
-0, 22, 22,1,   126720, 0xe2ccab69
-0, 23, 23,1,   126720, 0x4e2caa85
-0, 24, 24,1,   126720, 0x11c9bca0
-0, 25, 25,1,   126720, 0xc13da72d
-0, 26, 26,1,   126720, 0x894fed60
-0, 27, 27,1,   126720, 0xa3f0b765
-0, 28, 28,1,   126720, 0x645d06eb
-0, 29, 29,1,   126720, 0xfcfd88a8
-0, 30, 30,1,   126720, 0xe73704a2
-0, 31, 31,1,   126720, 0xa548bdf5
-0, 32, 32,1,   126720, 0x2b0207b7
-0, 33, 33,1,   126720, 0x8fd6d84c
-0, 34, 34,1,   126720, 0x1c1fde83
-0, 35, 35,1,   126720, 0x1b69afd3
-0, 36, 36,1,   126720, 0x8c487b48
-0, 37, 37,1,   126720, 0x0e0fb90a
-0, 38, 38,1,   126720, 0x0b6ba745
-0, 39, 39,1,   126720, 0xfe09d22e
-0, 40, 40,1,   126720, 0x686bff72
-0, 41, 41,1,   126720, 0x5b7e4f75
-0, 42, 42,1,   126720, 0x8fa61ee2
-0, 43, 43,1,   126720, 0xa26462ef
-0, 44, 44,1,   126720, 0x362d6606
-0, 45, 45,1,   126720, 0x53faca36
-0, 46, 46,1,   126720, 0xc0cacf66
-0, 47, 47,1,   126720, 0xd3cbe8d2

[FFmpeg-cvslog] avcodec/aacsbr_tablegen: always initialize tables at runtime

2015-12-09 Thread Ganesh Ajjanagadde
ffmpeg | branch: master | Ganesh Ajjanagadde  | Sun Nov 
29 22:35:00 2015 -0500| [cb93df0dcbd34107c64ec053504fa294b728a9c9] | committer: 
Ganesh Ajjanagadde

avcodec/aacsbr_tablegen: always initialize tables at runtime

This gets rid of virtually useless hardcoded tables hackery. The reason
it is useless is that a 320 element lut is anyway placed regardless of
--enable-hardcoded-tables, from which all necessary tables are trivially
derived at runtime at very low cost:

sample benchmark (x86-64, Haswell, GNU/Linux, single run is really
what is relevant here since looping drastically changes the bench). Fluctuations
are on the order of 10% for the single run test:
39400 decicycles in aacsbr_tableinit,   1 runs,  0 skips
25325 decicycles in aacsbr_tableinit,   2 runs,  0 skips
18475 decicycles in aacsbr_tableinit,   4 runs,  0 skips
15008 decicycles in aacsbr_tableinit,   8 runs,  0 skips
13016 decicycles in aacsbr_tableinit,  16 runs,  0 skips
12005 decicycles in aacsbr_tableinit,  32 runs,  0 skips
11546 decicycles in aacsbr_tableinit,  64 runs,  0 skips
11506 decicycles in aacsbr_tableinit, 128 runs,  0 skips
11500 decicycles in aacsbr_tableinit, 256 runs,  0 skips
11183 decicycles in aacsbr_tableinit, 509 runs,  3 skips

Tested with FATE with/without --enable-hardcoded-tables.

Reviewed-by: Rostislav Pehlivanov 
Signed-off-by: Ganesh Ajjanagadde 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cb93df0dcbd34107c64ec053504fa294b728a9c9
---

 libavcodec/Makefile |8 ++-
 libavcodec/aacsbr_fixed_tablegen.c  |   39 ---
 libavcodec/aacsbr_fixed_tablegen.h  |4 
 libavcodec/aacsbr_tablegen.c|   39 ---
 libavcodec/aacsbr_tablegen.h|4 
 libavcodec/aacsbr_tablegen_common.h |4 
 6 files changed, 2 insertions(+), 96 deletions(-)

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 1ad3787..c169135 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -968,8 +968,6 @@ TOOLS = fourcc2pixfmt
 
 HOSTPROGS = aacps_tablegen  \
 aacps_fixed_tablegen\
-aacsbr_tablegen \
-aacsbr_fixed_tablegen   \
 cbrt_tablegen   \
 cbrt_fixed_tablegen \
 cos_tablegen\
@@ -999,8 +997,8 @@ else
 $(SUBDIR)%_tablegen$(HOSTEXESUF): HOSTCFLAGS += -DCONFIG_SMALL=0
 endif
 
-GEN_HEADERS = cbrt_tables.h cbrt_fixed_tables.h aacps_tables.h 
aacps_fixed_tables.h aacsbr_tables.h \
-  aacsbr_fixed_tables.h dsd_tables.h dv_tables.h \
+GEN_HEADERS = cbrt_tables.h cbrt_fixed_tables.h aacps_tables.h 
aacps_fixed_tables.h \
+  dsd_tables.h dv_tables.h \
   sinewin_tables.h sinewin_fixed_tables.h mpegaudio_tables.h 
motionpixels_tables.h \
   pcm_tables.h qdm2_tables.h
 GEN_HEADERS := $(addprefix $(SUBDIR), $(GEN_HEADERS))
@@ -1013,8 +1011,6 @@ $(SUBDIR)aacdec.o: $(SUBDIR)cbrt_tables.h
 $(SUBDIR)aacdec_fixed.o: $(SUBDIR)cbrt_fixed_tables.h
 $(SUBDIR)aacps_float.o: $(SUBDIR)aacps_tables.h
 $(SUBDIR)aacps_fixed.o: $(SUBDIR)aacps_fixed_tables.h
-$(SUBDIR)aacsbr.o: $(SUBDIR)aacsbr_tables.h
-$(SUBDIR)aacsbr_fixed.o: $(SUBDIR)aacsbr_fixed_tables.h
 $(SUBDIR)aactab_fixed.o: $(SUBDIR)aac_fixed_tables.h
 $(SUBDIR)dsddec.o: $(SUBDIR)dsd_tables.h
 $(SUBDIR)dvenc.o: $(SUBDIR)dv_tables.h
diff --git a/libavcodec/aacsbr_fixed_tablegen.c 
b/libavcodec/aacsbr_fixed_tablegen.c
deleted file mode 100644
index 832fcb7..000
--- a/libavcodec/aacsbr_fixed_tablegen.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Header file for hardcoded AAC SBR windows
- *
- * Copyright (c) 2014 Reimar Döffinger 
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include 
-#define CONFIG_HARDCODED_TABLES 0
-#define USE_FIXED 1
-#include "aacsbr_fixed_tablegen.h"
-#include "tableprint.h"
-
-int main(void)
-{
-aacsbr_tableinit();
-
-  

[FFmpeg-cvslog] lavfi/vf_overlay: fix memory leaks

2015-12-09 Thread Ganesh Ajjanagadde
ffmpeg | branch: master | Ganesh Ajjanagadde  | Fri Dec 
 4 00:20:24 2015 -0500| [301c2784b35036945cd9a7049808deecce149916] | committer: 
Ganesh Ajjanagadde

lavfi/vf_overlay: fix memory leaks

Recent commits 6aaac24d72a7da631173209841a3944fcb4a3309 and
3835554bf8ed78539a3492c239f979c0ab03a15f made progress towards cleaning
up usage of the formats API, and in particular fixed possible NULL pointer
dereferences.

This commit addresses the issue of possible resource leaks when some 
intermediate
call fails.

Tested with valgrind --leak-check=full --show-leak-kinds=all, and manual 
simulation
of malloc/realloc failures.

Fixes: CID 1338327.

Signed-off-by: Ganesh Ajjanagadde 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=301c2784b35036945cd9a7049808deecce149916
---

 libavfilter/vf_overlay.c |   34 +-
 1 file changed, 25 insertions(+), 9 deletions(-)

diff --git a/libavfilter/vf_overlay.c b/libavfilter/vf_overlay.c
index 3c61731..502fde0 100644
--- a/libavfilter/vf_overlay.c
+++ b/libavfilter/vf_overlay.c
@@ -252,23 +252,31 @@ static int query_formats(AVFilterContext *ctx)
 switch (s->format) {
 case OVERLAY_FORMAT_YUV420:
 if (!(main_formats= ff_make_format_list(main_pix_fmts_yuv420)) ||
-!(overlay_formats = ff_make_format_list(overlay_pix_fmts_yuv420)))
-return AVERROR(ENOMEM);
+!(overlay_formats = ff_make_format_list(overlay_pix_fmts_yuv420))) 
{
+ret = AVERROR(ENOMEM);
+goto fail;
+}
 break;
 case OVERLAY_FORMAT_YUV422:
 if (!(main_formats= ff_make_format_list(main_pix_fmts_yuv422)) ||
-!(overlay_formats = ff_make_format_list(overlay_pix_fmts_yuv422)))
-return AVERROR(ENOMEM);
+!(overlay_formats = ff_make_format_list(overlay_pix_fmts_yuv422))) 
{
+ret = AVERROR(ENOMEM);
+goto fail;
+}
 break;
 case OVERLAY_FORMAT_YUV444:
 if (!(main_formats= ff_make_format_list(main_pix_fmts_yuv444)) ||
-!(overlay_formats = ff_make_format_list(overlay_pix_fmts_yuv444)))
-return AVERROR(ENOMEM);
+!(overlay_formats = ff_make_format_list(overlay_pix_fmts_yuv444))) 
{
+ret = AVERROR(ENOMEM);
+goto fail;
+}
 break;
 case OVERLAY_FORMAT_RGB:
 if (!(main_formats= ff_make_format_list(main_pix_fmts_rgb)) ||
-!(overlay_formats = ff_make_format_list(overlay_pix_fmts_rgb)))
-return AVERROR(ENOMEM);
+!(overlay_formats = ff_make_format_list(overlay_pix_fmts_rgb))) {
+ret = AVERROR(ENOMEM);
+goto fail;
+}
 break;
 default:
 av_assert0(0);
@@ -277,9 +285,17 @@ static int query_formats(AVFilterContext *ctx)
 if ((ret = ff_formats_ref(main_formats   , &ctx->inputs[MAIN]->out_formats 
  )) < 0 ||
 (ret = ff_formats_ref(overlay_formats, 
&ctx->inputs[OVERLAY]->out_formats)) < 0 ||
 (ret = ff_formats_ref(main_formats   , &ctx->outputs[MAIN]->in_formats 
  )) < 0)
-return ret;
+goto fail;
 
 return 0;
+fail:
+if (main_formats)
+av_freep(&main_formats->formats);
+av_freep(&main_formats);
+if (overlay_formats)
+av_freep(&overlay_formats->formats);
+av_freep(&overlay_formats);
+return ret;
 }
 
 static const enum AVPixelFormat alpha_pix_fmts[] = {

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


[FFmpeg-cvslog] lavfi/af_amix: fix memory leak

2015-12-09 Thread Ganesh Ajjanagadde
ffmpeg | branch: master | Ganesh Ajjanagadde  | Fri Dec 
 4 02:04:46 2015 -0500| [89bbf01978194ee1354bb3feef139a648bc1903b] | committer: 
Ganesh Ajjanagadde

lavfi/af_amix: fix memory leak

Recent commits 6aaac24d72a7da631173209841a3944fcb4a3309 and
3835554bf8ed78539a3492c239f979c0ab03a15f made progress towards cleaning
up usage of the formats API, and in particular fixed possible NULL pointer
dereferences.

This commit addresses the issue of possible resource leaks when some 
intermediate
call fails.

Tested with valgrind --leak-check=full --show-leak-kinds=all, and manual 
simulation
of malloc/realloc failures.

Fixes: CID 1250334.

Signed-off-by: Ganesh Ajjanagadde 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=89bbf01978194ee1354bb3feef139a648bc1903b
---

 libavfilter/af_amix.c |   29 -
 1 file changed, 16 insertions(+), 13 deletions(-)

diff --git a/libavfilter/af_amix.c b/libavfilter/af_amix.c
index 223328b..e64e289 100644
--- a/libavfilter/af_amix.c
+++ b/libavfilter/af_amix.c
@@ -519,20 +519,23 @@ static int query_formats(AVFilterContext *ctx)
 int ret;
 
 layouts = ff_all_channel_layouts();
-if (!layouts)
-return AVERROR(ENOMEM);
+if (!layouts) {
+ret = AVERROR(ENOMEM);
+goto fail;
+}
 
-if ((ret = ff_add_format(&formats, AV_SAMPLE_FMT_FLT)) < 0)
-return ret;
-if ((ret = ff_add_format(&formats, AV_SAMPLE_FMT_FLTP)) < 0)
-return ret;
-ret = ff_set_common_formats(ctx, formats);
-if (ret < 0)
-return ret;
-ret = ff_set_common_channel_layouts(ctx, layouts);
-if (ret < 0)
-return ret;
-return ff_set_common_samplerates(ctx, ff_all_samplerates());
+if ((ret = ff_add_format(&formats, AV_SAMPLE_FMT_FLT ))  < 0 ||
+(ret = ff_add_format(&formats, AV_SAMPLE_FMT_FLTP))  < 0 ||
+(ret = ff_set_common_formats(ctx, formats))  < 0 ||
+(ret = ff_set_common_channel_layouts(ctx, layouts))  < 0 ||
+(ret = ff_set_common_samplerates(ctx, ff_all_samplerates())) < 0)
+goto fail;
+return 0;
+fail:
+if (layouts)
+av_freep(&layouts->channel_layouts);
+av_freep(&layouts);
+return ret;
 }
 
 static const AVFilterPad avfilter_af_amix_outputs[] = {

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


[FFmpeg-cvslog] lavfi/af_channelmap: fix memory leak

2015-12-09 Thread Ganesh Ajjanagadde
ffmpeg | branch: master | Ganesh Ajjanagadde  | Fri Dec 
 4 00:49:55 2015 -0500| [924fcac52148ef3e37ea39b5901299930b9c1b28] | committer: 
Ganesh Ajjanagadde

lavfi/af_channelmap: fix memory leak

Recent commits 6aaac24d72a7da631173209841a3944fcb4a3309 and
3835554bf8ed78539a3492c239f979c0ab03a15f made progress towards cleaning
up usage of the formats API, and in particular fixed possible NULL pointer
dereferences.

This commit addresses the issue of possible resource leaks when some 
intermediate
call fails.

Tested with valgrind --leak-check=full --show-leak-kinds=all, and manual 
simulation
of malloc/realloc failures.

Fixes: CID 1338330.

Reviewed-by: Paul B Mahol 
Signed-off-by: Ganesh Ajjanagadde 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=924fcac52148ef3e37ea39b5901299930b9c1b28
---

 libavfilter/af_channelmap.c |   11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/libavfilter/af_channelmap.c b/libavfilter/af_channelmap.c
index 9e95a98..dcae2a2 100644
--- a/libavfilter/af_channelmap.c
+++ b/libavfilter/af_channelmap.c
@@ -292,14 +292,23 @@ static int channelmap_query_formats(AVFilterContext *ctx)
 int ret;
 
 layouts = ff_all_channel_layouts();
+if (!layouts) {
+ret = AVERROR(ENOMEM);
+goto fail;
+}
 if ((ret = ff_add_channel_layout (&channel_layouts, s->output_layout   
 )) < 0 ||
 (ret = ff_set_common_formats (ctx , 
ff_planar_sample_fmts() )) < 0 ||
 (ret = ff_set_common_samplerates (ctx , 
ff_all_samplerates())) < 0 ||
 (ret = ff_channel_layouts_ref(layouts , 
&ctx->inputs[0]->out_channel_layouts)) < 0 ||
 (ret = ff_channel_layouts_ref(channel_layouts , 
&ctx->outputs[0]->in_channel_layouts)) < 0)
-return ret;
+goto fail;
 
 return 0;
+fail:
+if (layouts)
+av_freep(&layouts->channel_layouts);
+av_freep(&layouts);
+return ret;
 }
 
 static int channelmap_filter_frame(AVFilterLink *inlink, AVFrame *buf)

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


[FFmpeg-cvslog] lavfi/show_palette: fix memory leak

2015-12-09 Thread Ganesh Ajjanagadde
ffmpeg | branch: master | Ganesh Ajjanagadde  | Fri Dec 
 4 01:46:07 2015 -0500| [00c322014904c2d5be92cc292b162d31f18a7058] | committer: 
Ganesh Ajjanagadde

lavfi/show_palette: fix memory leak

Recent commits 6aaac24d72a7da631173209841a3944fcb4a3309 and
3835554bf8ed78539a3492c239f979c0ab03a15f made progress towards cleaning
up usage of the formats API, and in particular fixed possible NULL pointer
dereferences.

This commit addresses the issue of possible resource leaks when some 
intermediate
call fails. Unfortunately, even leaving aside this subtle intermediate
failure aspect, commit 8087632027d755cd32ccc9e91ea025e276197055 was only
partially successful in addressing memleaks. Hopefully, this commit
fixes the issue completely.

Tested with valgrind --leak-check=full --show-leak-kinds=all, and manual 
simulation
of malloc/realloc failures.

Fixes: CID 1270818.

Reviewed-by: Clément Bœsch 
Signed-off-by: Ganesh Ajjanagadde 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=00c322014904c2d5be92cc292b162d31f18a7058
---

 libavfilter/vf_showpalette.c |   16 
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/libavfilter/vf_showpalette.c b/libavfilter/vf_showpalette.c
index fcb43a3..f1627ba 100644
--- a/libavfilter/vf_showpalette.c
+++ b/libavfilter/vf_showpalette.c
@@ -50,14 +50,22 @@ static int query_formats(AVFilterContext *ctx)
 AVFilterFormats *in  = ff_make_format_list(in_fmts);
 AVFilterFormats *out = ff_make_format_list(out_fmts);
 if (!in || !out) {
-av_freep(&in);
-av_freep(&out);
-return AVERROR(ENOMEM);
+ret = AVERROR(ENOMEM);
+goto fail;
 }
+
 if ((ret = ff_formats_ref(in , &ctx->inputs[0]->out_formats)) < 0 ||
 (ret = ff_formats_ref(out, &ctx->outputs[0]->in_formats)) < 0)
-return ret;
+goto fail;
 return 0;
+fail:
+if (in)
+av_freep(&in->formats);
+av_freep(&in);
+if (out)
+av_freep(&out->formats);
+av_freep(&out);
+return ret;
 }
 
 static int config_output(AVFilterLink *outlink)

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


[FFmpeg-cvslog] lavfi/vf_alphamerge: fix memory leaks

2015-12-09 Thread Ganesh Ajjanagadde
ffmpeg | branch: master | Ganesh Ajjanagadde  | Fri Dec 
 4 00:37:19 2015 -0500| [31f0d555e07797df1a0a141fa5e022648d480a49] | committer: 
Ganesh Ajjanagadde

lavfi/vf_alphamerge: fix memory leaks

Recent commits 6aaac24d72a7da631173209841a3944fcb4a3309 and
3835554bf8ed78539a3492c239f979c0ab03a15f made progress towards cleaning
up usage of the formats API, and in particular fixed possible NULL pointer
dereferences.

This commit addresses the issue of possible resource leaks when some 
intermediate
call fails.

Tested with valgrind --leak-check=full --show-leak-kinds=all, and manual 
simulation
of malloc/realloc failures.

Fixes: CID 1338326, 1338329.

Signed-off-by: Ganesh Ajjanagadde 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=31f0d555e07797df1a0a141fa5e022648d480a49
---

 libavfilter/vf_alphamerge.c |   16 +---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/libavfilter/vf_alphamerge.c b/libavfilter/vf_alphamerge.c
index 8a1ca22..ecc114c 100644
--- a/libavfilter/vf_alphamerge.c
+++ b/libavfilter/vf_alphamerge.c
@@ -61,13 +61,23 @@ static int query_formats(AVFilterContext *ctx)
 int ret;
 
 if (!(main_formats = ff_make_format_list(main_fmts)) ||
-!(alpha_formats = ff_make_format_list(alpha_fmts)))
-return AVERROR(ENOMEM);
+!(alpha_formats = ff_make_format_list(alpha_fmts))) {
+ret = AVERROR(ENOMEM);
+goto fail;
+}
 if ((ret = ff_formats_ref(main_formats , &ctx->inputs[0]->out_formats)) < 
0 ||
 (ret = ff_formats_ref(alpha_formats, &ctx->inputs[1]->out_formats)) < 
0 ||
 (ret = ff_formats_ref(main_formats , &ctx->outputs[0]->in_formats)) < 
0)
-return ret;
+goto fail;
 return 0;
+fail:
+if (main_formats)
+av_freep(&main_formats->formats);
+av_freep(&main_formats);
+if (alpha_formats)
+av_freep(&alpha_formats->formats);
+av_freep(&alpha_formats);
+return ret;
 }
 
 static int config_input_main(AVFilterLink *inlink)

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


[FFmpeg-cvslog] avformat/matroskaenc: Check codecdelay before use

2015-12-09 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Wed 
Dec  9 16:16:46 2015 +0100| [e6971db12b8ae49712b77378fa8141de4904082b] | 
committer: Michael Niedermayer

avformat/matroskaenc: Check codecdelay before use

Fixes CID1238790

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e6971db12b8ae49712b77378fa8141de4904082b
---

 libavformat/matroskaenc.c |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 26b9b96..60f7c16 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -926,14 +926,18 @@ static int mkv_write_track(AVFormatContext *s, 
MatroskaMuxContext *mkv,
 }
 
 if (codec->codec_type == AVMEDIA_TYPE_AUDIO && codec->initial_padding && 
codec->codec_id == AV_CODEC_ID_OPUS) {
+int64_t codecdelay = av_rescale_q(codec->initial_padding,
+  (AVRational){ 1, codec->sample_rate 
},
+  (AVRational){ 1, 10 });
+if (codecdelay < 0) {
+av_log(s, AV_LOG_ERROR, "Initial padding is invalid\n");
+return AVERROR(EINVAL);
+}
 // mkv->tracks[i].ts_offset = av_rescale_q(codec->initial_padding,
 // (AVRational){ 1, 
codec->sample_rate },
 // st->time_base);
 
-put_ebml_uint(pb, MATROSKA_ID_CODECDELAY,
-  av_rescale_q(codec->initial_padding,
-   (AVRational){ 1, codec->sample_rate },
-   (AVRational){ 1, 10 }));
+put_ebml_uint(pb, MATROSKA_ID_CODECDELAY, codecdelay);
 }
 if (codec->codec_id == AV_CODEC_ID_OPUS) {
 put_ebml_uint(pb, MATROSKA_ID_SEEKPREROLL, OPUS_SEEK_PREROLL);

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


[FFmpeg-cvslog] avformat/flacdec: remove unused return code assignment

2015-12-09 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Wed 
Dec  9 16:47:55 2015 +0100| [8cfa912e250da83675f68ce5e02faf325c18d462] | 
committer: Michael Niedermayer

avformat/flacdec: remove unused return code assignment

Fixes CID1271811

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8cfa912e250da83675f68ce5e02faf325c18d462
---

 libavformat/flacdec.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavformat/flacdec.c b/libavformat/flacdec.c
index cc3ed83..eb92216 100644
--- a/libavformat/flacdec.c
+++ b/libavformat/flacdec.c
@@ -263,9 +263,9 @@ static av_unused int64_t 
flac_read_timestamp(AVFormatContext *s, int stream_inde
 break;
 }
 av_init_packet(&out_pkt);
-ret = av_parser_parse2(parser, st->codec,
-   &out_pkt.data, &out_pkt.size, pkt.data, 
pkt.size,
-   pkt.pts, pkt.dts, *ppos);
+av_parser_parse2(parser, st->codec,
+ &out_pkt.data, &out_pkt.size, pkt.data, pkt.size,
+ pkt.pts, pkt.dts, *ppos);
 
 av_packet_unref(&pkt);
 if (out_pkt.size){

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


[FFmpeg-cvslog] avutil/mathematics: Fix division by 0

2015-12-09 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Wed 
Dec  9 17:39:38 2015 +0100| [bc8b1e694cc395fdf5e2917377ef11263c937d85] | 
committer: Michael Niedermayer

avutil/mathematics: Fix division by 0

Fixes: CID1341571

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bc8b1e694cc395fdf5e2917377ef11263c937d85
---

 libavutil/mathematics.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/mathematics.c b/libavutil/mathematics.c
index c12c73e..20ff37f 100644
--- a/libavutil/mathematics.c
+++ b/libavutil/mathematics.c
@@ -85,7 +85,7 @@ int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum 
AVRounding rnd)
 else {
 int64_t ad = a / c;
 int64_t a2 = (a % c * b + r) / c;
-if (ad >= INT32_MAX && ad > (INT64_MAX - a2) / b)
+if (ad >= INT32_MAX && b && ad > (INT64_MAX - a2) / b)
 return INT64_MIN;
 return ad * b + a2;
 }

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


[FFmpeg-cvslog] avformat/rmdec: Fix use of uninitialized variable

2015-12-09 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Wed 
Dec  9 18:17:47 2015 +0100| [80ceb4696ab7b9c40a0e456a866c473a5291d2f2] | 
committer: Michael Niedermayer

avformat/rmdec: Fix use of uninitialized variable

Fixes: CID1341580

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=80ceb4696ab7b9c40a0e456a866c473a5291d2f2
---

 libavformat/rmdec.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index 8024b91..4a46654 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -1179,7 +1179,7 @@ static int ivr_probe(AVProbeData *p)
 static int ivr_read_header(AVFormatContext *s)
 {
 unsigned tag, type, len, tlen, value;
-int i, j, n, count, nb_streams, ret;
+int i, j, n, count, nb_streams = 0, ret;
 uint8_t key[256], val[256];
 AVIOContext *pb = s->pb;
 AVStream *st;

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


[FFmpeg-cvslog] lavf/mpjpegdec: Fixed dereference after null check

2015-12-09 Thread Alex Agranovsky
ffmpeg | branch: master | Alex Agranovsky  | Wed Dec  9 
12:48:20 2015 -0500| [7fd1c85e51958050180b37a1bf4ce833d44f91e8] | committer: 
Michael Niedermayer

lavf/mpjpegdec: Fixed dereference after null check

Fixes Coverity CID 1341576

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7fd1c85e51958050180b37a1bf4ce833d44f91e8
---

 libavformat/mpjpegdec.c |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavformat/mpjpegdec.c b/libavformat/mpjpegdec.c
index 3429d19..dd31f87 100644
--- a/libavformat/mpjpegdec.c
+++ b/libavformat/mpjpegdec.c
@@ -260,8 +260,10 @@ static char* mpjpeg_get_boundary(AVIOContext* pb)
 start = mime_type;
 while (start != NULL && *start != '\0') {
 start = strchr(start, ';');
-if (start)
-start = start+1;
+if (!start)
+break;
+
+start = start+1;
 
 while (av_isspace(*start))
 start++;

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


[FFmpeg-cvslog] avutil/mathematics: Fix division by 0

2015-12-09 Thread Michael Niedermayer
ffmpeg | branch: release/2.4 | Michael Niedermayer  | 
Wed Dec  9 17:39:38 2015 +0100| [ab70292fd0c35d1c308f6cdbb810746edf644233] | 
committer: Michael Niedermayer

avutil/mathematics: Fix division by 0

Fixes: CID1341571

Signed-off-by: Michael Niedermayer 
(cherry picked from commit bc8b1e694cc395fdf5e2917377ef11263c937d85)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ab70292fd0c35d1c308f6cdbb810746edf644233
---

 libavutil/mathematics.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/mathematics.c b/libavutil/mathematics.c
index 4d8467b..78a87d8 100644
--- a/libavutil/mathematics.c
+++ b/libavutil/mathematics.c
@@ -90,7 +90,7 @@ int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum 
AVRounding rnd)
 else {
 int64_t ad = a / c;
 int64_t a2 = (a % c * b + r) / c;
-if (ad >= INT32_MAX && ad > (INT64_MAX - a2) / b)
+if (ad >= INT32_MAX && b && ad > (INT64_MAX - a2) / b)
 return INT64_MIN;
 return ad * b + a2;
 }

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


[FFmpeg-cvslog] mjpegdec: consider chroma subsampling in size check

2015-12-09 Thread Andreas Cadhalpun
ffmpeg | branch: release/2.4 | Andreas Cadhalpun 
 | Wed Dec  2 21:52:23 2015 +0100| 
[073fcfe35800d0ad400dd1668727e3741e2a6a34] | committer: Michael Niedermayer

mjpegdec: consider chroma subsampling in size check

If the chroma components are subsampled, smaller buffers are allocated
for them. In that case the maximal block_offset for the chroma
components is not as large as for the luma component.

This fixes out of bounds writes causing segmentation faults or memory
corruption.

Reviewed-by: Michael Niedermayer 
Signed-off-by: Andreas Cadhalpun 
(cherry picked from commit 5adb5d9d894aa495e7bf9557b4c78350cbfc9d32)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=073fcfe35800d0ad400dd1668727e3741e2a6a34
---

 libavcodec/mjpegdec.c |   11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 59cbd25..c984766 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -1197,7 +1197,7 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int 
nb_components, int Ah,
  int mb_bitmask_size,
  const AVFrame *reference)
 {
-int i, mb_x, mb_y;
+int i, mb_x, mb_y, chroma_h_shift, chroma_v_shift, chroma_width, 
chroma_height;
 uint8_t *data[MAX_COMPONENTS];
 const uint8_t *reference_data[MAX_COMPONENTS];
 int linesize[MAX_COMPONENTS];
@@ -1214,6 +1214,11 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int 
nb_components, int Ah,
 
 s->restart_count = 0;
 
+av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt, &chroma_h_shift,
+ &chroma_v_shift);
+chroma_width  = FF_CEIL_RSHIFT(s->width,  chroma_h_shift);
+chroma_height = FF_CEIL_RSHIFT(s->height, chroma_v_shift);
+
 for (i = 0; i < nb_components; i++) {
 int c   = s->comp_index[i];
 data[c] = s->picture_ptr->data[c];
@@ -1250,8 +1255,8 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int 
nb_components, int Ah,
 
 if (s->interlaced && s->bottom_field)
 block_offset += linesize[c] >> 1;
-if (   8*(h * mb_x + x) < s->width
-&& 8*(v * mb_y + y) < s->height) {
+if (   8*(h * mb_x + x) < ((c == 1) || (c == 2) ? 
chroma_width  : s->width)
+&& 8*(v * mb_y + y) < ((c == 1) || (c == 2) ? 
chroma_height : s->height)) {
 ptr = data[c] + block_offset;
 } else
 ptr = NULL;

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


[FFmpeg-cvslog] AAC encoder: fix OOB access in search_for_pns

2015-12-09 Thread Claudio Freire
ffmpeg | branch: master | Claudio Freire  | Wed Dec  9 
17:36:32 2015 -0300| [124c3759386a98e9f47b3305cb18cee5e1707d73] | committer: 
Andreas Cadhalpun

AAC encoder: fix OOB access in search_for_pns

Fix OOB access in search_for_pns which was using
w2 outside the window group loop, and fix a typo
in which it was checking sf_idx instead of band_type

Reviewed-by: Andreas Cadhalpun 
Signed-off-by: Andreas Cadhalpun 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=124c3759386a98e9f47b3305cb18cee5e1707d73
---

 libavcodec/aaccoder.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/aaccoder.c b/libavcodec/aaccoder.c
index 14862ec..7e55494 100644
--- a/libavcodec/aaccoder.c
+++ b/libavcodec/aaccoder.c
@@ -711,7 +711,7 @@ static void search_for_pns(AACEncContext *s, AVCodecContext 
*avctx, SingleChanne
 /* Estimate rd on average as 5 bits for SF, 4 for the CB, plus 
spread energy * lambda/thr */
 dist2 += 
band->energy/(band->spread*band->spread)*lambda*dist_thresh/band->threshold;
 }
-if (g && sce->sf_idx[(w+w2)*16+g-1] == NOISE_BT) {
+if (g && sce->band_type[w*16+g-1] == NOISE_BT) {
 dist2 += 5;
 } else {
 dist2 += 9;

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


[FFmpeg-cvslog] avformat/utils: estimate_timings_from_pts - increase retry counter, fixes invalid duration for ts files with hevc codec

2015-12-09 Thread Rainer Hochecker
ffmpeg | branch: release/2.4 | Rainer Hochecker  | Sun 
Nov 15 13:58:50 2015 +0100| [5e4ec87720a64cd969120af60e82cbd55454ab8e] | 
committer: Michael Niedermayer

avformat/utils: estimate_timings_from_pts - increase retry counter, fixes 
invalid duration for ts files with hevc codec

Fixes a mpegts file with hevc that fails estimating duration. Increasing number 
of
retries fixes the issue.

Signed-off-by: Michael Niedermayer 
(cherry picked from commit 2d8c2f1a28073d451c7db31291c333cb15ca3d0b)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5e4ec87720a64cd969120af60e82cbd55454ab8e
---

 libavformat/utils.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 4ce97cc..f26cfb3 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2319,7 +2319,7 @@ static void 
estimate_timings_from_bit_rate(AVFormatContext *ic)
 }
 
 #define DURATION_MAX_READ_SIZE 25LL
-#define DURATION_MAX_RETRY 4
+#define DURATION_MAX_RETRY 6
 
 /* only usable for MPEG-PS streams */
 static void estimate_timings_from_pts(AVFormatContext *ic, int64_t old_offset)

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


[FFmpeg-cvslog] Tag n2.4.12 : FFmpeg 2.4.12 release

2015-12-09 Thread git
[ffmpeg] [branch: refs/tags/n2.4.12]
Tag:02176ea1e2b6c18766a6396153f9ac7df8f40900
> http://git.videolan.org/gitweb.cgi/ffmpeg.git?a=tag;h=02176ea1e2b6c18766a6396153f9ac7df8f40900

Tagger: Michael Niedermayer 
Date:   Thu Dec 10 02:04:39 2015 +0100

FFmpeg 2.4.12 release
___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog


[FFmpeg-cvslog] [ffmpeg-web] branch master updated. 1b7fef3 web/security: add CVEs for 2.5.9 and 2.4.12

2015-12-09 Thread ffmpeg-cvslog
The branch, master has been updated
   via  1b7fef3b4f1832963db372273e91ec40667d7d25 (commit)
   via  978f48859ca2c7a91633e67ae3a5aa55de68f5ea (commit)
  from  056d2d9a719c92322de412466197951d59d9d990 (commit)


- Log -
commit 1b7fef3b4f1832963db372273e91ec40667d7d25
Author: Michael Niedermayer 
AuthorDate: Thu Dec 10 02:08:42 2015 +0100
Commit: Michael Niedermayer 
CommitDate: Thu Dec 10 02:08:42 2015 +0100

web/security: add CVEs for 2.5.9 and 2.4.12

add CVE-2015-6761, CVE-2015-8216, CVE-2015-8219, CVE-2015-8363, 
CVE-2015-8364, CVE-2015-8365

diff --git a/src/security b/src/security
index f8a0fbc..154205d 100644
--- a/src/security
+++ b/src/security
@@ -130,6 +130,19 @@ CVE-2015-3417, e8714f6f93d1a32f4e4655209960afcf4c185214
 
 FFmpeg 2.5
 
+2.5.9
+
+Fixes following vulnerabilities:
+
+
+CVE-2015-6761, 608f928c74d821f74747e22819b4c6dfc90acbb5 / 
dabea74d0e82ea80cd344f630497cafcb3ef872c
+CVE-2015-8216, f2b161319d29d19d9113b4d06bc28be8745fa35c / 
d24888ef19ba38b787b11d1ee091a3d94920c76a
+CVE-2015-8219, 9e755b9b99c3c28a27a34d276a182b84f8563eff / 
43492ff3ab68a343c1264801baa1d5a02de10167
+CVE-2015-8363, be4b41b6cb7cd3c962cfcde6305d5e7537645bf2 / 
44a7f17d0b20e6f8d836b2957e3e357b639f19a2
+CVE-2015-8364, ffaea7a790778ec4f23a22bbb445b77471dbddb1 / 
df91aa034b82b77a3c4e01791f4a2b2ff6c82066
+CVE-2015-8365, 2b0cda395f2330fc0dbebadb612b758bf46ccf47 / 
4a9af07a49295e014b059c1ab624c40345af5892
+
+
 2.5.8
 
 Fixes following vulnerabilities:
@@ -196,6 +209,19 @@ CVE-2014-9319, ea38e5a6b75706477898eb1e6582d667dbb9946c
 
 FFmpeg 2.4
 
+2.4.12
+
+Fixes following vulnerabilities:
+
+
+CVE-2015-6761, ee5ba259d12d60c4e67fb0d92b46bd4b16d79eac / 
dabea74d0e82ea80cd344f630497cafcb3ef872c
+CVE-2015-8216, 2f89546333b53e626d710cde357f0d13ea450474 / 
d24888ef19ba38b787b11d1ee091a3d94920c76a
+CVE-2015-8219, d73a8ae70f15d4c9145c20db709f4b06b0a8e835 / 
43492ff3ab68a343c1264801baa1d5a02de10167
+CVE-2015-8363, ac302efb9151addfc9d45495d56592ba6fd384b2 / 
44a7f17d0b20e6f8d836b2957e3e357b639f19a2
+CVE-2015-8364, f68ff799eb00ec7f38e983c7fbe60c7ff948e401 / 
df91aa034b82b77a3c4e01791f4a2b2ff6c82066
+CVE-2015-8365, 3449b47dc548fdc91ee46c6e3de04ad8b6b3d045 / 
4a9af07a49295e014b059c1ab624c40345af5892
+
+
 2.4.11
 
 Fixes following vulnerabilities:

commit 978f48859ca2c7a91633e67ae3a5aa55de68f5ea
Author: Michael Niedermayer 
AuthorDate: Thu Dec 10 02:08:10 2015 +0100
Commit: Michael Niedermayer 
CommitDate: Thu Dec 10 02:08:10 2015 +0100

web/download: add FFmpeg 2.4.12

diff --git a/src/download b/src/download
index a851294..2ec242b 100644
--- a/src/download
+++ b/src/download
@@ -439,10 +439,10 @@ libpostproc53.  3.100
 
 
   
-FFmpeg 2.4.11 "Fresnel"
+FFmpeg 2.4.12 "Fresnel"
 
   
-2.4.11 was released on 2015-08-25. It is the latest stable FFmpeg release
+2.4.12 was released on 2015-12-10. It is the latest stable FFmpeg release
 from the 2.4 release branch, which was cut from master on 2014-09-14.
 Amongst lots of other changes, it includes all changes from
 ffmpeg-mt, libav master of 2014-09-14, libav 11.4 as of 2015-08-25.
@@ -462,15 +462,15 @@ libpostproc53.  0.100
 
   
 
-  Download bzip2 tarball
-  PGP 
signature
+  Download bzip2 tarball
+  PGP 
signature
  
 
-  Download 
gzip tarball
-  PGP 
signature
+  Download 
gzip tarball
+  PGP 
signature
  
 
-  http://git.videolan.org/?p=ffmpeg.git;a=shortlog;h=n2.4.11";>Changelog
+  http://git.videolan.org/?p=ffmpeg.git;a=shortlog;h=n2.4.12";>Changelog
   http://git.videolan.org/?p=ffmpeg.git;a=blob;f=RELEASE_NOTES;hb=release/2.4";>Release
 Notes
  


---

Summary of changes:
 src/download | 14 +++---
 src/security | 26 ++
 2 files changed, 33 insertions(+), 7 deletions(-)


hooks/post-receive
-- 

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


[FFmpeg-cvslog] avfilter/avf_showfreqs: avoid wasteful pow

2015-12-09 Thread Ganesh Ajjanagadde
ffmpeg | branch: master | Ganesh Ajjanagadde  | Wed Dec 
 9 18:02:22 2015 -0500| [e5d771c84deaa70ce9fab5951eee831cbe5e82a9] | committer: 
Ganesh Ajjanagadde

avfilter/avf_showfreqs: avoid wasteful pow

pow is a ridiculous function for computing a simple Gaussian.

Reviewed-by: Paul B Mahol 
Signed-off-by: Ganesh Ajjanagadde 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e5d771c84deaa70ce9fab5951eee831cbe5e82a9
---

 libavfilter/avf_showfreqs.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavfilter/avf_showfreqs.c b/libavfilter/avf_showfreqs.c
index a3665ef..3ed0155 100644
--- a/libavfilter/avf_showfreqs.c
+++ b/libavfilter/avf_showfreqs.c
@@ -227,8 +227,9 @@ static void generate_window_func(float *lut, int N, int 
win_func, float *overlap
 *overlap = 0.75;
 break;
 case WFUNC_GAUSS:
+#define SQR(x) ((x)*(x))
 for (n = 0; n < N; n++)
-lut[n] = pow(M_E,-0.5*pow((n-(N-1)/2)/(0.4*(N-1)/2.f),2));
+lut[n] = exp(-0.5 * SQR((n-(N-1)/2)/(0.4*(N-1)/2.f)));
 *overlap = 0.75;
 break;
 default:

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


[FFmpeg-cvslog] doc/developer: misc minor fixes

2015-12-09 Thread Ganesh Ajjanagadde
ffmpeg | branch: master | Ganesh Ajjanagadde  | Thu Oct 
22 19:37:32 2015 -0400| [82f3d47b4f799d446f487085ae52fecfb89bd443] | committer: 
Ganesh Ajjanagadde

doc/developer: misc minor fixes

Signed-off-by: Ganesh Ajjanagadde 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=82f3d47b4f799d446f487085ae52fecfb89bd443
---

 doc/developer.texi |   21 ++---
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/doc/developer.texi b/doc/developer.texi
index 9a901d8..6db93ce 100644
--- a/doc/developer.texi
+++ b/doc/developer.texi
@@ -32,10 +32,10 @@ consult @url{https://ffmpeg.org/legal.html}.
 
 @section Contributing
 
-There are 3 ways by which code gets into ffmpeg.
+There are 3 ways by which code gets into FFmpeg.
 @itemize @bullet
-@item Submitting Patches to the main developer mailing list
-  see @ref{Submitting patches} for details.
+@item Submitting patches to the main developer mailing list.
+  See @ref{Submitting patches} for details.
 @item Directly committing changes to the main tree.
 @item Committing changes to a git clone, for example on github.com or
   gitorious.org. And asking us to merge these changes.
@@ -397,8 +397,8 @@ or obfuscates the code.
 Make sure that no parts of the codebase that you maintain are missing from the
 @file{MAINTAINERS} file. If something that you want to maintain is missing add 
it with
 your name after it.
-If at some point you no longer want to maintain some code, then please help
-finding a new maintainer and also don't forget updating the @file{MAINTAINERS} 
file.
+If at some point you no longer want to maintain some code, then please help in
+finding a new maintainer and also don't forget to update the 
@file{MAINTAINERS} file.
 @end enumerate
 
 We think our rules are not too hard. If you have comments, contact us.
@@ -410,7 +410,7 @@ First, read the @ref{Coding Rules} above if you did not 
yet, in particular
 the rules regarding patch submission.
 
 When you submit your patch, please use @code{git format-patch} or
-@code{git send-email}. We cannot read other diffs :-)
+@code{git send-email}. We cannot read other diffs :-).
 
 Also please do not submit a patch which contains several unrelated changes.
 Split it into separate, self-contained pieces. This does not mean splitting
@@ -570,7 +570,7 @@ If the patch fixes a bug, did you provide a verbose 
analysis of the bug?
 If the patch fixes a bug, did you provide enough information, including
 a sample, so the bug can be reproduced and the fix can be verified?
 Note please do not attach samples >100k to mails but rather provide a
-URL, you can upload to ftp://upload.ffmpeg.org
+URL, you can upload to ftp://upload.ffmpeg.org.
 
 @item
 Did you provide a verbose summary about what the patch does change?
@@ -599,10 +599,10 @@ Lines with similar content should be aligned vertically 
when doing so
 improves readability.
 
 @item
-Consider to add a regression test for your code.
+Consider adding a regression test for your code.
 
 @item
-If you added YASM code please check that things still work with --disable-yasm
+If you added YASM code please check that things still work with --disable-yasm.
 
 @item
 Make sure you check the return values of function and return appropriate
@@ -667,7 +667,6 @@ Once you have a working fate test and fate sample, provide 
in the commit
 message or introductory message for the patch series that you post to
 the ffmpeg-devel mailing list, a direct link to download the sample media.
 
-
 @subsection Visualizing Test Coverage
 
 The FFmpeg build system allows visualizing the test coverage in an easy
@@ -806,7 +805,7 @@ with a news entry for the website.
 Publish the news entry.
 
 @item
-Send announcement to the mailing list.
+Send an announcement to the mailing list.
 @end enumerate
 
 @bye

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


[FFmpeg-cvslog] mjpegdec: consider chroma subsampling in size check

2015-12-09 Thread Andreas Cadhalpun
ffmpeg | branch: release/2.8 | Andreas Cadhalpun 
 | Wed Dec  2 21:52:23 2015 +0100| 
[2e54b8c379bad54599f82d63de26af7c934ccff6] | committer: Michael Niedermayer

mjpegdec: consider chroma subsampling in size check

If the chroma components are subsampled, smaller buffers are allocated
for them. In that case the maximal block_offset for the chroma
components is not as large as for the luma component.

This fixes out of bounds writes causing segmentation faults or memory
corruption.

Reviewed-by: Michael Niedermayer 
Signed-off-by: Andreas Cadhalpun 
(cherry picked from commit 5adb5d9d894aa495e7bf9557b4c78350cbfc9d32)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2e54b8c379bad54599f82d63de26af7c934ccff6
---

 libavcodec/mjpegdec.c |   11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 6c6598f..3f81fdf 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -1246,7 +1246,7 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int 
nb_components, int Ah,
  int mb_bitmask_size,
  const AVFrame *reference)
 {
-int i, mb_x, mb_y;
+int i, mb_x, mb_y, chroma_h_shift, chroma_v_shift, chroma_width, 
chroma_height;
 uint8_t *data[MAX_COMPONENTS];
 const uint8_t *reference_data[MAX_COMPONENTS];
 int linesize[MAX_COMPONENTS];
@@ -1263,6 +1263,11 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int 
nb_components, int Ah,
 
 s->restart_count = 0;
 
+av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt, &chroma_h_shift,
+ &chroma_v_shift);
+chroma_width  = FF_CEIL_RSHIFT(s->width,  chroma_h_shift);
+chroma_height = FF_CEIL_RSHIFT(s->height, chroma_v_shift);
+
 for (i = 0; i < nb_components; i++) {
 int c   = s->comp_index[i];
 data[c] = s->picture_ptr->data[c];
@@ -1299,8 +1304,8 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int 
nb_components, int Ah,
 
 if (s->interlaced && s->bottom_field)
 block_offset += linesize[c] >> 1;
-if (   8*(h * mb_x + x) < s->width
-&& 8*(v * mb_y + y) < s->height) {
+if (   8*(h * mb_x + x) < ((c == 1) || (c == 2) ? 
chroma_width  : s->width)
+&& 8*(v * mb_y + y) < ((c == 1) || (c == 2) ? 
chroma_height : s->height)) {
 ptr = data[c] + block_offset;
 } else
 ptr = NULL;

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


[FFmpeg-cvslog] avutil/mathematics: Fix division by 0

2015-12-09 Thread Michael Niedermayer
ffmpeg | branch: release/2.8 | Michael Niedermayer  | 
Wed Dec  9 17:39:38 2015 +0100| [4608cc176b34a0268785508a915c9860bbdd1f25] | 
committer: Michael Niedermayer

avutil/mathematics: Fix division by 0

Fixes: CID1341571

Signed-off-by: Michael Niedermayer 
(cherry picked from commit bc8b1e694cc395fdf5e2917377ef11263c937d85)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4608cc176b34a0268785508a915c9860bbdd1f25
---

 libavutil/mathematics.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/mathematics.c b/libavutil/mathematics.c
index 4d8467b..78a87d8 100644
--- a/libavutil/mathematics.c
+++ b/libavutil/mathematics.c
@@ -90,7 +90,7 @@ int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum 
AVRounding rnd)
 else {
 int64_t ad = a / c;
 int64_t a2 = (a % c * b + r) / c;
-if (ad >= INT32_MAX && ad > (INT64_MAX - a2) / b)
+if (ad >= INT32_MAX && b && ad > (INT64_MAX - a2) / b)
 return INT64_MIN;
 return ad * b + a2;
 }

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


[FFmpeg-cvslog] avformat/matroskaenc: Check codecdelay before use

2015-12-09 Thread Michael Niedermayer
ffmpeg | branch: release/2.8 | Michael Niedermayer  | 
Wed Dec  9 16:16:46 2015 +0100| [a9c721da12e39396066e28ddd6e35b8fc538f294] | 
committer: Michael Niedermayer

avformat/matroskaenc: Check codecdelay before use

Fixes CID1238790

Signed-off-by: Michael Niedermayer 
(cherry picked from commit e6971db12b8ae49712b77378fa8141de4904082b)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a9c721da12e39396066e28ddd6e35b8fc538f294
---

 libavformat/matroskaenc.c |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 2b2d034..7918346 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -926,14 +926,18 @@ static int mkv_write_track(AVFormatContext *s, 
MatroskaMuxContext *mkv,
 }
 
 if (codec->codec_type == AVMEDIA_TYPE_AUDIO && codec->initial_padding && 
codec->codec_id == AV_CODEC_ID_OPUS) {
+int64_t codecdelay = av_rescale_q(codec->initial_padding,
+  (AVRational){ 1, codec->sample_rate 
},
+  (AVRational){ 1, 10 });
+if (codecdelay < 0) {
+av_log(s, AV_LOG_ERROR, "Initial padding is invalid\n");
+return AVERROR(EINVAL);
+}
 // mkv->tracks[i].ts_offset = av_rescale_q(codec->initial_padding,
 // (AVRational){ 1, 
codec->sample_rate },
 // st->time_base);
 
-put_ebml_uint(pb, MATROSKA_ID_CODECDELAY,
-  av_rescale_q(codec->initial_padding,
-   (AVRational){ 1, codec->sample_rate },
-   (AVRational){ 1, 10 }));
+put_ebml_uint(pb, MATROSKA_ID_CODECDELAY, codecdelay);
 }
 if (codec->codec_id == AV_CODEC_ID_OPUS) {
 put_ebml_uint(pb, MATROSKA_ID_SEEKPREROLL, OPUS_SEEK_PREROLL);

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


[FFmpeg-cvslog] avformat/utils: estimate_timings_from_pts - increase retry counter, fixes invalid duration for ts files with hevc codec

2015-12-09 Thread Rainer Hochecker
ffmpeg | branch: release/2.8 | Rainer Hochecker  | Sun 
Nov 15 13:58:50 2015 +0100| [5e105aca0145f0affc7e7115b64406e352811bc4] | 
committer: Michael Niedermayer

avformat/utils: estimate_timings_from_pts - increase retry counter, fixes 
invalid duration for ts files with hevc codec

Fixes a mpegts file with hevc that fails estimating duration. Increasing number 
of
retries fixes the issue.

Signed-off-by: Michael Niedermayer 
(cherry picked from commit 2d8c2f1a28073d451c7db31291c333cb15ca3d0b)

Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5e105aca0145f0affc7e7115b64406e352811bc4
---

 libavformat/utils.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 386ce37..30567fa 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2451,7 +2451,7 @@ static void 
estimate_timings_from_bit_rate(AVFormatContext *ic)
 }
 
 #define DURATION_MAX_READ_SIZE 25LL
-#define DURATION_MAX_RETRY 4
+#define DURATION_MAX_RETRY 6
 
 /* only usable for MPEG-PS streams */
 static void estimate_timings_from_pts(AVFormatContext *ic, int64_t old_offset)

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