* fixed bug: buffer overflow when exporting TGA files
[glBitmap.git] / glBitmap.pas
index 1198bda..0641898 100644 (file)
@@ -4630,7 +4630,7 @@ var
   begin
     PixelSize := fPixelSize;
 
-    for Idx := 0 to Height * Width do begin
+    for Idx := 1 to Height * Width do begin
       Temp := pByteArray(pTemp)^[2];
       pByteArray(pTemp)^[2] := pByteArray(pTemp)^[0];
       pByteArray(pTemp)^[0] := Temp;