X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8141573c1ed2d7f02b201c7b78f32ffca2925eeb..90da75e673f51b30e04629035d8bf7501fd00e30:/src/common/gifdecod.cpp diff --git a/src/common/gifdecod.cpp b/src/common/gifdecod.cpp index c746a8574f..923685e552 100644 --- a/src/common/gifdecod.cpp +++ b/src/common/gifdecod.cpp @@ -36,7 +36,7 @@ wxGIFDecoder::wxGIFDecoder(wxInputStream *s, bool anim) { - m_f = s; + m_f = s; m_anim = anim; m_background = -1; @@ -69,6 +69,12 @@ void wxGIFDecoder::Destroy() delete pimg; pimg = paux; } + + m_pimage = NULL; + m_pfirst = NULL; + m_plast = NULL; + m_image = 0; + m_nimages = 0; } @@ -643,7 +649,7 @@ int wxGIFDecoder::ReadGIF() if ((buf[8] & 0x80) == 0x80) { ncolors = 2 << (buf[8] & 0x07); - m_f->Read(pal, 3 * ncolors); + m_f->SeekI(3 * ncolors, wxFromCurrent); } /* initial code size */ @@ -655,7 +661,7 @@ int wxGIFDecoder::ReadGIF() m_f->SeekI(i, wxFromCurrent); } } - else if (type != 0x3B) + else if ((type != 0x3B) && (type != 00)) /* testing */ { /* images are OK, but couldn't read to the end of the stream */ return wxGIF_TRUNCATED;