1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00

Fixed wrong buffer size exception caused by an error-case of the AmbienceCreatorExtend

This commit is contained in:
Darth Affe 2016-11-01 17:58:56 +01:00
parent 1464c3ad06
commit f12ec07de0

View File

@ -38,8 +38,12 @@ namespace Artemis.Profiles.Layers.Types.AmbientLight.AmbienceCreator
double widthPixels = effectiveSourceWidth / (double)targetWidth;
double heightPixels = relevantSourceHeight / (double)targetHeight;
if (widthPixels <= 0 || heightPixels <= 0 || (relevantSourceHeight + relevantOffsetTop > sourceHeight) || effectiveSourceWidth > sourceWidth)
if (widthPixels <= 0 || heightPixels <= 0 || (relevantSourceHeight + relevantOffsetTop > sourceHeight) ||
effectiveSourceWidth > sourceWidth)
{
colors = colors.ExtendHeight(targetHeight);
return colors.ToBGRArray();
}
int increment = Math.Max(1, Math.Min(20, settings.Downsampling));
for (int y = 0; y < relevantSourceHeight; y += increment)