mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
332704 Divide-by-zero causes crash on x86 Mac when viewing SVG. Check for /0. r=jhpedemonte r=vlad sr=shaver
This commit is contained in:
parent
cba58dc723
commit
5554ac3bd6
@ -579,9 +579,17 @@ nsImageMac::LockImagePixels(PRBool aMaskPixels)
|
||||
PRUint8 alpha = *tmp++;
|
||||
mAlphaBits[alphaRowStart + x] = alpha;
|
||||
PRUint32 offset = rowStart + COMPS_PER_PIXEL * x;
|
||||
mImageBits[offset + 1] = ((PRUint32) *tmp++) * 255 / alpha;
|
||||
mImageBits[offset + 2] = ((PRUint32) *tmp++) * 255 / alpha;
|
||||
mImageBits[offset + 3] = ((PRUint32) *tmp++) * 255 / alpha;
|
||||
if (alpha) {
|
||||
mImageBits[offset + 1] = ((PRUint32) *tmp++) * 255 / alpha;
|
||||
mImageBits[offset + 2] = ((PRUint32) *tmp++) * 255 / alpha;
|
||||
mImageBits[offset + 3] = ((PRUint32) *tmp++) * 255 / alpha;
|
||||
}
|
||||
else {
|
||||
tmp += 3;
|
||||
mImageBits[offset + 1] =
|
||||
mImageBits[offset + 2] =
|
||||
mImageBits[offset + 3] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user