Fix for 76230, some GIFs don't display. r=pavlov, sr=hyatt

git-svn-id: svn://10.0.0.236/trunk@93692 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
saari%netscape.com 2001-05-02 22:42:19 +00:00
parent 6a3b5d9b6f
commit f30c3dd6e5
2 changed files with 11 additions and 0 deletions

View File

@ -1225,6 +1225,12 @@ int gif_write(gif_struct *gs, const PRUint8 *buf, PRUint32 len)
gs->screen_width = width;
gs->x_offset = 0;
gs->y_offset = 0;
(*gs->GIFCallback_BeginGIF)(
gs->clientptr,
gs->screen_width,
gs->screen_height,
gs->screen_bgcolor);
}
/* Work around more broken GIF files that have zero image
width or height */

View File

@ -235,6 +235,11 @@ int BeginGIF(
PRUint32 aLogicalScreenHeight,
PRUint8 aBackgroundRGBIndex)
{
// If we have passed an illogical screen size, bail and hope that we'll get
// set later by the first frame's local image header.
if(aLogicalScreenWidth == 0 || aLogicalScreenHeight == 0)
return 0;
// copy GIF info into imagelib structs
nsGIFDecoder2 *decoder = NS_STATIC_CAST(nsGIFDecoder2*, aClientData);