Commit Graph

4570 Commits

Author SHA1 Message Date
Michael Niedermayer
a0a20e6994 avfilter/avfiltergraph: Add assert to write down in machine readable form what is assumed about sample rates in swap_samplerates_on_filter()
Fixes CID1397292

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 5f2b360fc0)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-08-23 13:15:17 +02:00
Moritz Barsnick
67a1940707 lavfi: fix typos
Signed-off-by: Moritz Barsnick <barsnick@gmx.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f4e4bde1f4)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-08-23 13:15:16 +02:00
Michael Niedermayer
0fb30a9744 avfilter/af_amix: dont fail if there are no samples in output_frame()
Fixes Ticket5326

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit abc957e896)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-08-23 13:15:16 +02:00
Michael Niedermayer
f2c6a5d0bd avfilter/vf_drawtext: Check return code of load_glyph()
Fixes segfault
Fixes Ticket5347

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2e67a99fbc)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-08-23 13:15:16 +02:00
Marios Titas
e706f8045c avfilter/src_movie: fix how we check for overflows with seek_point
Currently, if the movie source filter is used and a seek_point is
specified on a file that has a negative start time, ffmpeg will fail.

An easy way to reproduce this is as follows:
$ ffmpeg -vsync passthrough -filter_complex 'color=d=10,setpts=PTS-1/TB' test.mp4
$ ffmpeg -filter_complex 'movie=filename=test.mp4:seek_point=2' -f null -

The problem is caused by checking for int64_t overflow the wrong way.
In general, to check whether a + b overflows, it is not enough to do:
    a > INT64_MAX - b
because b might be negative; the correct way is:
    b > 0 && > a > INT64_MAX - b

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c1f9734f97)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-08-23 13:15:16 +02:00
Michael Niedermayer
8132ed4a43 avfilter/vf_mpdecimate: Add missing emms_c()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 997de2e810)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-31 00:25:19 +01:00
Ganesh Ajjanagadde
3ea20e60dc avfilter/af_asyncts: use llabs for int64_t
long may not be 64 bit on all platforms; so labs on int64_t is unsafe.
This fixes a warning reported in:
http://fate.ffmpeg.org/log.cgi?time=20150905071512&log=compile&slot=i386-darwin-clang-polly-3.7

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d74123d03e)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 12:40:48 +01:00
Michael Niedermayer
649f09c4cf avfilter/af_aresample: Check ff_all_* for allocation failures
Fixes: signal_sigabrt_7ffff70eccc9_498_divx502.avi with memlimit 1572864

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2ea8a48083)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-20 14:38:27 +02:00
Michael Niedermayer
3dfadef522 avfilter/vf_transpose: Fix rounding error
Fixes out of array access
Fixes: asan_heap-oob_7f875d_3482_cov_1818465256_ssudec.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0083c16605)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-08-20 14:38:26 +02:00
Michael Niedermayer
65d61a4bbb avfilter/x86/vf_hqdn3d: Fix register types
Fixes Ticket4301

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 52fc3e372f)
2015-06-19 11:24:32 +02:00
Carl Eugen Hoyos
09764c9909 lavfi/fade: Do not overread input buffer.
(cherry picked from commit ab3ff19f08)
2015-05-17 12:47:33 +02:00
Michael Niedermayer
74c7273b5d avfilter/vf_framepack: Check and update frame_rate
The frame_rate update was missing leaving the output frame rate
wrong.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a46a23d30f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-13 20:48:09 +01:00
Clément Bœsch
2c1d5f43cf avfilter/dctdnoiz: fix slice_h computation
ceilf() can only work if the reminder of the division is not 0.

This fixes memory errors with for instance:
  ffmpeg -f lavfi -i testsrc=s=800x500 -threads 3 -vf dctdnoiz -frames:v 1 -f null -

(cherry picked from commit eb7efaa924)
2015-02-12 20:22:02 +01:00
Michael Niedermayer
fefb152cd9 Merge commit 'a7e79f6a43bdc7e3b164dd78b060f0d5575a0cf0' into release/2.4
* commit 'a7e79f6a43bdc7e3b164dd78b060f0d5575a0cf0':
  avfilter: check filter link validity

Conflicts:
	libavfilter/avfilter.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-18 01:11:20 +01:00
