Browse Source

Revert unsafe indexer

pull/1641/head
James Jackson-South 5 years ago
parent
commit
8834788490
  1. 4
      src/ImageSharp/Processing/Processors/Normalization/AdaptiveHistogramEqualizationProcessor{TPixel}.cs

4
src/ImageSharp/Processing/Processors/Normalization/AdaptiveHistogramEqualizationProcessor{TPixel}.cs

@ -619,9 +619,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Normalization
for (int dx = x; dx < xlimit; dx++) for (int dx = x; dx < xlimit; dx++)
{ {
int luminance = GetLuminance(rowSpan[dx], this.luminanceLevels); int luminance = GetLuminance(rowSpan[dx], this.luminanceLevels);
histogram[luminance]++;
// This is safe. The index maxes out to the span length.
Unsafe.Add(ref histogramBase, luminance)++;
} }
} }

Loading…
Cancel
Save