Commit b1a3de76 authored by Nils Philippsen's avatar Nils Philippsen

file-gif-load: ensure return value of LZWReadByte() is <= 255

parent c6f0a66d
......@@ -759,11 +759,11 @@ LZWReadByte (FILE *fd,
}
while (firstcode == clear_code);
return firstcode;
return firstcode & 255;
}
if (sp > stack)
return *--sp;
return (*--sp) & 255;
while ((code = GetCode (fd, code_size, FALSE)) >= 0)
{
......@@ -786,7 +786,7 @@ LZWReadByte (FILE *fd,
sp = stack;
firstcode = oldcode = GetCode (fd, code_size, FALSE);
return firstcode;
return firstcode & 255;
}
else if (code == end_code)
{
......@@ -842,10 +842,10 @@ LZWReadByte (FILE *fd,
oldcode = incode;
if (sp > stack)
return *--sp;
return (*--sp) & 255;
}
return code;
return code & 255;
}
static gint32
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment