[FFmpeg-cvslog] avfilter/vf_remap: add . at end of long description
ffmpeg | branch: master | Paul B Mahol | Sun Jan 29 13:29:33 2017 +0100| [c6f7f33eec8e62e35c8650fe12721278b9ef2e9e] | committer: Paul B Mahol avfilter/vf_remap: add . at end of long description Signed-off-by: Paul B Mahol > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c6f7f33eec8e62e35c8650fe12721278b9ef2e9e --- libavfilter/vf_remap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/vf_remap.c b/libavfilter/vf_remap.c index e70956d..b7182e9 100644 --- a/libavfilter/vf_remap.c +++ b/libavfilter/vf_remap.c @@ -404,7 +404,7 @@ static const AVFilterPad remap_outputs[] = { AVFilter ff_vf_remap = { .name = "remap", -.description = NULL_IF_CONFIG_SMALL("Remap pixels"), +.description = NULL_IF_CONFIG_SMALL("Remap pixels."), .priv_size = sizeof(RemapContext), .uninit= uninit, .query_formats = query_formats, ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] doc/examples/decoder_targeted: Disable error concealment after 20 frames
ffmpeg | branch: master | Michael Niedermayer | Sun Jan 29 03:22:50 2017 +0100| [bbd4d9230407d70a9c93af4ac00f2e6d894358be] | committer: Michael Niedermayer doc/examples/decoder_targeted: Disable error concealment after 20 frames This allows testing EC and non EC. Avoids spending most time in EC on high res samples and reduces the likelyhood of hitting timeouts Fixes: Timeout in 467/fuzz-2-ffmpeg_VIDEO_AV_CODEC_ID_H263_fuzzer Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bbd4d9230407d70a9c93af4ac00f2e6d894358be --- doc/examples/decoder_targeted.c | 4 1 file changed, 4 insertions(+) diff --git a/doc/examples/decoder_targeted.c b/doc/examples/decoder_targeted.c index e7e02b0..030eba6 100644 --- a/doc/examples/decoder_targeted.c +++ b/doc/examples/decoder_targeted.c @@ -180,6 +180,10 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { while (avpkt.size > 0 && it++ < maxiteration) { av_frame_unref(frame); int ret = decode_handler(ctx, frame, &got_frame, &avpkt); + +if (it > 20) +ctx->error_concealment = 0; + if (ret <= 0 || ret > avpkt.size) break; avpkt.data += ret; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] doc/examples/decoder_targeted: move to tools/target_dec_fuzzer.c
ffmpeg | branch: master | Rostislav Pehlivanov | Sun Jan 29 15:30:10 2017 +| [e05d2dd86abc2fdbadfc7ec9a84c22013be62da2] | committer: Rostislav Pehlivanov doc/examples/decoder_targeted: move to tools/target_dec_fuzzer.c Name and purpose are more appropriate there since the code isn't an ideal example. Reviewed-by: wm4 Signed-off-by: Rostislav Pehlivanov > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e05d2dd86abc2fdbadfc7ec9a84c22013be62da2 --- doc/examples/decoder_targeted.c => tools/target_dec_fuzzer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/examples/decoder_targeted.c b/tools/target_dec_fuzzer.c similarity index 90% rename from doc/examples/decoder_targeted.c rename to tools/target_dec_fuzzer.c index 030eba6..533aa37 100644 --- a/doc/examples/decoder_targeted.c +++ b/tools/target_dec_fuzzer.c @@ -30,12 +30,12 @@ * build the fuzz target. Choose the value of FFMPEG_CODEC (e.g. AV_CODEC_ID_DVD_SUBTITLE) and choose one of FUZZ_FFMPEG_VIDEO, FUZZ_FFMPEG_AUDIO, FUZZ_FFMPEG_SUBTITLE. -clang -fsanitize=address -fsanitize-coverage=trace-pc-guard,trace-cmp doc/examples/decoder_targeted.c -o decoder_targeted -I. -DFFMPEG_CODEC=AV_CODEC_ID_MPEG1VIDEO -DFUZZ_FFMPEG_VIDEO ../../libfuzzer/libFuzzer.a -Llibavcodec -Llibavdevice -Llibavfilter -Llibavformat -Llibavresample -Llibavutil -Llibpostproc -Llibswscale -Llibswresample -Wl,--as-needed -Wl,-z,noexecstack -Wl,--warn-common -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample -lavdevice -lavfilter -lavformat -lavcodec -lswresample -lswscale -lavutil -ldl -lxcb -lxcb-shm -lxcb -lxcb-xfixes -lxcb -lxcb-shape -lxcb -lX11 -lasound -lm -lbz2 -lz -pthread +clang -fsanitize=address -fsanitize-coverage=trace-pc-guard,trace-cmp tools/target_dec_fuzzer.c -o target_dec_fuzzer -I. -DFFMPEG_CODEC=AV_CODEC_ID_MPEG1VIDEO -DFUZZ_FFMPEG_VIDEO ../../libfuzzer/libFuzzer.a -Llibavcodec -Llibavdevice -Llibavfilter -Llibavformat -Llibavresample -Llibavutil -Llibpostproc -Llibswscale -Llibswresample -Wl,--as-needed -Wl,-z,noexecstack -Wl,--warn-common -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample -lavdevice -lavfilter -lavformat -lavcodec -lswresample -lswscale -lavutil -ldl -lxcb -lxcb-shm -lxcb -lxcb-xfixes -lxcb -lxcb-shape -lxcb -lX11 -lasound -lm -lbz2 -lz -pthread * create a corpus directory and put some samples there (empty dir is ok too): mkdir CORPUS && cp some-files CORPUS * Run fuzzing: -./decoder_targeted -max_len=10 CORPUS +./target_dec_fuzzer -max_len=10 CORPUS More info: http://libfuzzer.info ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavfi: make ff_framequeue_skip_samples() more useful.
ffmpeg | branch: master | Nicolas George | Sun Jan 29 10:10:40 2017 +0100| [383057f8e744efeaaa3648a59bc577b25b055835] | committer: Nicolas George lavfi: make ff_framequeue_skip_samples() more useful. Instead of just updating statistics and leaving the work to the call site, have it actually do the work. Also: skip the samples by updating the frame data pointers instead of moving the samples. More efficient and avoid writing into shared frames. Found-By: Muhammad Faiz > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=383057f8e744efeaaa3648a59bc577b25b055835 --- libavfilter/avfilter.c | 8 +--- libavfilter/framequeue.c | 27 +++ libavfilter/framequeue.h | 11 +-- 3 files changed, 33 insertions(+), 13 deletions(-) diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index c12d491..b431990 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -1235,13 +1235,7 @@ static int take_samples(AVFilterLink *link, unsigned min, unsigned max, frame = ff_framequeue_peek(&link->fifo, 0); av_samples_copy(buf->extended_data, frame->extended_data, p, 0, n, link->channels, link->format); -frame->nb_samples -= n; -av_samples_copy(frame->extended_data, frame->extended_data, 0, n, -frame->nb_samples, link->channels, link->format); -if (frame->pts != AV_NOPTS_VALUE) -frame->pts += av_rescale_q(n, av_make_q(1, link->sample_rate), link->time_base); -ff_framequeue_update_peeked(&link->fifo, 0); -ff_framequeue_skip_samples(&link->fifo, n); +ff_framequeue_skip_samples(&link->fifo, n, link->time_base); } *rframe = buf; diff --git a/libavfilter/framequeue.c b/libavfilter/framequeue.c index a4ffa86..26bfa49 100644 --- a/libavfilter/framequeue.c +++ b/libavfilter/framequeue.c @@ -121,3 +121,30 @@ AVFrame *ff_framequeue_peek(FFFrameQueue *fq, size_t idx) check_consistency(fq); return b->frame; } + +void ff_framequeue_skip_samples(FFFrameQueue *fq, size_t samples, AVRational time_base) +{ +FFFrameBucket *b; +size_t bytes; +int planar, planes, i; + +check_consistency(fq); +av_assert1(fq->queued); +b = bucket(fq, 0); +av_assert1(samples < b->frame->nb_samples); +planar = av_sample_fmt_is_planar(b->frame->format); +planes = planar ? b->frame->channels : 1; +bytes = samples * av_get_bytes_per_sample(b->frame->format); +if (!planar) +bytes *= b->frame->channels; +if (b->frame->pts != AV_NOPTS_VALUE) +b->frame->pts += av_rescale_q(samples, av_make_q(1, b->frame->sample_rate), time_base); +b->frame->nb_samples -= samples; +b->frame->linesize[0] -= bytes; +for (i = 0; i < planes; i++) +b->frame->extended_data[i] += bytes; +for (i = 0; i < planes && i < AV_NUM_DATA_POINTERS; i++) +b->frame->data[i] = b->frame->extended_data[i]; +fq->total_samples_tail += samples; +ff_framequeue_update_peeked(fq, 0); +} diff --git a/libavfilter/framequeue.h b/libavfilter/framequeue.h index f5ef744..5aa2c72 100644 --- a/libavfilter/framequeue.h +++ b/libavfilter/framequeue.h @@ -161,14 +161,13 @@ static inline void ff_framequeue_update_peeked(FFFrameQueue *fq, size_t idx) } /** - * Update the sample count in the queue. + * Skip samples from the first frame in the queue. * * This function must be used when the first frame was accessed using - * ff_framequeue_peek() and samples were removed from it. + * ff_framequeue_peek() and samples were consumed from it. + * It adapts the data pointers and timestamps of the head frame to account + * for the skipped samples. */ -static inline void ff_framequeue_skip_samples(FFFrameQueue *fq, size_t n) -{ -fq->total_samples_tail += n; -} +void ff_framequeue_skip_samples(FFFrameQueue *fq, size_t samples, AVRational time_base); #endif /* AVFILTER_FRAMEQUEUE_H */ ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] lavc/mjpegdec: consume SOS data even if the frame is discarded
ffmpeg | branch: master | Matthieu Bouron | Sat Jan 28 13:49:52 2017 +0100| [2ae82788324481dd56bb85f9d815902854c044fd] | committer: Matthieu Bouron lavc/mjpegdec: consume SOS data even if the frame is discarded Speeds up next marker search when a SOS marker is found but the frame is discarded (which happens in avformat_find_stream_info). > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2ae82788324481dd56bb85f9d815902854c044fd --- libavcodec/mjpegdec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 7d17e3d..07988b6 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -2247,8 +2247,10 @@ eoi_parser: goto the_end; case SOS: s->cur_scan++; -if (avctx->skip_frame == AVDISCARD_ALL) +if (avctx->skip_frame == AVDISCARD_ALL) { +skip_bits(&s->gb, get_bits_left(&s->gb)); break; +} if ((ret = ff_mjpeg_decode_sos(s, NULL, 0, NULL)) < 0 && (avctx->err_recognition & AV_EF_EXPLODE)) ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] avfilter/showcqt: make minimum timeclamp option lower
ffmpeg | branch: master | Muhammad Faiz | Mon Jan 30 05:41:49 2017 +0700| [c4a3526b57dc09e61a2ac58fdcd92a10f344b2c2] | committer: Muhammad Faiz avfilter/showcqt: make minimum timeclamp option lower high basefreq does not require high timeclamp Signed-off-by: Muhammad Faiz > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c4a3526b57dc09e61a2ac58fdcd92a10f344b2c2 --- doc/filters.texi | 2 +- libavfilter/avf_showcqt.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/filters.texi b/doc/filters.texi index cd1aaab..21a5bf5 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -17029,7 +17029,7 @@ Specify the transform timeclamp. At low frequency, there is trade-off between accuracy in time domain and frequency domain. If timeclamp is lower, event in time domain is represented more accurately (such as fast bass drum), otherwise event in frequency domain is represented more accurately -(such as bass guitar). Acceptable range is @code{[0.1, 1]}. Default value is @code{0.17}. +(such as bass guitar). Acceptable range is @code{[0.002, 1]}. Default value is @code{0.17}. @item basefreq Specify the transform base frequency. Default value is @code{20.01523126408007475}, diff --git a/libavfilter/avf_showcqt.c b/libavfilter/avf_showcqt.c index a25176d..ede56f4 100644 --- a/libavfilter/avf_showcqt.c +++ b/libavfilter/avf_showcqt.c @@ -76,8 +76,8 @@ static const AVOption showcqt_options[] = { { "bar_g","set bargraph gamma", OFFSET(bar_g), AV_OPT_TYPE_FLOAT, { .dbl = 1.0 },1.0, 7.0, FLAGS }, { "gamma2", "set bargraph gamma", OFFSET(bar_g), AV_OPT_TYPE_FLOAT, { .dbl = 1.0 },1.0, 7.0, FLAGS }, { "bar_t", "set bar transparency", OFFSET(bar_t), AV_OPT_TYPE_FLOAT, { .dbl = 1.0 },0.0, 1.0, FLAGS }, -{ "timeclamp", "set timeclamp", OFFSET(timeclamp), AV_OPT_TYPE_DOUBLE, { .dbl = 0.17 }, 0.1, 1.0, FLAGS }, -{ "tc","set timeclamp", OFFSET(timeclamp), AV_OPT_TYPE_DOUBLE, { .dbl = 0.17 }, 0.1, 1.0, FLAGS }, +{ "timeclamp", "set timeclamp", OFFSET(timeclamp), AV_OPT_TYPE_DOUBLE, { .dbl = 0.17 }, 0.002, 1.0, FLAGS }, +{ "tc","set timeclamp", OFFSET(timeclamp), AV_OPT_TYPE_DOUBLE, { .dbl = 0.17 }, 0.002, 1.0, FLAGS }, { "basefreq", "set base frequency", OFFSET(basefreq), AV_OPT_TYPE_DOUBLE, { .dbl = BASEFREQ }, 10.0, 10.0, FLAGS }, { "endfreq", "set end frequency", OFFSET(endfreq), AV_OPT_TYPE_DOUBLE, { .dbl = ENDFREQ }, 10.0, 10.0, FLAGS }, { "coeffclamp", "set coeffclamp", OFFSET(coeffclamp), AV_OPT_TYPE_FLOAT, { .dbl = 1.0 },0.1, 10.0, FLAGS }, @@ -1366,7 +1366,7 @@ static int config_output(AVFilterLink *outlink) if ((ret = init_volume(s)) < 0) return ret; -s->fft_bits = ceil(log2(inlink->sample_rate * s->timeclamp)); +s->fft_bits = FFMAX(ceil(log2(inlink->sample_rate * s->timeclamp)), 4); s->fft_len = 1 << s->fft_bits; av_log(ctx, AV_LOG_INFO, "fft_len = %d, cqt_len = %d.\n", s->fft_len, s->cqt_len); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] genh: prevent overflow during block alignment calculation
ffmpeg | branch: master | Andreas Cadhalpun | Thu Dec 15 02:14:40 2016 +0100| [5b0ae88ca6b3eb85dbda1762f16f1b5e7c3aa014] | committer: Andreas Cadhalpun genh: prevent overflow during block alignment calculation Reviewed-by: Michael Niedermayer Reviewed-by: Paul B Mahol Signed-off-by: Andreas Cadhalpun > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5b0ae88ca6b3eb85dbda1762f16f1b5e7c3aa014 --- libavformat/genh.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/genh.c b/libavformat/genh.c index b683e02..dd4e76d 100644 --- a/libavformat/genh.c +++ b/libavformat/genh.c @@ -20,6 +20,7 @@ */ #include "libavutil/intreadwrite.h" +#include "libavcodec/internal.h" #include "avformat.h" #include "internal.h" @@ -54,7 +55,7 @@ static int genh_read_header(AVFormatContext *s) st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; st->codecpar->channels= avio_rl32(s->pb); -if (st->codecpar->channels <= 0) +if (st->codecpar->channels <= 0 || st->codecpar->channels > FF_SANE_NB_CHANNELS) return AVERROR_INVALIDDATA; if (st->codecpar->channels == 1) st->codecpar->channel_layout = AV_CH_LAYOUT_MONO; ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] epafdec: prevent overflow during block alignment calculation
ffmpeg | branch: master | Andreas Cadhalpun | Fri Jan 6 20:31:21 2017 +0100| [74bd17d31648c77d01a0d35b09724715bc40fba2] | committer: Andreas Cadhalpun epafdec: prevent overflow during block alignment calculation Reviewed-by: Michael Niedermayer Reviewed-by: Paul B Mahol Signed-off-by: Andreas Cadhalpun > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=74bd17d31648c77d01a0d35b09724715bc40fba2 --- libavformat/epafdec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/epafdec.c b/libavformat/epafdec.c index 29190ff..0cd9627 100644 --- a/libavformat/epafdec.c +++ b/libavformat/epafdec.c @@ -20,6 +20,7 @@ */ #include "libavutil/intreadwrite.h" +#include "libavcodec/internal.h" #include "avformat.h" #include "internal.h" #include "pcm.h" @@ -59,7 +60,7 @@ static int epaf_read_header(AVFormatContext *s) channels= avio_rb32(s->pb); } -if (!channels || !sample_rate) +if (channels <= 0 || channels > FF_SANE_NB_CHANNELS || sample_rate <= 0) return AVERROR_INVALIDDATA; st = avformat_new_stream(s, NULL); ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
[FFmpeg-cvslog] xvag: prevent overflow during block alignment calculation
ffmpeg | branch: master | Andreas Cadhalpun | Fri Jan 6 20:31:26 2017 +0100| [cba4f0e97ecbbde7c71ec7a7ae3eb1469b34545b] | committer: Andreas Cadhalpun xvag: prevent overflow during block alignment calculation Reviewed-by: Michael Niedermayer Reviewed-by: Paul B Mahol Signed-off-by: Andreas Cadhalpun > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cba4f0e97ecbbde7c71ec7a7ae3eb1469b34545b --- libavformat/xvag.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/xvag.c b/libavformat/xvag.c index 5ef4fb0..22e4f1e 100644 --- a/libavformat/xvag.c +++ b/libavformat/xvag.c @@ -20,6 +20,7 @@ */ #include "libavutil/bswap.h" +#include "libavcodec/internal.h" #include "avformat.h" #include "internal.h" @@ -68,7 +69,7 @@ static int xvag_read_header(AVFormatContext *s) if (st->codecpar->sample_rate <= 0) return AVERROR_INVALIDDATA; -if (st->codecpar->channels <= 0) +if (st->codecpar->channels <= 0 || st->codecpar->channels > FF_SANE_NB_CHANNELS) return AVERROR_INVALIDDATA; switch (codec) { ___ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog