buffer may not be large enough to convert to UCS4, patch from Christian

* encoding.c: buffer may not be  large enough to convert to
  UCS4, patch from Christian Fruth , fixes #504015
Daniel

svn path=/trunk/; revision=3727
diff --git a/encoding.c b/encoding.c
index 6d7a4ce..6c49fff 100644
--- a/encoding.c
+++ b/encoding.c
@@ -1992,8 +1992,8 @@
     toconv = in->use;
     if (toconv == 0)
 	return(0);
-    if (toconv * 2 >= written) {
-        xmlBufferGrow(out, toconv * 2);
+    if (toconv * 4 >= written) {
+        xmlBufferGrow(out, toconv * 4);
 	written = out->size - out->use - 1;
     }
     if (handler->output != NULL) {