diff --git a/ChangeLog b/ChangeLog index 77b93eb38..f4fa8402b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-12-16 Mike Kestner + + * gdk/PixbufLoader.custom (InitFromAssemblyResource): move stream + access code outside the try block so only the Load is cleaned up with + the finally block. Add some other arg checking. [Fixes #76997] + 2005-12-13 Mike Kestner * sources/Makefile.am : move to stable gtk 2.8 versions. diff --git a/gdk/PixbufLoader.custom b/gdk/PixbufLoader.custom index b3132ffc0..70336c53e 100644 --- a/gdk/PixbufLoader.custom +++ b/gdk/PixbufLoader.custom @@ -73,6 +73,9 @@ private void InitFromStream (System.IO.Stream stream) { + if (stream == null) + throw new ArgumentNullException ("stream"); + try { LoadFromStream (stream); } finally { @@ -93,14 +96,14 @@ private void InitFromAssemblyResource(System.Reflection.Assembly assembly, string resource) { + if (assembly == null) + throw new ArgumentNullException ("assembly"); + + System.IO.Stream s = assembly.GetManifestResourceStream (resource); + if (s == null) + throw new ArgumentException ("'" + resource + "' is not a valid resource name of assembly '" + assembly + "'."); + try { - if (resource == null) - throw new ArgumentNullException ("resource"); - - System.IO.Stream s = assembly.GetManifestResourceStream (resource); - if (s == null) - throw new ArgumentException ("'" + resource + "' is not a valid resource name of assembly '" + assembly + "'."); - LoadFromStream (s); } finally { Close ();