]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/imagtga.cpp
Document wxTE_MULTILINE support in wxTextEntryDialog.
[wxWidgets.git] / src / common / imagtga.cpp
index 8f9737ca4e7c9e8a24a4ae1bcd3beb57883e32ba..3d412ddeed0dbda906eb425843d460b523396da8 100644 (file)
@@ -131,6 +131,11 @@ int DecodeRLE(unsigned char* imageData, unsigned long imageSize,
 
             index += current * pixelSize;
 
+            if (index >= imageSize)
+            {
+                return wxTGA_IOERR;
+            }
+
             // Repeat the pixel length times.
             if ( !stream.Read(buf, pixelSize) )
                 return wxTGA_IOERR;
@@ -151,6 +156,11 @@ int DecodeRLE(unsigned char* imageData, unsigned long imageSize,
 
             index += length;
 
+            if (index >= imageSize)
+            {
+                return wxTGA_IOERR;
+            }
+
             // Write the next length pixels directly to the image data.
             if ( !stream.Read(imageData, length) )
                 return wxTGA_IOERR;