]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/imagtga.cpp
simplify Refresh() and Update()
[wxWidgets.git] / src / common / imagtga.cpp
index fc7373822bb0090ac06b3751027ebeb3d70538d2..9fd65003a77f746bde9e7c32670edfb26c04537a 100644 (file)
@@ -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)