windowscodecs: Properly handle empty GIF extension blocks.

This commit is contained in:
Dmitry Timoshkov 2015-07-15 16:34:34 +08:00 committed by Alexandre Julliard
parent f46aa66ca7
commit 7eaff17786
1 changed files with 11 additions and 3 deletions

View File

@ -932,9 +932,17 @@ DGifSlurp(GifFileType * GifFile) {
Extensions->Function = Function;
/* Create an extension block with our data */
if (AddExtensionBlock(Extensions, ExtData[0], &ExtData[1]) == GIF_ERROR)
return (GIF_ERROR);
if (ExtData)
{
/* Create an extension block with our data */
if (AddExtensionBlock(Extensions, ExtData[0], &ExtData[1]) == GIF_ERROR)
return (GIF_ERROR);
}
else /* Empty extension block */
{
if (AddExtensionBlock(Extensions, 0, NULL) == GIF_ERROR)
return (GIF_ERROR);
}
while (ExtData != NULL) {
int Len;