[FFmpeg-cvslog] lavc/mediacodecdec: switch to the new generic filtering mechanism

2017-06-13 Thread Matthieu Bouron
ffmpeg | branch: master | Matthieu Bouron  | Sat Jun 
10 00:41:07 2017 +0200| [3839580b71345ec7a8245dc5faa562eb9903cb22] | committer: 
Matthieu Bouron

lavc/mediacodecdec: switch to the new generic filtering mechanism

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

 libavcodec/mediacodecdec.c | 74 --
 1 file changed, 13 insertions(+), 61 deletions(-)

diff --git a/libavcodec/mediacodecdec.c b/libavcodec/mediacodecdec.c
index 5bdeb6c1d7..6962ce2474 100644
--- a/libavcodec/mediacodecdec.c
+++ b/libavcodec/mediacodecdec.c
@@ -41,11 +41,9 @@ typedef struct MediaCodecH264DecContext {
 
 MediaCodecDecContext *ctx;
 
-AVBSFContext *bsf;
-
 AVFifoBuffer *fifo;
 
-AVPacket filtered_pkt;
+AVPacket buffered_pkt;
 
 } MediaCodecH264DecContext;
 
@@ -58,8 +56,7 @@ static av_cold int mediacodec_decode_close(AVCodecContext 
*avctx)
 
 av_fifo_free(s->fifo);
 
-av_bsf_free(&s->bsf);
-av_packet_unref(&s->filtered_pkt);
+av_packet_unref(&s->buffered_pkt);
 
 return 0;
 }
@@ -312,9 +309,6 @@ static av_cold int mediacodec_decode_init(AVCodecContext 
*avctx)
 
 const char *codec_mime = NULL;
 
-const char *bsf_name = NULL;
-const AVBitStreamFilter *bsf = NULL;
-
 FFAMediaFormat *format = NULL;
 MediaCodecH264DecContext *s = avctx->priv_data;
 
@@ -329,7 +323,6 @@ static av_cold int mediacodec_decode_init(AVCodecContext 
*avctx)
 #if CONFIG_H264_MEDIACODEC_DECODER
 case AV_CODEC_ID_H264:
 codec_mime = "video/avc";
-bsf_name = "h264_mp4toannexb";
 
 ret = h264_set_extradata(avctx, format);
 if (ret < 0)
@@ -339,7 +332,6 @@ static av_cold int mediacodec_decode_init(AVCodecContext 
*avctx)
 #if CONFIG_HEVC_MEDIACODEC_DECODER
 case AV_CODEC_ID_HEVC:
 codec_mime = "video/hevc";
-bsf_name = "hevc_mp4toannexb";
 
 ret = hevc_set_extradata(avctx, format);
 if (ret < 0)
@@ -410,25 +402,6 @@ static av_cold int mediacodec_decode_init(AVCodecContext 
*avctx)
 goto done;
 }
 
