Browse Source

2008-05-14 Sebastien Pouliot <[email protected]>

	* EncoderParameters.cs: Don't downcast an IntPtr to an Int32.
	[Found using Gendarme]


svn path=/trunk/mcs/; revision=103239
Sebastien Pouliot 17 years ago
parent
commit
9324546ee3

+ 5 - 0
mcs/class/System.Drawing/System.Drawing.Imaging/ChangeLog

@@ -1,3 +1,8 @@
+2008-05-14  Sebastien Pouliot  <[email protected]>
+
+	* EncoderParameters.cs: Don't downcast an IntPtr to an Int32.
+	[Found using Gendarme]
+
 2007-12-13 Vladimir Krasnov <[email protected]>
 
 	* ImageCodec.jvm.cs: fixed bitmap resolution

+ 3 - 7
mcs/class/System.Drawing/System.Drawing.Imaging/EncoderParameters.cs

@@ -5,11 +5,7 @@
 //	Ravindra ([email protected])
 //  Vladimir Vukicevic ([email protected])
 //
-// (C) 2004 Novell, Inc.  http://www.novell.com
-//
-
-//
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004, 2008 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -76,7 +72,7 @@ namespace System.Drawing.Imaging
 			ptr = (IntPtr) (ptr.ToInt64() + 4);
 			for (int i = 0; i < parameters.Length; i++) {
 				parameters[i].ToNativePtr (ptr);
-				ptr = (IntPtr) ((int) ptr + EncoderParameter.NativeSize());
+				ptr = (IntPtr) (ptr.ToInt64 () + EncoderParameter.NativeSize ());
 			}
 
 			return result;
@@ -105,7 +101,7 @@ namespace System.Drawing.Imaging
 
 			for (int i = 0; i < count; i++) {
 				result.parameters[i] = EncoderParameter.FromNativePtr (ptr);
-				ptr = (IntPtr) ((int) ptr + EncoderParameter.NativeSize());
+				ptr = (IntPtr) (ptr.ToInt64 () + EncoderParameter.NativeSize ());
 			}
 
 			return result;