[librsvg] rsvg-filter: Don't overrun an array when given invalid inputs



commit 6ba2f99f110a3fdcdf1c4f70820e938b7f59055f
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Sep 3 13:53:34 2013 -0400

    rsvg-filter: Don't overrun an array when given invalid inputs
    
    Yikes. Just select R/G as defaults.

 rsvg-filter.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/rsvg-filter.c b/rsvg-filter.c
index 1808860..e589cde 100644
--- a/rsvg-filter.c
+++ b/rsvg-filter.c
@@ -2996,8 +2996,9 @@ rsvg_filter_primitive_displacement_map_render (RsvgFilterPrimitive * self, RsvgF
         xch = 3;
         break;
     default:
-        xch = 4;
-    };
+        ych = 0;
+        break;
+    }
 
     switch (upself->yChannelSelector) {
     case 'R':
@@ -3013,8 +3014,9 @@ rsvg_filter_primitive_displacement_map_render (RsvgFilterPrimitive * self, RsvgF
         ych = 3;
         break;
     default:
-        ych = 4;
-    };
+        ych = 1;
+        break;
+    }
 
     xch = ctx->channelmap[xch];
     ych = ctx->channelmap[ych];


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]