Update ImageHelpers.cs

Index Out Of Range when using Blur filter on a portrait picture
y maximum is 'y < h' so newColors array should be sized from h, not w
This commit is contained in:
gaelbenoit 2016-12-20 14:07:03 +01:00 committed by GitHub
parent f7951f4b75
commit 2a6e66cf18

View file

@ -1112,7 +1112,7 @@ private static void BoxBlurVertical(UnsafeBitmap unsafeBitmap, int range)
int w = unsafeBitmap.Width; int w = unsafeBitmap.Width;
int h = unsafeBitmap.Height; int h = unsafeBitmap.Height;
int halfRange = range / 2; int halfRange = range / 2;
ColorBgra[] newColors = new ColorBgra[w]; ColorBgra[] newColors = new ColorBgra[h];
for (int x = 0; x < w; x++) for (int x = 0; x < w; x++)
{ {