Michael Niedermayer
34b28d3823 Merge commit 'd1ad85fc020653be5ad25ed1d3d5091e89fee782' into release/2.4
* commit 'd1ad85fc020653be5ad25ed1d3d5091e89fee782':
  vf_format: check input validity

See: ee16e0cacc
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-18 01:03:19 +01:00
Michael Niedermayer
b400412443 Merge commit 'daef7feb09a0dde2265d56f77de8ae03f9612d47' into release/2.4
* commit 'daef7feb09a0dde2265d56f77de8ae03f9612d47':
  af_resample: check av_opt_set_dict return value

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-18 00:49:07 +01:00
Michael Niedermayer
158cf1d52d Merge commit '2496dbd68b29bd36fbf4753a46163d33f6dae70e' into release/2.4
* commit '2496dbd68b29bd36fbf4753a46163d33f6dae70e':
  vf_showinfo: Forward the av_image_get_linesize error

Conflicts:
	libavfilter/vf_showinfo.c

See: 2aecfd4f20
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-18 00:41:02 +01:00
Michael Niedermayer
6fd7456f85 Merge commit '608e8d8dd754199b657b439f9e722e0b45f84461' into release/2.4
* commit '608e8d8dd754199b657b439f9e722e0b45f84461':
  vf_drawtext: Do not leak the mmapped textfile

Conflicts:
	libavfilter/vf_drawtext.c

See: 6956b048d8
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-18 00:40:14 +01:00
Vittorio Giovara
a7e79f6a43 avfilter: check filter link validity
Remove now redundant check.

CC: libav-stable@libav.org
Bug-Id: CID 700371
2015-01-13 00:02:32 +01:00
Vittorio Giovara
d1ad85fc02 vf_format: check input validity
CC: libav-stable@libav.org
2015-01-13 00:01:08 +01:00
Vittorio Giovara
daef7feb09 af_resample: check av_opt_set_dict return value
CC: libav-stable@libav.org
Bug-Id: CID 1087076
2015-01-12 23:59:48 +01:00
Vittorio Giovara
2496dbd68b vf_showinfo: Forward the av_image_get_linesize error
CC: libav-stable@libav.org
Bug-Id: CID 1087086
2015-01-12 23:59:32 +01:00
Luca Barbato
608e8d8dd7 vf_drawtext: Do not leak the mmapped textfile
And validate its size while at it.

CC: libav-stable@libav.org
Bug-Id: CID 1244189
2015-01-12 23:59:15 +01:00
Vittorio Giovara
bbb86717b3 vf_frei0r: do not increment string if it reached the end
Bug-Id: 778
CC: libav-stable@libav.org
2015-01-12 23:18:01 +01:00
Vittorio Giovara
76e9a17f33 lavfi: always check av_expr_parse_and_eval() return value
CC: libav-stable@libav.org
Bug-Id: CID 703624
(cherry picked from commit 63be97ec40)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-01-12 23:12:10 +01:00
Paul B Mahol
20a4cf0d09 lavfi: check av_strdup() return value
Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit 145a84717b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:18:40 +01:00
Michael Niedermayer
efdd30df06 avfilter/vf_sab: fix filtering tiny images
Fixes out of array reads

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9bff052b51)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:18:40 +01:00
Michael Niedermayer
820f41e1a1 Add FFMPEG_VERSION into the binary libs
This simplifies identifying from which revision a binary of a lib came from

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 649c158e8c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-20 02:26:27 +01:00
Peter Ross
057ee35924 avfilter/vf_lut: gammaval709()
See http://www.itu.int/rec/R-REC-BT.709
Item 1.2, overall opto-electronic transfer characteristics at source

Signed-off-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b186b7131e)
2014-11-20 02:00:59 +01:00
Karl Kiniger
71af22097d vf_drawtext: add missing clear of pointers after av_expr_free()
Fixes segfault when using sendcmd with drawtext.

Since LIBAVFILTER_VERSION_MAJOR 5 FF_API_DRAWTEXT_OLD_TIMELINE
evaluates to 0.

Signed-off-by: Karl Kiniger <karl.kiniger@med.ge.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 903156aa8a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 13:28:13 +01:00
Michael Niedermayer
20071ff1a4 Merge commit 'ca8c62d187fdca13979379fb2ab172ed662aa2f8' into release/2.4
* commit 'ca8c62d187fdca13979379fb2ab172ed662aa2f8':
  resample: Avoid off-by-1 errors in PTS calcs.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-01 13:22:09 +01:00
