[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

[XaraXtreme-commits] Commit Complete



Commit by  : luke
Repository : xara
Revision   : 1537
Date       : Tue Jul 25 18:50:04 BST 2006

Changed paths:
   M /Trunk/XaraLX/Kernel/exjpeg.cpp

Fix error that could cause stack overflow, put in only to see if you're all awake (which you weren't) 8-)


Diff:
Index: Trunk/XaraLX/Kernel/exjpeg.cpp
===================================================================
--- Trunk/XaraLX/Kernel/exjpeg.cpp	(revision 1536)
+++ Trunk/XaraLX/Kernel/exjpeg.cpp	(revision 1537)
@@ -1345,6 +1345,8 @@
 		UINT32 ScanlinesRemaining = Height;
 		pBitmapLine += (ScanlinesRemaining - 1) * ScanlineSize;
 
+		RGBTRIPLE*	pTempLine = (RGBTRIPLE*)alloca( ExportlineSize );
+
 		// Do it one line at a time like it or not
 		while (ScanlinesRemaining > 0)
 		{
@@ -1364,7 +1366,7 @@
 			RGBTRIPLE* pExportRGB = (RGBTRIPLE*)pExportLine;
 			if( pExportLine == pBitmapLine )
 			{
-				pExportRGB = (RGBTRIPLE*)alloca( ExportlineSize );
+				pExportRGB = pTempLine;
 				memcpy( pExportRGB, pExportLine, ExportlineSize );
 				pExportLine = PBYTE(pExportRGB);
 			}


Xara