ketmar paeth fix

This commit is contained in:
Adam D. Ruppe 2016-04-24 08:38:57 -04:00
parent debd4fe356
commit 8a7886a63d
1 changed files with 2 additions and 2 deletions

4
png.d
View File

@ -1748,9 +1748,9 @@ immutable(ubyte)[] unfilter(ubyte filterType, in ubyte[] data, in ubyte[] previo
auto arr = data.dup;
foreach(i; 0 .. arr.length) {
ubyte prev = i < bpp ? 0 : arr[i - bpp];
ubyte prevLL = i < bpp ? 0 : previousLine[i - bpp];
ubyte prevLL = i < bpp ? 0 : (i < previousLine.length ? previousLine[i - bpp] : 0);
arr[i] += PaethPredictor(prev, previousLine[i], prevLL);
arr[i] += PaethPredictor(prev, (i < previousLine.length ? previousLine[i] : 0), prevLL);
}
return assumeUnique(arr);