wheels for crikey, xml tweak and edl fix for nesting
[goodguy/history.git] / cinelerra-5.1 / cinelerra / filexml.C
index 1da5a5e067359d0a8aae04af44f59ced9bed0a64..aef297e41adf822d9c697cda88a7cdb05130dbe0 100644 (file)
@@ -76,9 +76,10 @@ XMLBuffer::~XMLBuffer()
 unsigned char *&XMLBuffer::demand(long len)
 {
        if( len > bsz ) {
-               len += BCTEXTLEN;
+               long sz = inp-bfr;
+               len += sz/2 + BCTEXTLEN;
                unsigned char *np = new unsigned char[len];
-               if( inp > bfr ) memcpy(np,bfr,inp-bfr);
+               if( sz > 0 ) memcpy(np,bfr,sz);
                inp = np + (inp-bfr);
                outp = np + (outp-bfr);
                lmt = np + len;  bsz = len;