File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed
src/ImageSharp/Processing/Processors/Dithering Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ namespace SixLabors.ImageSharp.Processing.Processors.Dithering
2727 [ MethodImpl ( InliningOptions . ShortMethod ) ]
2828 public ErrorDither ( in DenseMatrix < float > matrix , int offset )
2929 {
30+ Guard . MustBeGreaterThan ( offset , 0 , nameof ( offset ) ) ;
31+
3032 this . matrix = matrix ;
3133 this . offset = offset ;
3234 }
Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ namespace SixLabors.ImageSharp.Processing.Processors.Dithering
2424 [ MethodImpl ( InliningOptions . ShortMethod ) ]
2525 public OrderedDither ( uint length )
2626 {
27+ Guard . MustBeGreaterThan ( length , 0 , nameof ( length ) ) ;
28+
2729 DenseMatrix < uint > ditherMatrix = OrderedDitherFactory . CreateDitherMatrix ( length ) ;
2830
2931 // Create a new matrix to run against, that pre-thresholds the values.
You can’t perform that action at this time.
0 commit comments