X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8fee6306488bf6b2b4a730d15c8f300af9de470d..4aa1406671c5d6abded83e3713b423ac4d40b7c9:/src/common/imagtga.cpp diff --git a/src/common/imagtga.cpp b/src/common/imagtga.cpp index fc7373822b..9fd65003a7 100644 --- a/src/common/imagtga.cpp +++ b/src/common/imagtga.cpp @@ -211,7 +211,8 @@ int ReadTGA(wxImage* image, wxInputStream& stream) } // Seek from the offset we got from the TGA header. - stream.SeekI(offset, wxFromStart); + if (stream.SeekI(offset, wxFromStart) == wxInvalidOffset) + return wxTGA_INVFORMAT; // Load a palette if we have one. if (colorType == wxTGA_MAPPED)