diff options
author | Clément Bœsch <ubitux@gmail.com> | 2012-12-19 00:44:51 +0400 |
---|---|---|
committer | Clément Bœsch <ubitux@gmail.com> | 2012-12-19 06:13:26 +0400 |
commit | 3bdd70fc661feaf915ae438e05f66cce75334673 (patch) | |
tree | 43fe01862cc4b47b4b008d75aae067d7e429d35a /libavfilter | |
parent | 63e1fc25884fe7cf3f66a8b99602ca98a47fb763 (diff) |
lavfi/gradfun: reduce up limit for threshold.
This will prevent an overflow in the SSSE3 and MMX filter_line code:
delta is expressed as an u16 being shifted by 2 to the left. If it
overflows, having a strength not above 64 will make sure that m is set
to 0 (making the m*m*delta >> 14 expression void).
A value above 64 should not make any sense unless gradfun is used as a
blur filter.
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/version.h | 2 | ||||
-rw-r--r-- | libavfilter/vf_gradfun.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/libavfilter/version.h b/libavfilter/version.h index 048cacec3e..26b66457c5 100644 --- a/libavfilter/version.h +++ b/libavfilter/version.h @@ -30,7 +30,7 @@ #define LIBAVFILTER_VERSION_MAJOR 3 #define LIBAVFILTER_VERSION_MINOR 28 -#define LIBAVFILTER_VERSION_MICRO 100 +#define LIBAVFILTER_VERSION_MICRO 101 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ LIBAVFILTER_VERSION_MINOR, \ diff --git a/libavfilter/vf_gradfun.c b/libavfilter/vf_gradfun.c index 9255f614a2..6319bf7d28 100644 --- a/libavfilter/vf_gradfun.c +++ b/libavfilter/vf_gradfun.c @@ -128,7 +128,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args) if (args) sscanf(args, "%f:%d", &thresh, &radius); - thresh = av_clipf(thresh, 0.51, 255); + thresh = av_clipf(thresh, 0.51, 64); gf->thresh = (1 << 15) / thresh; gf->radius = av_clip((radius + 1) & ~1, 4, 32); |