зеркало из https://github.com/mozilla/pjs.git
Bug 214191 - crash printing pages with spacer images.
r=roland.mainz, sr=bzbarsky
This commit is contained in:
Родитель
272e86c75d
Коммит
872af3604a
|
@ -2573,6 +2573,16 @@ PRInt32 sRow, eRow, rStep;
|
|||
if(bytes_Per_Pix == 1)
|
||||
return ;
|
||||
|
||||
aImage->LockImagePixels(PR_FALSE);
|
||||
theBits = aImage->GetBits();
|
||||
|
||||
/* image data might not be available (ex: spacer image) */
|
||||
if (!theBits)
|
||||
{
|
||||
aImage->UnlockImagePixels(PR_FALSE);
|
||||
return;
|
||||
}
|
||||
|
||||
rowData = aImage->GetLineStride();
|
||||
height = aImage->GetHeight();
|
||||
width = aImage->GetWidth();
|
||||
|
@ -2591,8 +2601,6 @@ PRInt32 sRow, eRow, rStep;
|
|||
fprintf(f, " { currentfile rowdata readhexstring pop }\n");
|
||||
fprintf(f, " image\n");
|
||||
|
||||
aImage->LockImagePixels(PR_FALSE);
|
||||
theBits = aImage->GetBits();
|
||||
n = 0;
|
||||
if ( ( isTopToBottom = aImage->GetIsRowOrderTopToBottom()) == PR_TRUE ) {
|
||||
sRow = height - 1;
|
||||
|
@ -2658,6 +2666,16 @@ PRInt32 sRow, eRow, rStep;
|
|||
if(bytes_Per_Pix == 1)
|
||||
return ;
|
||||
|
||||
aImage->LockImagePixels(PR_FALSE);
|
||||
theBits = aImage->GetBits();
|
||||
|
||||
/* image data might not be available (ex: spacer image) */
|
||||
if (!theBits)
|
||||
{
|
||||
aImage->UnlockImagePixels(PR_FALSE);
|
||||
return;
|
||||
}
|
||||
|
||||
rowData = aImage->GetLineStride();
|
||||
height = aImage->GetHeight();
|
||||
width = aImage->GetWidth();
|
||||
|
@ -2676,8 +2694,6 @@ PRInt32 sRow, eRow, rStep;
|
|||
fprintf(f, " { currentfile rowdata readhexstring pop }\n");
|
||||
fprintf(f, " false 3 colorimage\n");
|
||||
|
||||
aImage->LockImagePixels(PR_FALSE);
|
||||
theBits = aImage->GetBits();
|
||||
n = 0;
|
||||
if ( ( isTopToBottom = aImage->GetIsRowOrderTopToBottom()) == PR_TRUE ) {
|
||||
sRow = height - 1;
|
||||
|
|
|
@ -1061,6 +1061,13 @@ nsXPrintContext::DrawImageBitsScaled(xGC *xgc, nsIImage *aImage,
|
|||
PRInt32 aSrcHeight = aImage->GetHeight();
|
||||
PRUint8 *composed_bits = nsnull;
|
||||
|
||||
/* image data might not be available (ex: spacer image) */
|
||||
if (!image_bits)
|
||||
{
|
||||
aImage->UnlockImagePixels(PR_FALSE);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Use client-side alpha image composing - plain X11 can only do 1bit alpha
|
||||
// stuff - this method adds 8bit alpha support, too...
|
||||
if( alphaBits != nsnull )
|
||||
|
@ -1139,6 +1146,13 @@ nsXPrintContext::DrawImage(xGC *xgc, nsIImage *aImage,
|
|||
PRUint8 *image_bits = aImage->GetBits();
|
||||
PRUint8 *composed_bits = nsnull;
|
||||
PRInt32 row_bytes = aImage->GetLineStride();
|
||||
|
||||
/* image data might not be available (ex: spacer image) */
|
||||
if (!image_bits)
|
||||
{
|
||||
aImage->UnlockImagePixels(PR_FALSE);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Use client-side alpha image composing - plain X11 can only do 1bit alpha
|
||||
// stuff - this method adds 8bit alpha support, too...
|
||||
|
|
Загрузка…
Ссылка в новой задаче