r16508 by jghali - #9878 related : fix potential infinite loop if End value is 65535

scribus-commit scribus-commit at lists.scribus.net
Fri Mar 25 22:59:02 CET 2011


Author: jghali
Date: Fri Mar 25 21:59:01 2011
New Revision: 16508

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16508
Log:
#9878 related : fix potential infinite loop if End value is 65535

Modified:
    trunk/Scribus/scribus/fonts/scface_ttf.cpp

Modified: trunk/Scribus/scribus/fonts/scface_ttf.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16508&path=/trunk/Scribus/scribus/fonts/scface_ttf.cpp
==============================================================================
--- trunk/Scribus/scribus/fonts/scface_ttf.cpp (original)
+++ trunk/Scribus/scribus/fonts/scface_ttf.cpp Fri Mar 25 21:59:01 2011
@@ -214,9 +214,7 @@
 					quint16 SecondGlyph ( toUint16 ( recordBase ) );
 					qint16 Value1 ( toInt16 ( recordBase + 2 ) );
 					pairs[FirstGlyph][SecondGlyph] = double ( Value1 );
-
 				}
-
 			}
 		}
 		else if ( ValueFormat1 && ( !ValueFormat2 ) )
@@ -233,9 +231,7 @@
 					quint16 SecondGlyph ( toUint16 ( recordBase ) );
 					qint16 Value1 ( toInt16 ( recordBase + 2 ) );
 					pairs[FirstGlyph][SecondGlyph] = double ( Value1 );
-
 				}
-
 			}
 		}
 		else
@@ -340,10 +336,10 @@
 			quint16 End ( toUint16 ( ClassRangeRecord + ( CRR * 6 ) + 2 ) );
 			quint16 Class ( toUint16 ( ClassRangeRecord + ( CRR * 6 ) + 4 ) );
 
-			for ( quint16 gl ( Start ); gl <= End; ++gl )
-			{
-				ret[0].removeAll ( gl );
-				ret[Class] << gl;
+			for ( int gl ( Start ); gl <= (int) End; ++gl )
+			{
+				ret[0].removeAll ( (quint16) gl );
+				ret[Class] << (quint16) gl;
 			}
 		}
 	}




More information about the scribus-commit mailing list