[vlc-commits] sharpen: assert that SHARPEN_FRAME macro's maxval parameter is positive

Victorien Le Couviour--Tuffet git at videolan.org
Wed Apr 12 10:35:56 CEST 2017


vlc | branch: master | Victorien Le Couviour--Tuffet <victorien.lecouviour.tuffet at gmail.com> | Tue Apr 11 23:39:21 2017 +0200| [48bbae0073625797e13535bd4be487966da0bc42] | committer: Jean-Baptiste Kempf

sharpen: assert that SHARPEN_FRAME macro's maxval parameter is positive

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=48bbae0073625797e13535bd4be487966da0bc42
---

 modules/video_filter/sharpen.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/video_filter/sharpen.c b/modules/video_filter/sharpen.c
index b35ea6b169..b596e9f94d 100644
--- a/modules/video_filter/sharpen.c
+++ b/modules/video_filter/sharpen.c
@@ -37,6 +37,7 @@
 # include "config.h"
 #endif
 
+#include <assert.h>
 #include <vlc_common.h>
 #include <vlc_atomic.h>
 #include <vlc_plugin.h>
@@ -160,6 +161,7 @@ static void Destroy( vlc_object_t *p_this )
 #define SHARPEN_FRAME(maxval, data_t)                                   \
     do                                                                  \
     {                                                                   \
+        assert((maxval) >= 0);                                          \
         data_t *restrict p_src = (data_t *)p_pic->p[Y_PLANE].p_pixels;  \
         data_t *restrict p_out = (data_t *)p_outpic->p[Y_PLANE].p_pixels; \
         const unsigned data_sz = sizeof(data_t);                        \



More information about the vlc-commits mailing list