diff --git a/ChangeLog b/ChangeLog index 24a0a5db3..a29efc50f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-01-09 Mike Kestner + + * sample/GtkDemo/DemoPixbuf.cs : use Marshal.Copy properly + to avoid expose crashes. Revised from patch provided by + Fabian Sturm. [#78262] + 2007-01-09 Mike Kestner * sample/GtkDemo/DemoIconView.cs : use Gtk.Stock icons to avoid diff --git a/sample/GtkDemo/DemoPixbuf.cs b/sample/GtkDemo/DemoPixbuf.cs index eab0ec2f2..a1ae4a1b8 100644 --- a/sample/GtkDemo/DemoPixbuf.cs +++ b/sample/GtkDemo/DemoPixbuf.cs @@ -80,7 +80,8 @@ namespace GtkDemo rowstride = frame.Rowstride; pixels = new byte[(frame.Height - area.Y) * rowstride]; - Marshal.Copy (frame.Pixels, pixels, rowstride * area.Y + area.X * 3, pixels.Length); + IntPtr src = (IntPtr)(frame.Pixels.ToInt64 () + rowstride * area.Y + area.X * 3); + Marshal.Copy (src, pixels, 0, pixels.Length); widget.GdkWindow.DrawRgbImageDithalign (widget.Style.BlackGC, area.X, area.Y, area.Width, area.Height,