-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
Encoding with arith_dynamic and the X_CAT (0x20) flag fails. E.g.,
$ echo -n "htscodecs" | tests/arith_dynamic -r -o32
$ echo $?
1The encoder has a special case for X_CAT but does not return early, which, in the example, later causes the order 0 encoder to fail. The encoder works as expected when returning early:
diff --git a/htscodecs/arith_dynamic.c b/htscodecs/arith_dynamic.c
index 9f891ee..0817910 100644
--- a/htscodecs/arith_dynamic.c
+++ b/htscodecs/arith_dynamic.c
@@ -759,6 +759,7 @@ unsigned char *arith_compress_to(unsigned char *in, unsigned int in_size,
}
memcpy(out+c_meta_len, in, in_size);
*out_size = in_size+c_meta_len;
+ return out;
}
if (order & X_STRIPE) {This may have gone unnoticed since the tests omit X_CAT.
Metadata
Metadata
Assignees
Labels
No labels