-if (bsf_name) {
-bsf = av_bsf_get_by_name(bsf_name);
-if(!bsf) {
-ret = AVERROR_BSF_NOT_FOUND;
-goto done;
-}
-
-if ((ret = av_bsf_alloc(bsf, &s->bsf))) {
-goto done;
-}
-
-if (((ret = avcodec_parameters_from_context(s->bsf->par_in, avctx)) < 0) ||
-((ret = av_bsf_init(s->bsf)) < 0)) {
-  goto done;
-}
-}
-
-av_init_packet(&s->filtered_pkt);
-
 done:
 if (format) {
 ff_AMediaFormat_delete(format);
@@ -502,11 +475,9 @@ static int mediacodec_decode_frame(AVCodecContext *avctx, 
void *data,
 
 /* process buffered data */
 while (!*got_frame) {
-/* prepare the input data -- convert to Annex B if needed */
-if (s->filtered_pkt.size <= 0) {
-AVPacket input_pkt = { 0 };
-
-av_packet_unref(&s->filtered_pkt);
+/* prepare the input data */
+if (s->buffered_pkt.size <= 0) {
+av_packet_unref(&s->buffered_pkt);
 
 /* no more data */
 if (av_fifo_size(s->fifo) < sizeof(AVPacket)) {
@@ -514,38 +485,17 @@ static int mediacodec_decode_frame(AVCodecContext *avctx, 
void *data,
 ff_mediacodec_dec_decode(avctx, s->ctx, frame, got_frame, 
avpkt);
 }
 
-av_fifo_generic_read(s->fifo, &input_pkt, sizeof(input_pkt), NULL);
-
-if (s->bsf) {
-ret = av_bsf_send_packet(s->bsf, &input_pkt);
-if (ret < 0) {
-return ret;
-}
-
-ret = av_bsf_receive_packet(s->bsf, &s->filtered_pkt);
-if (ret == AVERROR(EAGAIN)) {
-goto done;
-}
-} else {
-av_packet_move_ref(&s->filtered_pkt, &input_pkt);
-}
-
-/* {h264,hevc}_mp4toannexb are used here and do not require 
flushing */
-av_assert0(ret != AVERROR_EOF);
-
-if (ret < 0) {
-return ret;
-}
+av_fifo_generic_read(s->fifo, &s->buffered_pkt, 
sizeof(s->buffered_pkt), NULL);
 }
 
-ret = mediacodec_process_data(avctx, frame, got_frame, 
&s->filtered_pkt);
+ret = mediacodec_process_data(avctx, frame, got_frame, 
&s->buffered_pkt);
 if (ret < 0)
 return ret;
 
-s->filtered_pkt.size -= ret;
-s->filtered_pkt.data += ret;
+s->buffered_pkt.size -= ret;
+s->buffered_pkt.data += ret;
 }
-done:
+
 return avpkt->size;
 }
 
@@ -560,7 +510,7 @@ static void mediacodec_decode_flush(AVCodecContext *avctx)
 }
 av_fifo_reset(s->fifo);
 
-av_packet_unref(&s->filtered_pkt);
+av_packet_unref(&s->buffered_pkt);
 
 ff_mediacodec_dec_flush(avctx, s->ctx);
 }
@@ -578,6 +528,7 @@ AVCodec ff_h264_mediacodec_decoder = {
 .close  = mediacodec_decode_close,
 .capabilities   =

[FFmpeg-cvslog] avfilter: properly set SAR for A->V filters

2017-06-13 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Tue Jun 13 15:07:36 
2017 +0200| [f85cad799b52eb15f3dda40f4a400ee1a6e059a1] | committer: Paul B Mahol

avfilter: properly set SAR for A->V filters

Signed-off-by: Paul B Mahol 

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

 libavfilter/avf_abitscope.c| 2 ++
 libavfilter/avf_avectorscope.c | 1 +
 libavfilter/avf_showfreqs.c| 1 +
 libavfilter/avf_showspectrum.c | 3 ++-
 libavfilter/f_ebur128.c| 3 ++-
 5 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/libavfilter/avf_abitscope.c b/libavfilter/avf_abitscope.c
index 0f3e3594c1..0e3eaa422e 100644
--- a/libavfilter/avf_abitscope.c
+++ b/libavfilter/avf_abitscope.c
@@ -166,6 +166,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
*insamples)
 memset(outpicref->data[0] + i * outpicref->linesize[0], 0, outlink->w 
* 4);
 
 outpicref->pts = insamples->pts;
+outpicref->sample_aspect_ratio = (AVRational){1,1};
+
 switch (insamples->format) {
 case AV_SAMPLE_FMT_S16P:
 for (ch = 0; ch < inlink->channels; ch++) {
diff --git a/libavfilter/avf_avectorscope.c b/libavfilter/avf_avectorscope.c
index c6e278d30d..7cb5efb402 100644
--- a/libavfilter/avf_avectorscope.c
+++ b/libavfilter/avf_avectorscope.c
@@ -246,6 +246,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
*insamples)
 return AVERROR(ENOMEM);
 }
 
+s->outpicref->sample_aspect_ratio = (AVRational){1,1};
 for (i = 0; i < outlink->h; i++)
 memset(s->outpicref->data[0] + i * s->outpicref->linesize[0], 0, 
outlink->w * 4);
 }
