Bug 84980 - zero out the color components of transparent pixels

in a binary alpha PNG on win32 before handing them off to libpr0n.
r=pavlov, sr=brendan
This commit is contained in:
tor%cs.brown.edu 2001-08-21 21:59:08 +00:00
parent b2d21df256
commit 308246a092

View File

@ -453,11 +453,21 @@ row_callback(png_structp png_ptr, png_bytep new_row,
#ifdef XP_MAC
*cptr++ = 0;
#endif
*cptr++ = *line++;
*cptr++ = *line++;
*cptr++ = *line++;
if (*line++) {
if (line[3]) {
*cptr++ = *line++;
*cptr++ = *line++;
*cptr++ = *line++;
aptr[x>>3] |= 1<<(7-x&0x7);
line++;
} else {
#ifdef XP_WIN
*cptr++ = 0;
*cptr++ = 0;
*cptr++ = 0;
#else
cptr += 3;
#endif
line += 4;
}
}
decoder->mFrame->SetAlphaData(decoder->alphaLine, abpr, row_num*abpr);