git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42824
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
{
while ((i = (unsigned char)stream.GetC()) != 0)
{
{
while ((i = (unsigned char)stream.GetC()) != 0)
{
- stream.SeekI(i, wxFromCurrent);
- if (stream.Eof())
+ if (stream.Eof() || (stream.LastRead() == 0))
+ stream.SeekI(i, wxFromCurrent);
/* skip all data */
while ((i = (unsigned char)stream.GetC()) != 0)
{
/* skip all data */
while ((i = (unsigned char)stream.GetC()) != 0)
{
+ if (stream.Eof() || (stream.LastRead() == 0))
+ {
+ Destroy();
+ return wxGIF_INVFORMAT;
+ }
stream.SeekI(i, wxFromCurrent);
}
}
stream.SeekI(i, wxFromCurrent);
}
}
wxFileOffset pos = stream.TellI();
wxFileOffset numBytes = 3 * local_ncolors;
stream.SeekI(numBytes, wxFromCurrent);
wxFileOffset pos = stream.TellI();
wxFileOffset numBytes = 3 * local_ncolors;
stream.SeekI(numBytes, wxFromCurrent);
- if (stream.TellI() != (pos + numBytes))
- {
- Destroy();
- return wxGIF_INVFORMAT;
- }
}
/* initial code size */
(void) stream.GetC();
}
/* initial code size */
(void) stream.GetC();
+ if (stream.Eof() || (stream.LastRead() == 0))
+ {
+ Destroy();
+ return wxGIF_INVFORMAT;
+ }
/* skip all data */
while ((i = (unsigned char)stream.GetC()) != 0)
{
/* skip all data */
while ((i = (unsigned char)stream.GetC()) != 0)
{
+ if (stream.Eof() || (stream.LastRead() == 0))
+ {
+ Destroy();
+ return wxGIF_INVFORMAT;
+ }
stream.SeekI(i, wxFromCurrent);
}
}
stream.SeekI(i, wxFromCurrent);
}
}