[vlc-commits] Reject > 8 bits per pixel colorspace in gradfun/grain/ transform video filters.

Laurent Aimar git at videolan.org
Wed Oct 5 23:17:40 CEST 2011


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Wed Oct  5 21:55:25 2011 +0200| [eb71a0059f3e530dbf9cd6bc5bc11ef2152bdba5] | committer: Laurent Aimar

Reject > 8 bits per pixel colorspace in gradfun/grain/transform video filters.

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

 modules/video_filter/gradfun.c   |    2 +-
 modules/video_filter/grain.c     |    2 +-
 modules/video_filter/transform.c |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/video_filter/gradfun.c b/modules/video_filter/gradfun.c
index 765cf64..4db3d1d 100644
--- a/modules/video_filter/gradfun.c
+++ b/modules/video_filter/gradfun.c
@@ -112,7 +112,7 @@ static int Open(vlc_object_t *object)
     const vlc_fourcc_t fourcc = filter->fmt_in.video.i_chroma;
 
     const vlc_chroma_description_t *chroma = vlc_fourcc_GetChromaDescription(fourcc);
-    if (!chroma || chroma->plane_count < 3) {
+    if (!chroma || chroma->plane_count < 3 || chroma->pixel_size != 1) {
         msg_Err(filter, "Unsupported chroma (%4.4s)", (char*)&fourcc);
         return VLC_EGENERIC;
     }
diff --git a/modules/video_filter/grain.c b/modules/video_filter/grain.c
index 1d5f9cc..cbdb133 100644
--- a/modules/video_filter/grain.c
+++ b/modules/video_filter/grain.c
@@ -382,7 +382,7 @@ static int Open(vlc_object_t *object)
 
     const vlc_chroma_description_t *chroma =
         vlc_fourcc_GetChromaDescription(filter->fmt_in.video.i_chroma);
-    if (!chroma || chroma->plane_count < 3) {
+    if (!chroma || chroma->plane_count < 3 || chroma->pixel_size != 1) {
         msg_Err(filter, "Unsupported chroma (%4.4s)",
                 (char*)&(filter->fmt_in.video.i_chroma));
         return VLC_EGENERIC;
diff --git a/modules/video_filter/transform.c b/modules/video_filter/transform.c
index 5e86fc0..9f6a751 100644
--- a/modules/video_filter/transform.c
+++ b/modules/video_filter/transform.c
@@ -188,7 +188,7 @@ static int Open(vlc_object_t *object)
 
     const vlc_chroma_description_t *chroma =
         vlc_fourcc_GetChromaDescription(src->i_chroma);
-    if (!chroma || chroma->plane_count < 3) {
+    if (!chroma || chroma->plane_count < 3 || chroma->pixel_size != 1) {
         msg_Err(filter, "Unsupported chroma (%4.4s)", (char*)&src->i_chroma);
         /* TODO support packed and rgb */
         return VLC_EGENERIC;



More information about the vlc-commits mailing list