[gtk+/gtk-2-16] Don't use stream before it is created



commit 6cf7c942f630a3d1bf4d288d6b5d13391d592adb
Author: Shixin Zeng <zeng shixin gmail com>
Date:   Thu Aug 20 23:53:57 2009 +0300

    Don't use stream before it is created

 gdk-pixbuf/io-gdip-utils.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gdk-pixbuf/io-gdip-utils.c b/gdk-pixbuf/io-gdip-utils.c
index eff2f76..b8fa72b 100644
--- a/gdk-pixbuf/io-gdip-utils.c
+++ b/gdk-pixbuf/io-gdip-utils.c
@@ -365,7 +365,6 @@ gdip_buffer_to_bitmap (GdipContext *context, GError **error)
   if (!hg)
     return NULL;
 
-  IStream_SetSize (stream, *(ULARGE_INTEGER *)&size64);
   hr = CreateStreamOnHGlobal (hg, FALSE, (LPSTREAM *)&stream);
 
   if (!SUCCEEDED (hr)) {
@@ -373,7 +372,9 @@ gdip_buffer_to_bitmap (GdipContext *context, GError **error)
     GlobalFree (hg);
     return NULL;
   }
-  
+
+  IStream_SetSize (stream, *(ULARGE_INTEGER *)&size64);
+
   status = GdipCreateBitmapFromStream (stream, &bitmap);
 
   if (Ok != status) {



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