Timothy B. Terriberry
ca8c62d187 resample: Avoid off-by-1 errors in PTS calcs.
The rounding used in the PTS calculations in filter_frame() does
not actually match the number of samples output by the resampler.
This leads to off-by-1 errors in the timestamps indicating gaps and
underruns, even when the input timestamps are all contiguous.

Bug-Id: 753

Signed-off-by: Anton Khirnov <anton@khirnov.net>
(cherry picked from commit 6cbbf0592f)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-10-18 05:11:23 +02:00
Michael Niedermayer
bb5c0ac922 avfilter/vf_scale: Allow chroma samples to be above and to the left of luma samples
Found-by: Kierank
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e927682e1b)

Conflicts:

	libavfilter/version.h
2014-09-21 23:37:09 +02:00
Andreas Cadhalpun
dc4e34a2f0 vf_deshake: rename Transform.vector to Transform.vec to avoid compiler confusion
The token 'vector' is a keyword in the Vector/SIMD Multimedia Extension data types and thus should not be used as a variable name.

This fixes building on powerpc/ppc64el.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 739f179dd6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-18 01:11:33 +02:00
Pascal Massimino
649b7a9946 av_filter/x86/idet: use HADDD where appropriate
Signed-off-by: James Almer <jamrial@gmail.com>
2014-09-09 19:02:49 -03:00
Pascal Massimino
e3fd6a3a4e av_filter/x86/idet: MMX/SSE2 implementation of 16bits filter_line()
tested on http://ps-auxw.de/10bit-h264-sample/10bit-eldorado.mkv
MMX: ~30% faster decoding overall
SSE2:~40% faster

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-09 16:47:22 +02:00
Michael Niedermayer
02946120fc avfilter/vf_cropdetect: Do not check lines or columns twice on black frames
Idea from patch by: hjiodjf 97xgw46 <jfbvxt@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-09 02:06:17 +02:00
Michael Niedermayer
1b2390e2bc avfilter/af_silenceremove: remove dead code
Fixes CID1237284

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-06 21:36:56 +02:00
Clément Bœsch
b2c0b80f62 avfilter/ebur128: rework channel weighting definition code
Should fix CID1194399 (Bad bit shift operation)
2014-09-06 13:47:59 +02:00
Paul B Mahol
422619646e add silenceremove filter
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2014-09-05 17:30:57 +00:00
James Darnley
db8970d7b6 vfi/x86/vf_idet: fix incorrect use of paddq
paddq is an SSE2 instruction so it cannot be used for MMX.

This was probably just a typo because the sums are dwords anyway.

Reviewed-by: Pascal Massimino <pascal.massimino@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-05 12:49:34 +02:00
Pascal Massimino
161fc0f463 avfilter/x86/idet: fix license header (GPL -> LGPL)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-05 12:22:36 +02:00
skal
406a9ccffe avfilter/vf_idet: MMX/MMXEXT/SSE2 implementation of idet's filter_line()
integration by Neil Birkbeck, with help from Vitor Sessak.
core SSE2 loop by Skal (pascal.massimino@gmail.com)

Reviewed-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-09-04 22:19:00 +02:00
Reimar Döffinger
098af26067 vf_deshake: Avoid doing a malloc+free for every single frame.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2014-09-02 19:20:28 +02:00
Reimar Döffinger
4ea8406e38 vf_deshake: reduce stack usage.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2014-09-02 19:20:28 +02:00
Reimar Döffinger
6d7aa437e1 vf_drawtext: move "static const" before "struct".
This is consistent with all other occurrences.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2014-08-31 10:41:42 +02:00
Reimar Döffinger
c9a4ec7969 lavfi: add const/static const to pix_fmts arrays.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2014-08-31 10:25:36 +02:00
Michael Niedermayer
0daff3ce76 avfilter/vf_mp: remove incorrect usage of AVFrame.type
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-30 12:16:46 +02:00
Reimar Döffinger
d9e2aceb7f Add missing "const" all over the place.
Only "./configure --enable-gpl" on x86 was tested.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2014-08-29 18:57:25 +02:00
Diego Biurrun
63795fe5b9 setpts: Add missing inttypes.h #include for PRId64
Also convert a debug av_log() to av_dlog().

(cherry picked from commit 593aaee953)
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-24 13:00:53 -07:00