fix from ketmar

This commit is contained in:
Adam D. Ruppe 2021-01-21 10:22:10 -05:00
parent 89718d996e
commit eabf6032a2
1 changed files with 1 additions and 1 deletions

2
png.d
View File

@ -1913,7 +1913,7 @@ immutable(ubyte)[] unfilter(ubyte filterType, in ubyte[] data, in ubyte[] previo
foreach(i; 0 .. arr.length) {
auto prev = i < bpp ? 0 : arr[i - bpp];
arr[i] += cast(ubyte)
/*std.math.floor*/( cast(int) (prev + previousLine[i]) / 2);
/*std.math.floor*/( cast(int) (prev + (previousLine.length ? previousLine[i] : 0)) / 2);
}
return assumeUnique(arr);