Skip to content

Commit

Permalink
patched fixes that were accidentally removed
Browse files Browse the repository at this point in the history
  • Loading branch information
Laurence Bank authored and Laurence Bank committed Dec 18, 2021
1 parent dd37b58 commit 9889e73
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/AnimatedGIF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ long lTime = millis();
if (GIFParseInfo(&_gif, 0))
{
_gif.pUser = pUser;
if (_gif.iError == GIF_EMPTY_FRAME) // don't try to decode it
return 0;
rc = DecodeLZW(&_gif, 0);
if (rc != 0) // problem
return -1;
Expand Down
7 changes: 6 additions & 1 deletion src/gif.inl
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ static int GIFParseInfo(GIFIMAGE *pPage, int bInfoOnly)
}
}
}
while (p[iOffset] != ',') /* Wait for image separator */
while (p[iOffset] != ',' && p[iOffset] != ';') /* Wait for image separator */
{
if (p[iOffset] == '!') /* Extension block */
{
Expand Down Expand Up @@ -416,6 +416,11 @@ static int GIFParseInfo(GIFIMAGE *pPage, int bInfoOnly)
return 0;
}
} /* while */
if (p[iOffset] == ';') { // end of file, quit and return a correct error code
pPage->iError = GIF_EMPTY_FRAME;
return 1;
}

if (p[iOffset] == ',')
iOffset++;
// This particular frame's size and position on the main frame (if animated)
Expand Down

0 comments on commit 9889e73

Please sign in to comment.