mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-22 07:20:45 +00:00
Add validity checks for the unsharp filter.
Prevent crash. Originally committed as revision 25419 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
fd0368e7ca
commit
74d127b537
@ -133,6 +133,13 @@ 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,
|
sscanf(args, "%d:%d:%lf:%d:%d:%lf", &lmsize_x, &lmsize_y, &lamount,
|
||||||
&cmsize_x, &cmsize_y, &camount);
|
&cmsize_x, &cmsize_y, &camount);
|
||||||
|
|
||||||
|
if (lmsize_x < 2 || lmsize_y < 2 || 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);
|
||||||
|
return AVERROR(EINVAL);
|
||||||
|
}
|
||||||
|
|
||||||
set_filter_param(&unsharp->luma, lmsize_x, lmsize_y, lamount);
|
set_filter_param(&unsharp->luma, lmsize_x, lmsize_y, lamount);
|
||||||
set_filter_param(&unsharp->chroma, cmsize_x, cmsize_y, camount);
|
set_filter_param(&unsharp->chroma, cmsize_x, cmsize_y, camount);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user