Commit 558a7d9b authored by Thomas Freitag's avatar Thomas Freitag Committed by Albert Astals Cid
Browse files

Fix invalid memory access in solves 1066.pdf.asan.38.75

parent d0df8e54
......@@ -384,4 +384,27 @@ void SplashClip::clipAALine(SplashBitmap *aaBuf, int *x0, int *x1, int y) {
for (i = 0; i < length; ++i) {
scanners[i]->clipAALine(aaBuf, x0, x1, y);
}
if (*x0 > *x1) {
*x0 = *x1;
}
if (*x0 < 0) {
*x0 = 0;
}
if ((*x0>>1) >= aaBuf->getRowSize()) {
xx0 = *x0;
*x0 = (aaBuf->getRowSize() - 1) << 1;
if (xx0 & 1) {
*x0 = *x0 + 1;
}
}
if (*x1 < *x0) {
*x1 = *x0;
}
if ((*x1>>1) >= aaBuf->getRowSize()) {
xx0 = *x1;
*x1 = (aaBuf->getRowSize() - 1) << 1;
if (xx0 & 1) {
*x1 = *x1 + 1;
}
}
}
......@@ -441,6 +441,9 @@ void SplashXPathScanner::renderAALine(SplashBitmap *aaBuf,
}
}
}
if (xxMin > xxMax) {
xxMin = xxMax;
}
*x0 = xxMin / splashAASize;
*x1 = (xxMax - 1) / splashAASize;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment