diff --git a/libav/aviobuf.c b/libav/aviobuf.c
index 71f4b64dc75f8aa87f882f349a992c95988ce8ce..6c23088d9157c0ac5a9b3c7c913dbcb996922941 100644
--- a/libav/aviobuf.c
+++ b/libav/aviobuf.c
@@ -519,7 +519,7 @@ static void dyn_buf_write(void *opaque, UINT8 *buf, int buf_size)
         if (!new_allocated_size)
             new_allocated_size = new_size;
         else
-            new_allocated_size = (new_allocated_size * 3) / 2;
+            new_allocated_size = (new_allocated_size * 3) / 2 + 1;    
     }
     
     if (new_allocated_size > d->allocated_size) {