[vlc-devel] [PATCH v6 4/5] video_filter-sharpen: assert that SHARPEN_FRAME macro's maxval parameter is positive
victorien.lecouviour.tuffet at gmail.com
victorien.lecouviour.tuffet at gmail.com
Tue Apr 11 23:39:21 CEST 2017
From: Victorien Le Couviour--Tuffet <victorien.lecouviour.tuffet at gmail.com>
---
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); \
--
2.12.0
More information about the vlc-devel
mailing list