diff --git a/libavfilter/avf_showfreqs.c b/libavfilter/avf_showfreqs.c
index 21735ed075..068ff1fb88 100644
--- a/libavfilter/avf_showfreqs.c
+++ b/libavfilter/avf_showfreqs.c
@@ -434,6 +434,7 @@ static int plot_freqs(AVFilterLink *inlink, AVFrame *in)
 
 av_free(colors);
 out->pts = in->pts;
+out->sample_aspect_ratio = (AVRational){1,1};
 return ff_filter_frame(outlink, out);
 }
 
diff --git a/libavfilter/avf_showspectrum.c b/libavfilter/avf_showspectrum.c
index ff66740a3a..4317161d79 100644
--- a/libavfilter/avf_showspectrum.c
+++ b/libavfilter/avf_showspectrum.c
@@ -306,6 +306,7 @@ static int config_output(AVFilterLink *outlink)
 
 outlink->w = s->w;
 outlink->h = s->h;
+outlink->sample_aspect_ratio = (AVRational){1,1};
 
 if (s->legend) {
 s->start_x = log10(inlink->sample_rate) * 25;
@@ -422,7 +423,7 @@ static int config_output(AVFilterLink *outlink)
 ff_get_video_buffer(outlink, outlink->w, outlink->h);
 if (!outpicref)
 return AVERROR(ENOMEM);
-outlink->sample_aspect_ratio = (AVRational){1,1};
+outpicref->sample_aspect_ratio = (AVRational){1,1};
 for (i = 0; i < outlink->h; i++) {
 memset(outpicref->data[0] + i * outpicref->linesize[0],   0, 
outlink->w);
 memset(outpicref->data[1] + i * outpicref->linesize[1], 128, 
outlink->w);
diff --git a/libavfilter/f_ebur128.c b/libavfilter/f_ebur128.c
index daeb9f9b58..1e8b90fa2f 100644
--- a/libavfilter/f_ebur128.c
+++ b/libavfilter/f_ebur128.c
@@ -269,6 +269,7 @@ static int config_video_output(AVFilterLink *outlink)
 }
 outlink->w = ebur128->w;
 outlink->h = ebur128->h;
+outlink->sample_aspect_ratio = (AVRational){1,1};
 
 #define PAD 8
 
@@ -299,7 +300,7 @@ static int config_video_output(AVFilterLink *outlink)
 ff_get_video_buffer(outlink, outlink->w, outlink->h);
 if (!outpicref)
 return AVERROR(ENOMEM);
-outlink->sample_aspect_ratio = (AVRational){1,1};
+outpicref->sample_aspect_ratio = (AVRational){1,1};
 
 /* init y references values (to draw LU lines) */
 ebur128->y_line_ref = av_calloc(ebur128->graph.h + 1, 
sizeof(*ebur128->y_line_ref));

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


[FFmpeg-cvslog] avcodec/aacsbr_fixed: Check shift in sbr_hf_assemble()

2017-06-13 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Tue 
Jun 13 16:25:59 2017 +0200| [d1992448d37f7cfa2acda5cc729dc0ff1b019390] | 
committer: Michael Niedermayer

avcodec/aacsbr_fixed: Check shift in sbr_hf_assemble()

Fixes: runtime error: shift exponent -10 is negative

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 

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

 libavcodec/aacsbr_fixed.c | 18 +-
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/libavcodec/aacsbr_fixed.c b/libavcodec/aacsbr_fixed.c
index 269c9a2c88..2531637194 100644
--- a/libavcodec/aacsbr_fixed.c
+++ b/libavcodec/aacsbr_fixed.c
@@ -575,22 +575,30 @@ static void sbr_hf_assemble(int Y1[38][64][2],
 
 SoftFloat *in  = sbr->s_m[e];
 for (m = 0; m+1 < m_max; m+=2) {
+int shift2;
 shift = 22 - in[m  ].exp;
+shift2= 22 - in[m+1].exp;
+if (shift < 1 || shift2 < 1) {
+av_log(NULL, AV_LOG_ERROR, "Overflow in 
sbr_hf_assemble, shift=%d,%d\n", shift, shift2);
+return;
+}
 if (shift < 32) {
 round = 1 << (shift-1);
 out[2*m  ] += (in[m  ].mant * A + round) >> shift;
 }
 
-shift = 22 - in[m+1].exp;
-if (shift < 32) {
-round = 1 << (shift-1);
-out[2*m+2] += (in[m+1].mant * B + round) >> shift;
+if (shift2 < 32) {
+round = 1 << (shift2-1);
+out[2*m+2] += (in[m+1].mant * B + round) >> shift2;
 }
 }
 if(m_max&1)
 {
 shift = 22 - in[m  ].exp;
-if (shift < 32) {
+if (shift < 1) {
+av_log(NULL, AV_LOG_ERROR, "Overflow in 
sbr_hf_assemble, shift=%d\n", shift);
+return;
+} else if (shift < 32) {
 round = 1 << (shift-1);
 out[2*m  ] += (in[m  ].mant * A + round) >> shift;
 }

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


[FFmpeg-cvslog] avcodec/aacsbr_fixed: Fix signed integer overflow in sbr_hf_inverse_filter()

2017-06-13 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Tue 
Jun 13 17:10:30 2017 +0200| [4cc2a357f5dce9bad36b59fb31ba5cf61cc56272] | 
committer: Michael Niedermayer

avcodec/aacsbr_fixed: Fix signed integer overflow in sbr_hf_inverse_filter()

Fixes: runtime error: signed integer overflow: 2147483584 + 128 cannot be 
represented in type 'int'
Fixes: 2164/clusterfuzz-testcase-minimized-4715936172998656

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 

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

 libavcodec/aacsbr_fixed.c | 28 
 1 file changed, 12 insertions(+), 16 deletions(-)

diff --git a/libavcodec/aacsbr_fixed.c b/libavcodec/aacsbr_fixed.c
index 2531637194..289bb86a81 100644
--- a/libavcodec/aacsbr_fixed.c
+++ b/libavcodec/aacsbr_fixed.c
@@ -291,10 +291,9 @@ static void sbr_hf_inverse_filter(SBRDSPContext *dsp,
 else if (shift <= -30)
 alpha0[k][0] = 0;
 else {
-a00.mant *= 2;
-shift = 2-shift;
-if (shift == 0)
-alpha0[k][0] = a00.mant;
+shift = 1-shift;
+if (shift <= 0)
+alpha0[k][0] = a00.mant * (1<<-shift);
 else {
 round = 1 << (shift-1);
 alpha0[k][0] = (a00.mant + round) >> shift;
@@ -307,10 +306,9 @@ static void sbr_hf_inverse_filter(SBRDSPContext *dsp,
 else if (shift <= -30)
 alpha0[k][1] = 0;
 else {
-a01.mant *= 2;
-shift = 2-shift;
-if (shift == 0)
-alpha0[k][1] = a01.mant;
+shift = 1-shift;
+if (shift <= 0)
+alpha0[k][1] = a01.mant * (1<<-shift);
 else {
 round = 1 << (shift-1);
 alpha0[k][1] = (a01.mant + round) >> shift;
@@ -322,10 +320,9 @@ static void sbr_hf_inverse_filter(SBRDSPContext *dsp,
 else if (shift <= -30)
 alpha1[k][0] = 0;
 else {
-a10.mant *= 2;
-shift = 2-shift;
-if (shift == 0)
-alpha1[k][0] = a10.mant;
+shift = 1-shift;
+if (shift <= 0)
+alpha1[k][0] = a10.mant * (1<<-shift);
 else {
 round = 1 << (shift-1);
 alpha1[k][0] = (a10.mant + round) >> shift;
@@ -338,10 +335,9 @@ static void sbr_hf_inverse_filter(SBRDSPContext *dsp,
 else if (shift <= -30)
 alpha1[k][1] = 0;
 else {
-a11.mant *= 2;
-shift = 2-shift;
-if (shift == 0)
-alpha1[k][1] = a11.mant;
+shift = 1-shift;
+if (shift <= 0)
+alpha1[k][1] = a11.mant * (1<<-shift);
 else {
 round = 1 << (shift-1);
 alpha1[k][1] = (a11.mant + round) >> shift;

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


[FFmpeg-cvslog] avcodec/sbrdsp_fixed: Return an error from sbr_hf_apply_noise() if operations are impossible

2017-06-13 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Tue 
Jun 13 13:28:23 2017 +0200| [d549f026d8b64b879c3ce3b8c7d153c82aa5eb52] | 
committer: Michael Niedermayer

avcodec/sbrdsp_fixed: Return an error from sbr_hf_apply_noise() if operations 
are impossible

Fixes: 1775/clusterfuzz-testcase-minimized-5330288148217856

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 

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

 libavcodec/sbrdsp_fixed.c | 13 ++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/libavcodec/sbrdsp_fixed.c b/libavcodec/sbrdsp_fixed.c
index 748772102e..218bb1acd8 100644
--- a/libavcodec/sbrdsp_fixed.c
+++ b/libavcodec/sbrdsp_fixed.c
@@ -253,7 +253,7 @@ static void sbr_hf_g_filt_c(int (*Y)[2], const int 
(*X_high)[40][2],
 }
 }
 
-static av_always_inline void sbr_hf_apply_noise(int (*Y)[2],
+static av_always_inline int sbr_hf_apply_noise(int (*Y)[2],
 const SoftFloat *s_m,
 const SoftFloat *q_filt,
 int noise,
@@ -271,7 +271,10 @@ static av_always_inline void sbr_hf_apply_noise(int 
(*Y)[2],
 int shift, round;
 
 shift = 22 - s_m[m].exp;
-if (shift < 30) {
+if (shift < 1) {
+av_log(NULL, AV_LOG_ERROR, "Overflow in sbr_hf_apply_noise, 
shift=%d\n", shift);
+return AVERROR(ERANGE);
+} else if (shift < 30) {
 round = 1 << (shift-1);
 y0 += (s_m[m].mant * phi_sign0 + round) >> shift;
 y1 += (s_m[m].mant * phi_sign1 + round) >> shift;
@@ -281,7 +284,10 @@ static av_always_inline void sbr_hf_apply_noise(int 
(*Y)[2],
 int64_t accu;
 
 shift = 22 - q_filt[m].exp;
-if (shift < 30) {
+if (shift < 1) {
+av_log(NULL, AV_LOG_ERROR, "Overflow in sbr_hf_apply_noise, 
shift=%d\n", shift);
+return AVERROR(ERANGE);
+} else if (shift < 30) {
 round = 1 << (shift-1);
 
 accu = (int64_t)q_filt[m].mant * 
ff_sbr_noise_table_fixed[noise][0];
@@ -297,6 +303,7 @@ static av_always_inline void sbr_hf_apply_noise(int (*Y)[2],
 Y[m][1] = y1;
 phi_sign1 = -phi_sign1;
 }
+return 0;
 }
 
 #include "sbrdsp_template.c"

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


[FFmpeg-cvslog] lavc/aarch64/simple_idct: fix idct_col4_top coefficient

2017-06-13 Thread Matthieu Bouron
ffmpeg | branch: master | Matthieu Bouron  | Tue Jun 
13 17:19:51 2017 +0200| [8aa60606fb64b8280627935b0df55d4d2aeca5d1] | committer: 
Matthieu Bouron

lavc/aarch64/simple_idct: fix idct_col4_top coefficient

Fixes regression introduced by 5d0b8b1ae307951310c7d9a8fa282fbca9b997cd.

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

 libavcodec/aarch64/simple_idct_neon.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/aarch64/simple_idct_neon.S 
b/libavcodec/aarch64/simple_idct_neon.S
index 92987985d2..5bd31e5be9 100644
--- a/libavcodec/aarch64/simple_idct_neon.S
+++ b/libavcodec/aarch64/simple_idct_neon.S
@@ -74,7 +74,7 @@ endconst
 .endm
 
 .macro idct_col4_top y1, y2, y3, y4, i, l
-smull\i v7.4S,  \y3\l, z1
+smull\i v7.4S,  \y3\l, z2
 smull\i v16.4S, \y3\l, z6
 smull\i v17.4S, \y2\l, z1
 add v19.4S, v23.4S, v7.4S

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


[FFmpeg-cvslog] lavc/aarch64/simple_idct: fix idct_col4_top coefficient

2017-06-13 Thread Matthieu Bouron
ffmpeg | branch: release/3.3 | Matthieu Bouron  | 
Tue Jun 13 17:19:51 2017 +0200| [20f5e2c17785ef84db565e658420faf6f8ca0807] | 
committer: Matthieu Bouron

lavc/aarch64/simple_idct: fix idct_col4_top coefficient

Fixes regression introduced by 5d0b8b1ae307951310c7d9a8fa282fbca9b997cd.

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

 libavcodec/aarch64/simple_idct_neon.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/aarch64/simple_idct_neon.S 
b/libavcodec/aarch64/simple_idct_neon.S
index 92987985d2..5bd31e5be9 100644
--- a/libavcodec/aarch64/simple_idct_neon.S
+++ b/libavcodec/aarch64/simple_idct_neon.S
@@ -74,7 +74,7 @@ endconst
 .endm
 
 .macro idct_col4_top y1, y2, y3, y4, i, l
-smull\i v7.4S,  \y3\l, z1
+smull\i v7.4S,  \y3\l, z2
 smull\i v16.4S, \y3\l, z6
 smull\i v17.4S, \y2\l, z1
 add v19.4S, v23.4S, v7.4S

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


[FFmpeg-cvslog] avformat/librtmp: check return value of setsockopt

2017-06-13 Thread Timo Rothenpieler
ffmpeg | branch: master | Timo Rothenpieler  | Sun Jun 
11 15:08:43 2017 +0200| [4b2a2969f3e06433a06f835d2af2bae4499314ae] | committer: 
Timo Rothenpieler

avformat/librtmp: check return value of setsockopt

Fixes CID 1396837

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

 libavformat/librtmp.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavformat/librtmp.c b/libavformat/librtmp.c
index 146df660ac..f3cfa9a8e2 100644
--- a/libavformat/librtmp.c
+++ b/libavformat/librtmp.c
@@ -239,7 +239,10 @@ static int rtmp_open(URLContext *s, const char *uri, int 
flags)
 #if CONFIG_NETWORK
 if (ctx->buffer_size >= 0 && (flags & AVIO_FLAG_WRITE)) {
 int tmp = ctx->buffer_size;
-setsockopt(r->m_sb.sb_socket, SOL_SOCKET, SO_SNDBUF, &tmp, 
sizeof(tmp));
+if (setsockopt(r->m_sb.sb_socket, SOL_SOCKET, SO_SNDBUF, &tmp, 
sizeof(tmp))) {
+rc = AVERROR_EXTERNAL;
+goto fail;
+}
 }
 #endif
 

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


[FFmpeg-cvslog] avfilter/vf_scale_npp: fix out-of-bounds reads

2017-06-13 Thread Timo Rothenpieler
ffmpeg | branch: master | Timo Rothenpieler  | Sun Jun 
11 14:56:44 2017 +0200| [0fbc9b39b9a6f62d57f237052b64eefac578] | committer: 
Timo Rothenpieler

avfilter/vf_scale_npp: fix out-of-bounds reads

Fixes CIDs 1396414 and 1396415

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

 libavfilter/vf_scale_npp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/vf_scale_npp.c b/libavfilter/vf_scale_npp.c
index b5acce653b..c36772e800 100644
--- a/libavfilter/vf_scale_npp.c
+++ b/libavfilter/vf_scale_npp.c
@@ -400,7 +400,7 @@ static int nppscale_resize(AVFilterContext *ctx, 
NPPScaleStageContext *stage,
 NppStatus err;
 int i;
 
-for (i = 0; i < FF_ARRAY_ELEMS(in->data) && in->data[i]; i++) {
+for (i = 0; i < FF_ARRAY_ELEMS(stage->planes_in) && i < 
FF_ARRAY_ELEMS(in->data) && in->data[i]; i++) {
 int iw = stage->planes_in[i].width;
 int ih = stage->planes_in[i].height;
 int ow = stage->planes_out[i].width;

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


[FFmpeg-cvslog] avfilter/unsharp: fix uninitialized pointer read

2017-06-13 Thread Timo Rothenpieler
ffmpeg | branch: master | Timo Rothenpieler  | Sun Jun 
11 14:50:01 2017 +0200| [21583e936a06fa0c9dca99436c21d441d04e57f4] | committer: 
Timo Rothenpieler

avfilter/unsharp: fix uninitialized pointer read

Fixes CID 1396855

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

 libavfilter/unsharp_opencl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/unsharp_opencl.c b/libavfilter/unsharp_opencl.c
index d84920c590..1545455846 100644
--- a/libavfilter/unsharp_opencl.c
+++ b/libavfilter/unsharp_opencl.c
@@ -43,7 +43,7 @@ static int compute_mask(int step, uint32_t *mask)
 {
 int i, z, ret = 0;
 int counter_size = sizeof(uint32_t) * (2 * step + 1);
-uint32_t *temp1_counter, *temp2_counter, **counter;
+uint32_t *temp1_counter, *temp2_counter, **counter = NULL;
 temp1_counter = av_mallocz(counter_size);
 if (!temp1_counter) {
 ret = AVERROR(ENOMEM);
@@ -80,7 +80,7 @@ static int compute_mask(int step, uint32_t *mask)
 end:
 av_freep(&temp1_counter);
 av_freep(&temp2_counter);
-for (i = 0; i < 2 * step + 1; i++) {
+for (i = 0; counter && i < 2 * step + 1; i++) {
 av_freep(&counter[i]);
 }
 av_freep(&counter);

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


[FFmpeg-cvslog] avformat/pcmdec: fix memory leak

2017-06-13 Thread Timo Rothenpieler
ffmpeg | branch: master | Timo Rothenpieler  | Sun Jun 
11 15:19:17 2017 +0200| [a5b5ce2658bf7506bb31f0b2b4cb44ddbf9a3955] | committer: 
Timo Rothenpieler

avformat/pcmdec: fix memory leak

Fixes CID 1396267

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

 libavformat/pcmdec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/pcmdec.c b/libavformat/pcmdec.c
index 3c7e8ac84b..d0ceea6fa9 100644
--- a/libavformat/pcmdec.c
+++ b/libavformat/pcmdec.c
@@ -68,6 +68,7 @@ static int pcm_read_header(AVFormatContext *s)
 av_log(s, AV_LOG_ERROR,
"Invalid sample_rate found in mime_type \"%s\"\n",
mime_type);
+av_freep(&mime_type);
 return AVERROR_INVALIDDATA;
 }
 st->codecpar->sample_rate = rate;
@@ -75,6 +76,7 @@ static int pcm_read_header(AVFormatContext *s)
 st->codecpar->channels = channels;
 }
 }
+av_freep(&mime_type);
 
 st->codecpar->bits_per_coded_sample =
 av_get_bits_per_sample(st->codecpar->codec_id);

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


[FFmpeg-cvslog] avfilter/vf_signature: fix memory leaks in error cases

2017-06-13 Thread Timo Rothenpieler
ffmpeg | branch: master | Timo Rothenpieler  | Sun Jun 
11 15:29:35 2017 +0200| [feb13aed794a7f1a1f8395159e9b077351348a34] | committer: 
Timo Rothenpieler

avfilter/vf_signature: fix memory leaks in error cases

Fixes CIDs 1403234 and 1403235

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

 libavfilter/vf_signature.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavfilter/vf_signature.c b/libavfilter/vf_signature.c
index 06b1b910d4..f0078ba1a6 100644
--- a/libavfilter/vf_signature.c
+++ b/libavfilter/vf_signature.c
@@ -260,8 +260,10 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
*picref)
 if (!elemsignature)
 return AVERROR(ENOMEM);
 sortsignature = av_malloc_array(elemcat->elem_count, sizeof(int64_t));
-if (!sortsignature)
+if (!sortsignature) {
+av_freep(&elemsignature);
 return AVERROR(ENOMEM);
+}
 
 for (j = 0; j < elemcat->elem_count; j++) {
 blocksum = 0;
@@ -508,6 +510,7 @@ static int binary_export(AVFilterContext *ctx, 
StreamContext *sc, const char* fi
 char buf[128];
 av_strerror(err, buf, sizeof(buf));
 av_log(ctx, AV_LOG_ERROR, "cannot open file %s: %s\n", filename, buf);
+av_freep(&buffer);
 return err;
 }
 init_put_bits(&buf, buffer, len);

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