[FFmpeg-cvslog] r25419 - trunk/libavfilter/vf_unsharp.c

stefano subversion
Sat Oct 9 01:36:35 CEST 2010


Author: stefano
Date: Sat Oct  9 01:36:35 2010
New Revision: 25419

Log:
Add validity checks for the unsharp filter.

Prevent crash.

Modified:
   trunk/libavfilter/vf_unsharp.c

Modified: trunk/libavfilter/vf_unsharp.c
==============================================================================
--- trunk/libavfilter/vf_unsharp.c	Sat Oct  9 00:01:19 2010	(r25418)
+++ trunk/libavfilter/vf_unsharp.c	Sat Oct  9 01:36:35 2010	(r25419)
@@ -133,6 +133,13 @@ static av_cold int init(AVFilterContext 
         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) {
+        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->chroma, cmsize_x, cmsize_y, camount);
 



More information about the ffmpeg-cvslog mailing list