[vlc-commits] invert: check supported chroma (fixes #8840, fixes #8841)

Rémi Denis-Courmont git at videolan.org
Sun Jun 23 07:51:51 CEST 2013


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jun 23 08:51:03 2013 +0300| [908a51341bfa366f5ec7b650d32e423ae38ac5f0] | committer: Rémi Denis-Courmont

invert: check supported chroma (fixes #8840, fixes #8841)

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

 modules/video_filter/invert.c |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/modules/video_filter/invert.c b/modules/video_filter/invert.c
index 1477431..681c992 100644
--- a/modules/video_filter/invert.c
+++ b/modules/video_filter/invert.c
@@ -64,9 +64,19 @@ vlc_module_end ()
 static int Create( vlc_object_t *p_this )
 {
     filter_t *p_filter = (filter_t *)p_this;
+    vlc_fourcc_t fourcc = p_filter->fmt_in.video.i_chroma;
 
-    p_filter->pf_video_filter = Filter;
+    if( fourcc == VLC_CODEC_YUVP || fourcc == VLC_CODEC_RGBP
+     || fourcc == VLC_CODEC_RGBA )
+        return VLC_EGENERIC;
+
+    const vlc_chroma_description_t *p_chroma =
+        vlc_fourcc_GetChromaDescription( fourcc );
+    if( p_chroma == NULL
+     || p_chroma->pixel_size * 8 != p_chroma->pixel_bits )
+        return VLC_EGENERIC;
 
+    p_filter->pf_video_filter = Filter;
     return VLC_SUCCESS;
 }
 



More information about the vlc-commits mailing list