summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2010-04-19 10:28:44 -0400
committerRyan Lortie <desrt@desrt.ca>2010-04-19 10:28:44 -0400
commit2d9811ebdaee294ac9a1826db5be891b2b90d67f (patch)
treec543c27c873112652df21ee63171a93b97b8f9a9
parent6713b3dbaaabf9bbf196e6bc45d200b092239b59 (diff)
downloadgvdb-2d9811ebdaee294ac9a1826db5be891b2b90d67f.tar.gz
Don't write out zero-byte sections in builder
This and the previous issue caught by Christian Persch in bug #616156
-rw-r--r--gvdb-builder.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gvdb-builder.c b/gvdb-builder.c
index de9fff2..7cca13f 100644
--- a/gvdb-builder.c
+++ b/gvdb-builder.c
@@ -236,6 +236,9 @@ file_builder_allocate (FileBuilder *fb,
{
FileChunk *chunk;
+ if (size == 0)
+ return NULL;
+
fb->offset += (-fb->offset) & (alignment - 1);
chunk = g_slice_new (FileChunk);
chunk->offset = fb->offset;