diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-10-13 13:14:52 +0000 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2010-10-13 13:14:52 +0000 |
commit | 6fae8c5443d4fa40fe65f67138f4dbb731f23d72 (patch) | |
tree | 35596b4d66c9adf9d15fac7c47b75c0bbf56e641 | |
parent | aec966958ce03821d974463b5146ae04f10654cd (diff) | |
download | ffmpeg-6fae8c5443d4fa40fe65f67138f4dbb731f23d72.tar.gz |
Make the validity checks fail only if the corresponding luma or chroma
values are not zero.
Prevent aborting with the default values.
Originally committed as revision 25471 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavfilter/vf_unsharp.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavfilter/vf_unsharp.c b/libavfilter/vf_unsharp.c index e7bf95333d..5cc5aa19ba 100644 --- a/libavfilter/vf_unsharp.c +++ b/libavfilter/vf_unsharp.c @@ -133,7 +133,8 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) sscanf(args, "%d:%d:%lf:%d:%d:%lf", &lmsize_x, &lmsize_y, &lamount, &cmsize_x, &cmsize_y, &camount); - if (lmsize_x < 2 || lmsize_y < 2 || cmsize_x < 2 || cmsize_y < 2) { + if ((lamount && (lmsize_x < 2 || lmsize_y < 2)) || + (camount && (cmsize_x < 2 || cmsize_y < 2))) { av_log(ctx, AV_LOG_ERROR, "Invalid value <2 for lmsize_x:%d or lmsize_y:%d or cmsize_x:%d or cmsize_y:%d\n", lmsize_x, lmsize_y, cmsize_x, cmsize_y); |