[FFmpeg-cvslog] avfilter/avfilter: Remove unused count
ffmpeg | branch: master | Andreas Rheinhardt | Sat Sep 11 01:32:05 2021 +0200| [dc2279a4f2898dc2a45afb969c5a9c253a4fe4e9] | committer: Andreas Rheinhardt avfilter/avfilter: Remove unused count Reviewed-by: Paul B Mahol Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dc2279a4f2898dc2a45afb969c5a9c253a4fe4e9 --- libavfilter/avfilter.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index a04f8ed62f..c614eb0740 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -812,7 +812,7 @@ static int process_options(AVFilterContext *ctx, AVDictionary **options, const char *args) { const AVOption *o = NULL; -int ret, count = 0; +int ret; char *av_uninit(parsed_key), *av_uninit(value); const char *key; int offset= -1; @@ -875,10 +875,9 @@ static int process_options(AVFilterContext *ctx, AVDictionary **options, av_free(value); av_free(parsed_key); -count++; } -return count; +return 0; } int ff_filter_process_command(AVFilterContext *ctx, const char *cmd, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avfilter/vf_maskedminmax: Simplify init
ffmpeg | branch: master | Andreas Rheinhardt | Fri Sep 10 19:44:26 2021 +0200| [142f41a0600317654d54ba2cdca9754a522c8819] | committer: Andreas Rheinhardt avfilter/vf_maskedminmax: Simplify init Reviewed-by: Paul B Mahol Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=142f41a0600317654d54ba2cdca9754a522c8819 --- libavfilter/vf_maskedminmax.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libavfilter/vf_maskedminmax.c b/libavfilter/vf_maskedminmax.c index afac145e2a..f0c499a0d5 100644 --- a/libavfilter/vf_maskedminmax.c +++ b/libavfilter/vf_maskedminmax.c @@ -54,11 +54,11 @@ static const AVOption maskedminmax_options[] = { { NULL } }; -static av_cold int init(AVFilterContext *ctx) +static av_cold int maskedmin_init(AVFilterContext *ctx) { MaskedMinMaxContext *s = ctx->priv; -s->maskedmin = !strcmp(ctx->filter->name, "maskedmin"); +s->maskedmin = 1; return 0; } @@ -331,7 +331,7 @@ const AVFilter ff_vf_maskedmin = { .description = NULL_IF_CONFIG_SMALL("Apply filtering with minimum difference of two streams."), .priv_class= &maskedmin_class, .priv_size = sizeof(MaskedMinMaxContext), -.init = init, +.init = maskedmin_init, .uninit= uninit, .activate = activate, .query_formats = query_formats, @@ -349,7 +349,6 @@ const AVFilter ff_vf_maskedmax = { .description = NULL_IF_CONFIG_SMALL("Apply filtering with maximum difference of two streams."), .priv_class= &maskedmax_class, .priv_size = sizeof(MaskedMinMaxContext), -.init = init, .uninit= uninit, .activate = activate, .query_formats = query_formats, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avfilter/internal: Add AVFILTER_DEFINE_CLASS_EXT
ffmpeg | branch: master | Andreas Rheinhardt | Fri Sep 10 20:20:08 2021 +0200| [441b292592075b771dff7ee46293157eeb804252] | committer: Andreas Rheinhardt avfilter/internal: Add AVFILTER_DEFINE_CLASS_EXT This macro will allow to share options between AVClasses without having to redefine the option name (as is currently done) and will also allow to share the AVClasses itself (which is possible now that AVClass.child_class_next is gone). Reviewed-by: Paul B Mahol Signed-off-by: Andreas Rheinhardt > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=441b292592075b771dff7ee46293157eeb804252 --- libavfilter/internal.h | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libavfilter/internal.h b/libavfilter/internal.h index 6ddf024d93..e7c154aff0 100644 --- a/libavfilter/internal.h +++ b/libavfilter/internal.h @@ -278,14 +278,16 @@ int ff_append_outpad_free_name(AVFilterContext *f, AVFilterPad *p); */ int ff_request_frame(AVFilterLink *link); -#define AVFILTER_DEFINE_CLASS(fname)\ -static const AVClass fname##_class = { \ -.class_name = #fname, \ +#define AVFILTER_DEFINE_CLASS_EXT(name, desc, options) \ +static const AVClass name##_class = { \ +.class_name = desc, \ .item_name = av_default_item_name, \ -.option = fname##_options, \ +.option = options, \ .version= LIBAVUTIL_VERSION_INT,\ .category = AV_CLASS_CATEGORY_FILTER, \ } +#define AVFILTER_DEFINE_CLASS(fname) \ +AVFILTER_DEFINE_CLASS_EXT(fname, #fname, fname##_options) /** * Find the index of a link. ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avformat/mxfdec: check channel number in mxf_get_d10_aes3_packet()
ffmpeg | branch: master | Michael Niedermayer | Sun Sep 5 21:24:15 2021 +0200| [3dd5a8a13510d08a4e25e8f138d718672a0fed4a] | committer: Michael Niedermayer avformat/mxfdec: check channel number in mxf_get_d10_aes3_packet() Fixes: Out of array access Fixes: 37030/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5387719147651072 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Tomas Härdin Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3dd5a8a13510d08a4e25e8f138d718672a0fed4a --- libavformat/mxfdec.c | 4 1 file changed, 4 insertions(+) diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index 55f2e5c767..ebe411b04d 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -552,6 +552,10 @@ static int mxf_get_d10_aes3_packet(AVIOContext *pb, AVStream *st, AVPacket *pkt, data_ptr = pkt->data; end_ptr = pkt->data + length; buf_ptr = pkt->data + 4; /* skip SMPTE 331M header */ + +if (st->codecpar->channels > 8) +return AVERROR_INVALIDDATA; + for (; end_ptr - buf_ptr >= st->codecpar->channels * 4; ) { for (i = 0; i < st->codecpar->channels; i++) { uint32_t sample = bytestream_get_le32(&buf_ptr); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avformat/jacosubdec: Check for min in t overflow in get_shift()
ffmpeg | branch: master | Michael Niedermayer | Thu Jun 3 22:26:41 2021 +0200| [989febfbd0c986e9e3e0f269a6b22778bf79147b] | committer: Michael Niedermayer avformat/jacosubdec: Check for min in t overflow in get_shift() Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself Fixes: 34651/clusterfuzz-testcase-minimized-ffmpeg_dem_JACOSUB_fuzzer-5157941012463616 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=989febfbd0c986e9e3e0f269a6b22778bf79147b --- libavformat/jacosubdec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavformat/jacosubdec.c b/libavformat/jacosubdec.c index 8cb918ccee..68ed7511d7 100644 --- a/libavformat/jacosubdec.c +++ b/libavformat/jacosubdec.c @@ -134,6 +134,9 @@ static int get_shift(int timeres, const char *buf) int n = sscanf(buf, "%d"SSEP"%d"SSEP"%d"SSEP"%d", &a, &b, &c, &d); #undef SSEP +if (a == INT_MIN) +return 0; + if (*buf == '-' || a < 0) { sign = -1; a = FFABS(a); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avfilter/vf_avgblur: fix heap-buffer overflow
ffmpeg | branch: release/4.1 | Paul B Mahol | Tue Oct 15 16:31:15 2019 +0200| [01f3824f6c46ef19025059752a4381daa2443097] | committer: James Almer avfilter/vf_avgblur: fix heap-buffer overflow Fixes #8274 (cherry picked from commit f069a9c2a65bc20c3462127623127df6dfd06c5b) Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=01f3824f6c46ef19025059752a4381daa2443097 --- libavfilter/vf_avgblur.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/vf_avgblur.c b/libavfilter/vf_avgblur.c index c7b88427fd..b813237258 100644 --- a/libavfilter/vf_avgblur.c +++ b/libavfilter/vf_avgblur.c @@ -149,7 +149,7 @@ static int filter_vertically_##name(AVFilterContext *ctx, void *arg, int jobnr, \ src = s->buffer + x; \ ptr = buffer + x; \ -for (i = 0; i <= radius; i++) { \ +for (i = 0; i + radius < height && i <= radius; i++) { \ acc += src[(i + radius) * width]; \ count++; \ ptr[i * linesize] = acc / count; \ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avfilter/vf_neighbor: check if width is 1
ffmpeg | branch: release/4.1 | Paul B Mahol | Fri Oct 11 06:18:10 2019 -0300| [f5da6cff3504978bf6e713996988dcef0691d800] | committer: James Almer avfilter/vf_neighbor: check if width is 1 Fixes #8242 (cherry picked from commit e787f8fd7ee99ba0c3e0f086ce2ce59eea7ed86c) Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f5da6cff3504978bf6e713996988dcef0691d800 --- libavfilter/vf_neighbor.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libavfilter/vf_neighbor.c b/libavfilter/vf_neighbor.c index 2db1e5e57c..f84a33ef75 100644 --- a/libavfilter/vf_neighbor.c +++ b/libavfilter/vf_neighbor.c @@ -285,9 +285,11 @@ static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) src + (width - 2) * bpc, src + (width - 2) * bpc, src + (width - 2) * bpc + ph * stride, src + (width - 1) * bpc + ph * stride, src + (width - 2) * bpc + ph * stride}; -s->filter(dst, src, 1, threshold, coordinateslb, s->coordinates); -s->filter(dst + 1 * bpc, src + 1 * bpc, width - 2, threshold, coordinates, s->coordinates); -s->filter(dst + (width - 1) * bpc, src + (width - 1) * bpc, 1, threshold, coordinatesrb, s->coordinates); +s->filter(dst, src, 1, threshold, coordinateslb, s->coordinates); +if (width > 1) { +s->filter(dst + 1 * bpc, src + 1 * bpc, width - 2, threshold, coordinates, s->coordinates); +s->filter(dst + (width - 1) * bpc, src + (width - 1) * bpc, 1, threshold, coordinatesrb, s->coordinates); +} src += stride; dst += dstride; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avfilter/af_tremolo: fix heap-buffer overflow
ffmpeg | branch: release/4.1 | Paul B Mahol | Sat Oct 19 19:34:47 2019 +0200| [3a9f384225cb6e5720d36d0b01dd446cfd6f1772] | committer: James Almer avfilter/af_tremolo: fix heap-buffer overflow Fixes #8317 (cherry picked from commit 58bb9d3a3a6ede1c6cfb82bf671a5f138e6b2144) Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3a9f384225cb6e5720d36d0b01dd446cfd6f1772 --- libavfilter/af_tremolo.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libavfilter/af_tremolo.c b/libavfilter/af_tremolo.c index 8cbc79892d..f55e8e2b09 100644 --- a/libavfilter/af_tremolo.c +++ b/libavfilter/af_tremolo.c @@ -28,6 +28,7 @@ typedef struct TremoloContext { double freq; double depth; double *table; +int table_size; int index; } TremoloContext; @@ -72,7 +73,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) dst += channels; src += channels; s->index++; -if (s->index >= inlink->sample_rate / s->freq) +if (s->index >= s->table_size) s->index = 0; } @@ -125,11 +126,12 @@ static int config_input(AVFilterLink *inlink) const double offset = 1. - s->depth / 2.; int i; -s->table = av_malloc_array(inlink->sample_rate / s->freq, sizeof(*s->table)); +s->table_size = inlink->sample_rate / s->freq; +s->table = av_malloc_array(s->table_size, sizeof(*s->table)); if (!s->table) return AVERROR(ENOMEM); -for (i = 0; i < inlink->sample_rate / s->freq; i++) { +for (i = 0; i < s->table_size; i++) { double env = s->freq * i / inlink->sample_rate; env = sin(2 * M_PI * fmod(env + 0.25, 1.0)); s->table[i] = env * (1 - fabs(offset)) + offset; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avfilter/vf_edgedetect: check if height is big enough
ffmpeg | branch: release/4.1 | Paul B Mahol | Sun Oct 13 17:23:10 2019 +0200| [540047eda8391da511142d782c4145b23fdad173] | committer: James Almer avfilter/vf_edgedetect: check if height is big enough Fixes #8260 (cherry picked from commit ccf4ab8c9aca0aee66bcc2914031a9c97ac0eeb8) Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=540047eda8391da511142d782c4145b23fdad173 --- libavfilter/vf_edgedetect.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libavfilter/vf_edgedetect.c b/libavfilter/vf_edgedetect.c index a0ddcbbf5c..11a31fa4ff 100644 --- a/libavfilter/vf_edgedetect.c +++ b/libavfilter/vf_edgedetect.c @@ -150,7 +150,8 @@ static void gaussian_blur(AVFilterContext *ctx, int w, int h, int i, j; memcpy(dst, src, w); dst += dst_linesize; src += src_linesize; -memcpy(dst, src, w); dst += dst_linesize; src += src_linesize; +if (h > 1) +memcpy(dst, src, w); dst += dst_linesize; src += src_linesize; for (j = 2; j < h - 2; j++) { dst[0] = src[0]; dst[1] = src[1]; @@ -180,8 +181,10 @@ static void gaussian_blur(AVFilterContext *ctx, int w, int h, dst += dst_linesize; src += src_linesize; } -memcpy(dst, src, w); dst += dst_linesize; src += src_linesize; -memcpy(dst, src, w); +if (h > 2) +memcpy(dst, src, w); dst += dst_linesize; src += src_linesize; +if (h > 3) +memcpy(dst, src, w); } enum { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avfilter/vf_bitplanenoise: fix overreads
ffmpeg | branch: release/4.1 | Paul B Mahol | Fri Oct 11 12:42:13 2019 +0200| [69f5d4b7fdcb93c2948255193870f5ea7605028c] | committer: James Almer avfilter/vf_bitplanenoise: fix overreads Fixes #8244 (cherry picked from commit 0b567238741854b41f84f7457686b044eadfe29c) Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=69f5d4b7fdcb93c2948255193870f5ea7605028c --- libavfilter/vf_bitplanenoise.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/vf_bitplanenoise.c b/libavfilter/vf_bitplanenoise.c index 4ec3a22572..94aa24abec 100644 --- a/libavfilter/vf_bitplanenoise.c +++ b/libavfilter/vf_bitplanenoise.c @@ -122,7 +122,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) if (s->depth <= 8) { for (plane = 0; plane < s->nb_planes; plane++) { -const int linesize = in->linesize[plane]; +const int linesize = s->planeheight[plane] > 1 ? in->linesize[plane] : 0; const int dlinesize = out->linesize[plane]; uint8_t *val = in->data[plane]; uint8_t *dst = s->filter ? out->data[plane]: NULL; @@ -151,7 +151,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) } } else { for (plane = 0; plane < s->nb_planes; plane++) { -const int linesize = in->linesize[plane] / 2; +const int linesize = s->planeheight[plane] > 1 ? in->linesize[plane] / 2 : 0; const int dlinesize = out->linesize[plane] / 2; uint16_t *val = (uint16_t *)in->data[plane]; uint16_t *dst = s->filter ? (uint16_t *)out->data[plane] : NULL; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avfilter/vf_fieldorder: fix heap-buffer overflow
ffmpeg | branch: release/4.1 | Paul B Mahol | Sun Oct 13 23:10:16 2019 +0200| [c79606f233fed20a6d31e6cd5f24466021eaf94b] | committer: James Almer avfilter/vf_fieldorder: fix heap-buffer overflow Fixes #8264 (cherry picked from commit 07050d7bdc32d82e53ee5bb727f5882323d00dba) Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c79606f233fed20a6d31e6cd5f24466021eaf94b --- libavfilter/vf_fieldorder.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/vf_fieldorder.c b/libavfilter/vf_fieldorder.c index ca55ff1f66..5707151f1b 100644 --- a/libavfilter/vf_fieldorder.c +++ b/libavfilter/vf_fieldorder.c @@ -108,8 +108,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) s->dst_tff ? "up" : "down"); h = frame->height; for (plane = 0; plane < 4 && frame->data[plane] && frame->linesize[plane]; plane++) { -dst_line_step = out->linesize[plane]; -src_line_step = frame->linesize[plane]; +dst_line_step = out->linesize[plane] * (h > 2); +src_line_step = frame->linesize[plane] * (h > 2); line_size = s->line_size[plane]; dst = out->data[plane]; src = frame->data[plane]; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avcodec/pngenc: remove monowhite from apng formats
ffmpeg | branch: release/4.1 | Paul B Mahol | Sun Feb 14 17:20:03 2021 +0100| [e06e89f6275c62316da489c567fce3d2ef6f594a] | committer: James Almer avcodec/pngenc: remove monowhite from apng formats Monowhite pixel format is not supported, and it does not make sense to add support for it. Fixes #7989 (cherry picked from commit 5d9f44da460f781a1604d537d0555b78e29438ba) Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e06e89f6275c62316da489c567fce3d2ef6f594a --- libavcodec/pngenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c index 69b4495404..dfc8eb58e6 100644 --- a/libavcodec/pngenc.c +++ b/libavcodec/pngenc.c @@ -1174,7 +1174,7 @@ AVCodec ff_apng_encoder = { AV_PIX_FMT_PAL8, AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY8A, AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_YA16BE, -AV_PIX_FMT_MONOBLACK, AV_PIX_FMT_NONE +AV_PIX_FMT_NONE }, .priv_class = &apngenc_class, }; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avfilter/vf_fieldmatch: fix heap-buffer overflow
ffmpeg | branch: release/4.1 | Paul B Mahol | Sat Oct 19 11:56:02 2019 +0200| [d60effdf83eddcdb18c84d339a526fb0318723fe] | committer: James Almer avfilter/vf_fieldmatch: fix heap-buffer overflow Also fix use of uninitialized values. Fixes #8239 (cherry picked from commit ce5274c1385d55892a692998923802023526b765) Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d60effdf83eddcdb18c84d339a526fb0318723fe --- libavfilter/vf_fieldmatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/vf_fieldmatch.c b/libavfilter/vf_fieldmatch.c index 5a73eb43b8..8d1e68b85f 100644 --- a/libavfilter/vf_fieldmatch.c +++ b/libavfilter/vf_fieldmatch.c @@ -938,7 +938,7 @@ static int config_input(AVFilterLink *inlink) fm->tpitchy = FFALIGN(w, 16); fm->tpitchuv = FFALIGN(w >> 1, 16); -fm->tbuffer = av_malloc(h/2 * fm->tpitchy); +fm->tbuffer = av_calloc((h/2 + 4) * fm->tpitchy, sizeof(*fm->tbuffer)); fm->c_array = av_mallocw + fm->blockx/2)/fm->blockx)+1) * (((h + fm->blocky/2)/fm->blocky)+1) * 4 * sizeof(*fm->c_array)); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avfilter/vf_colorconstancy: fix overreads in gauss array
ffmpeg | branch: release/4.1 | Paul B Mahol | Sat Oct 12 11:07:54 2019 +0200| [29f1cf0c0f5d90e81a438dc12a4782dc424bf5ec] | committer: James Almer avfilter/vf_colorconstancy: fix overreads in gauss array Fixes #8250 (cherry picked from commit a7fd1279703683ebb548ef7baa2f1519994496ae) Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=29f1cf0c0f5d90e81a438dc12a4782dc424bf5ec --- libavfilter/vf_colorconstancy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/vf_colorconstancy.c b/libavfilter/vf_colorconstancy.c index e3bb39e51b..cc081e957f 100644 --- a/libavfilter/vf_colorconstancy.c +++ b/libavfilter/vf_colorconstancy.c @@ -280,7 +280,7 @@ static int slice_get_derivative(AVFilterContext* ctx, void* arg, int jobnr, int dst[INDX2D(r, c, width)] = 0; for (g = 0; g < filtersize; ++g) { dst[INDX2D(r, c, width)] += GAUSS(src, r, c + GINDX(filtersize, g), - in_linesize, height, width, gauss[GINDX(filtersize, g)]); + in_linesize, height, width, gauss[g]); } } } @@ -295,7 +295,7 @@ static int slice_get_derivative(AVFilterContext* ctx, void* arg, int jobnr, int dst[INDX2D(r, c, width)] = 0; for (g = 0; g < filtersize; ++g) { dst[INDX2D(r, c, width)] += GAUSS(src, r + GINDX(filtersize, g), c, - width, height, width, gauss[GINDX(filtersize, g)]); + width, height, width, gauss[g]); } } } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avfilter/vf_datascope: fix heap buffer overflow
ffmpeg | branch: release/4.1 | Paul B Mahol | Sat Oct 19 09:50:53 2019 +0200| [aef4cbec696ae4e349a72521fba1180b96a97fab] | committer: James Almer avfilter/vf_datascope: fix heap buffer overflow Fixes #8309 (cherry picked from commit d4d6b7b0355f3597cad3b8d12911790c73b5f96d) Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=aef4cbec696ae4e349a72521fba1180b96a97fab --- libavfilter/vf_datascope.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/vf_datascope.c b/libavfilter/vf_datascope.c index c9039a60f6..83f90f07ba 100644 --- a/libavfilter/vf_datascope.c +++ b/libavfilter/vf_datascope.c @@ -973,7 +973,7 @@ static int oscilloscope_filter_frame(AVFilterLink *inlink, AVFrame *frame) frame->width, frame->height, s->ox, s->oy, s->width, s->height + 20 * s->statistics); -if (s->grid) { +if (s->grid && outlink->h >= 10) { ff_fill_rectangle(&s->draw, &s->gray, frame->data, frame->linesize, s->ox, s->oy, s->width - 1, 1); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avfilter/af_afade: fix heap-buffer overflow
ffmpeg | branch: release/4.1 | Paul B Mahol | Tue Oct 15 16:55:13 2019 +0200| [df5e01770900f11eec0c500ccbaddcc6a9d0963d] | committer: James Almer avfilter/af_afade: fix heap-buffer overflow Fixes #8276 (cherry picked from commit e1b89c76f66343d1b495165664647317c66764bb) Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=df5e01770900f11eec0c500ccbaddcc6a9d0963d --- libavfilter/af_afade.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavfilter/af_afade.c b/libavfilter/af_afade.c index 8d9ba916bf..d1135ee16b 100644 --- a/libavfilter/af_afade.c +++ b/libavfilter/af_afade.c @@ -484,7 +484,8 @@ static int activate(AVFilterContext *ctx) s->pts += av_rescale_q(in->nb_samples, (AVRational){ 1, outlink->sample_rate }, outlink->time_base); return ff_filter_frame(outlink, in); -} else if (ff_framequeue_queued_samples(&ctx->inputs[1]->fifo) >= s->nb_samples) { +} else if (ff_framequeue_queued_samples(&ctx->inputs[0]->fifo) >= s->nb_samples && + ff_framequeue_queued_samples(&ctx->inputs[1]->fifo) >= s->nb_samples) { if (s->overlap) { out = ff_get_audio_buffer(outlink, s->nb_samples); if (!out) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avfilter/vf_w3fdif: deny processing small videos
ffmpeg | branch: release/4.1 | Paul B Mahol | Fri Oct 11 12:55:13 2019 +0200| [da3d6068f3fbbe89c57b6c68c178a54dee168d95] | committer: James Almer avfilter/vf_w3fdif: deny processing small videos Fixes #8243 (cherry picked from commit 0e68e8c93f9068596484ec8ba725586860e06fc8) Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=da3d6068f3fbbe89c57b6c68c178a54dee168d95 --- libavfilter/vf_w3fdif.c | 5 + 1 file changed, 5 insertions(+) diff --git a/libavfilter/vf_w3fdif.c b/libavfilter/vf_w3fdif.c index c6a6550778..b84052e8c7 100644 --- a/libavfilter/vf_w3fdif.c +++ b/libavfilter/vf_w3fdif.c @@ -274,6 +274,11 @@ static int config_input(AVFilterLink *inlink) s->planeheight[1] = s->planeheight[2] = AV_CEIL_RSHIFT(inlink->h, desc->log2_chroma_h); s->planeheight[0] = s->planeheight[3] = inlink->h; +if (inlink->h < 3) { +av_log(ctx, AV_LOG_ERROR, "Video of less than 3 lines is not supported\n"); +return AVERROR(EINVAL); +} + s->nb_planes = av_pix_fmt_count_planes(inlink->format); s->nb_threads = ff_filter_get_nb_threads(ctx); s->work_line = av_calloc(s->nb_threads, sizeof(*s->work_line)); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avfilter/vf_edgedetect: fix heap-buffer overflow
ffmpeg | branch: release/4.1 | Paul B Mahol | Tue Oct 15 16:38:40 2019 +0200| [ac5a7d5a67afb6b26460412d51f026ecf22c2193] | committer: James Almer avfilter/vf_edgedetect: fix heap-buffer overflow Fixes #8275 (cherry picked from commit de598f82f8c3f8000e1948548e8088148e2b1f44) Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ac5a7d5a67afb6b26460412d51f026ecf22c2193 --- libavfilter/vf_edgedetect.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libavfilter/vf_edgedetect.c b/libavfilter/vf_edgedetect.c index 11a31fa4ff..25ae6dfacc 100644 --- a/libavfilter/vf_edgedetect.c +++ b/libavfilter/vf_edgedetect.c @@ -154,7 +154,8 @@ static void gaussian_blur(AVFilterContext *ctx, int w, int h, memcpy(dst, src, w); dst += dst_linesize; src += src_linesize; for (j = 2; j < h - 2; j++) { dst[0] = src[0]; -dst[1] = src[1]; +if (w > 1) +dst[1] = src[1]; for (i = 2; i < w - 2; i++) { /* Gaussian mask of size 5x5 with sigma = 1.4 */ dst[i] = ((src[-2*src_linesize + i-2] + src[2*src_linesize + i-2]) * 2 @@ -175,8 +176,10 @@ static void gaussian_blur(AVFilterContext *ctx, int w, int h, + src[i+1] * 12 + src[i+2] * 5) / 159; } -dst[i] = src[i]; -dst[i + 1] = src[i + 1]; +if (w > 2) +dst[i] = src[i]; +if (w > 3) +dst[i + 1] = src[i + 1]; dst += dst_linesize; src += src_linesize; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avfilter/vf_floodfill: finish early if source and destination fill matches
ffmpeg | branch: release/4.1 | Paul B Mahol | Thu Oct 10 21:50:03 2019 +0200| [f1fc3fe3179109328229421451e3219de1ab9521] | committer: James Almer avfilter/vf_floodfill: finish early if source and destination fill matches Fixes #8236 (cherry picked from commit 1331e001796c656a4a3c770a16121c15ec1db2ac) Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f1fc3fe3179109328229421451e3219de1ab9521 --- libavfilter/vf_floodfill.c | 58 +++--- 1 file changed, 34 insertions(+), 24 deletions(-) diff --git a/libavfilter/vf_floodfill.c b/libavfilter/vf_floodfill.c index 323dd0e2fa..cf8f689559 100644 --- a/libavfilter/vf_floodfill.c +++ b/libavfilter/vf_floodfill.c @@ -34,9 +34,10 @@ typedef struct FloodfillContext { const AVClass *class; int x, y; -int s0, s1, s2, s3; -int d0, d1, d2, d3; +int s[4]; +int d[4]; +int nb_planes; int back, front; Points *points; @@ -238,12 +239,12 @@ static int config_input(AVFilterLink *inlink) const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); AVFilterContext *ctx = inlink->dst; FloodfillContext *s = ctx->priv; -int nb_planes = av_pix_fmt_count_planes(inlink->format); int depth; +s->nb_planes = av_pix_fmt_count_planes(inlink->format); depth = desc->comp[0].depth; if (depth == 8) { -switch (nb_planes) { +switch (s->nb_planes) { case 1: s->set_pixel = set_pixel1; s->is_same= is_same1; s->pick_pixel = pick_pixel1; break; @@ -255,7 +256,7 @@ static int config_input(AVFilterLink *inlink) s->pick_pixel = pick_pixel4; break; } } else { -switch (nb_planes) { +switch (s->nb_planes) { case 1: s->set_pixel = set_pixel1_16; s->is_same= is_same1_16; s->pick_pixel = pick_pixel1_16; break; @@ -280,17 +281,25 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame) { AVFilterContext *ctx = link->dst; FloodfillContext *s = ctx->priv; -const unsigned d0 = s->d0; -const unsigned d1 = s->d1; -const unsigned d2 = s->d2; -const unsigned d3 = s->d3; -int s0 = s->s0; -int s1 = s->s1; -int s2 = s->s2; -int s3 = s->s3; +const unsigned d0 = s->d[0]; +const unsigned d1 = s->d[1]; +const unsigned d2 = s->d[2]; +const unsigned d3 = s->d[3]; +int s0 = s->s[0]; +int s1 = s->s[1]; +int s2 = s->s[2]; +int s3 = s->s[3]; const int w = frame->width; const int h = frame->height; -int ret; +int i, ret; + +for (i = 0; i < s->nb_planes; i++) { +if (s->s[i] != s->d[i]) +break; +} + +if (i == s->nb_planes) +goto end; if (ret = av_frame_make_writable(frame)) return ret; @@ -337,6 +346,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame) } } +end: return ff_filter_frame(ctx->outputs[0], frame); } @@ -405,16 +415,16 @@ static const AVFilterPad floodfill_outputs[] = { #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM static const AVOption floodfill_options[] = { -{ "x", "set pixel x coordinate", OFFSET(x), AV_OPT_TYPE_INT, {.i64=0}, 0, UINT16_MAX, FLAGS }, -{ "y", "set pixel y coordinate", OFFSET(y), AV_OPT_TYPE_INT, {.i64=0}, 0, UINT16_MAX, FLAGS }, -{ "s0", "set source #0 component value", OFFSET(s0), AV_OPT_TYPE_INT, {.i64=0},-1, UINT16_MAX, FLAGS }, -{ "s1", "set source #1 component value", OFFSET(s1), AV_OPT_TYPE_INT, {.i64=0},-1, UINT16_MAX, FLAGS }, -{ "s2", "set source #2 component value", OFFSET(s2), AV_OPT_TYPE_INT, {.i64=0},-1, UINT16_MAX, FLAGS }, -{ "s3", "set source #3 component value", OFFSET(s3), AV_OPT_TYPE_INT, {.i64=0},-1, UINT16_MAX, FLAGS }, -{ "d0", "set destination #0 component value", OFFSET(d0), AV_OPT_TYPE_INT, {.i64=0}, 0, UINT16_MAX, FLAGS }, -{ "d1", "set destination #1 component value", OFFSET(d1), AV_OPT_TYPE_INT, {.i64=0}, 0, UINT16_MAX, FLAGS }, -{ "d2", "set destination #2 component value", OFFSET(d2), AV_OPT_TYPE_INT, {.i64=0}, 0, UINT16_MAX, FLAGS }, -{ "d3", "set destination #3 component value", OFFSET(d3), AV_OPT_TYPE_INT, {.i64=0}, 0, UINT16_MAX, FLAGS }, +{ "x", "set pixel x coordinate", OFFSET(x), AV_OPT_TYPE_INT, {.i64=0}, 0, UINT16_MAX, FLAGS }, +{ "y", "set pixel y coordinate", OFFSET(y), AV_OPT_TYPE_INT, {.i64=0}, 0, UINT16_MAX, FLAGS }, +{ "s0", "set source #0 component value", OFFSET(s[0]), AV_OPT_TYPE_INT, {.i64=0},-1, UINT16_MAX, FLAGS }, +{ "s1", "set source #1 component value", OFFSET(s[1]), AV_OPT_TYPE_INT, {.i64=0},-1, UINT16_MAX, FLAGS }, +{ "s2", "set source #2 component value", OFFSET(s[2]), AV_OPT_TYPE_INT, {.i64=0},-1, UINT16_MAX, FLAGS }, +{ "s3", "set so
[FFmpeg-cvslog] avfilter/vf_bm3d: fix heap-buffer overflows
ffmpeg | branch: release/4.1 | Paul B Mahol | Sun Oct 13 18:10:38 2019 +0200| [8c9ff740a35d6f46935f70e4a9533dddaaf33788] | committer: James Almer avfilter/vf_bm3d: fix heap-buffer overflows Fixes #8262 (cherry picked from commit 0749082eb93ea02fa4b770da86597450cec84054) Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8c9ff740a35d6f46935f70e4a9533dddaaf33788 --- libavfilter/vf_bm3d.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavfilter/vf_bm3d.c b/libavfilter/vf_bm3d.c index 75c356728e..04cc19ccee 100644 --- a/libavfilter/vf_bm3d.c +++ b/libavfilter/vf_bm3d.c @@ -706,8 +706,8 @@ static int filter_slice(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs) const int plane = td->plane; const int width = s->planewidth[plane]; const int height = s->planeheight[plane]; -const int block_pos_bottom = height - s->block_size; -const int block_pos_right = width - s->block_size; +const int block_pos_bottom = FFMAX(0, height - s->block_size); +const int block_pos_right = FFMAX(0, width - s->block_size); const int slice_start = (((height + block_step - 1) / block_step) * jobnr / nb_jobs) * block_step; const int slice_end = (jobnr == nb_jobs - 1) ? block_pos_bottom + block_step : (((height + block_step - 1) / block_step) * (jobnr + 1) / nb_jobs) * block_step; @@ -796,8 +796,8 @@ static int config_input(AVFilterLink *inlink) for (i = 0; i < s->nb_threads; i++) { SliceContext *sc = &s->slices[i]; -sc->num = av_calloc(s->planewidth[0] * s->planeheight[0], sizeof(FFTSample)); -sc->den = av_calloc(s->planewidth[0] * s->planeheight[0], sizeof(FFTSample)); +sc->num = av_calloc(FFALIGN(s->planewidth[0], s->block_size) * FFALIGN(s->planeheight[0], s->block_size), sizeof(FFTSample)); +sc->den = av_calloc(FFALIGN(s->planewidth[0], s->block_size) * FFALIGN(s->planeheight[0], s->block_size), sizeof(FFTSample)); if (!sc->num || !sc->den) return AVERROR(ENOMEM); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-cvslog] avfilter/vf_bwdif: fix heap-buffer overflow
ffmpeg | branch: release/4.1 | Paul B Mahol | Sun Oct 13 23:21:35 2019 +0200| [d7490ef341e253294aa0abf1e4ed8381c1b0ea91] | committer: James Almer avfilter/vf_bwdif: fix heap-buffer overflow Fixes #8261 (cherry picked from commit 8c3166e1c302c3ba80d9742ae46161c0fa8e2606) Signed-off-by: James Almer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d7490ef341e253294aa0abf1e4ed8381c1b0ea91 --- libavfilter/vf_bwdif.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/vf_bwdif.c b/libavfilter/vf_bwdif.c index b691983611..7290c9a4a2 100644 --- a/libavfilter/vf_bwdif.c +++ b/libavfilter/vf_bwdif.c @@ -505,8 +505,8 @@ static int config_props(AVFilterLink *link) if(s->mode&1) link->frame_rate = av_mul_q(link->src->inputs[0]->frame_rate, (AVRational){2,1}); -if (link->w < 3 || link->h < 3) { -av_log(ctx, AV_LOG_ERROR, "Video of less than 3 columns or lines is not supported\n"); +if (link->w < 3 || link->h < 4) { +av_log(ctx, AV_LOG_ERROR, "Video of less than 3 columns or 4 lines is not supported\n"); return AVERROR(EINVAL); } ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".