X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8fee6306488bf6b2b4a730d15c8f300af9de470d..b2238cc3156f4e15e567d2218c88301bc2af9adb:/src/common/imagtga.cpp?ds=sidebyside 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)