diff --git a/pdf.c b/pdf.c
index 363c08b75f1f3fa5e23659e17059f1d18a234461..f09e564676fa73a774aa8e6df291b4b5fcfd5e84 100644
--- a/pdf.c
+++ b/pdf.c
@@ -410,11 +410,11 @@ act_a85string(const HParseResult *p, void *u)
 	 * The latter two happening if the group was parsed from a partial
 	 * group consisting less than 5 chars */
 	HBytes *last_chunk = seq->elements[seq->used-1];
-	required_bytes = chunk_number * 4 + last_chunk->len;
+	required_bytes = (chunk_number * 4 + last_chunk->len) * 8;
 
 	result_bytes = h_arena_malloc(p->arena, required_bytes);
 
-	/* Memcpy all but the group's bytes into a single array */
+	/* memcpy all but the last group's bytes into a single array */
 	for (size_t i = 0; i < seq->used-1; ++i)
 	{
 		HBytes *chunk = H_CAST_BYTES(seq->elements[i]);