]> git.sesse.net Git - vlc/commitdiff
Fixed extract video filter when requesting black color.
authorLaurent Aimar <fenrir@videolan.org>
Mon, 5 Sep 2011 19:00:07 +0000 (21:00 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Mon, 5 Sep 2011 19:00:07 +0000 (21:00 +0200)
It closes #4695.

modules/video_filter/extract.c

index d317a7011b65abfd653b2a5e9f5ab1e4e7dd042b..4b172a67a9f4ebd0df3fa818050574c9b8bab4a4 100644 (file)
@@ -291,9 +291,12 @@ static void make_projection_matrix( filter_t *p_filter, int color, int *matrix )
     double green = ((double)(( 0x00FF00 & color )>>8))/255.;
     double blue = ((double)( 0x0000FF & color ))/255.;
     double norm = sqrt( red*red + green*green + blue*blue );
-    red /= norm;
-    green /= norm;
-    blue /= norm;
+    if( norm > 0 )
+    {
+        red /= norm;
+        green /= norm;
+        blue /= norm;
+    }
     /* XXX: We might still need to norm the rgb_matrix */
     double rgb_matrix[9] =
         { red*red,    red*green,   red*blue,