diff options
author | Sylvain Munaut <tnt@246tNt.com> | 2010-06-14 23:36:29 +0200 |
---|---|---|
committer | Pau Espin Pedrol <pespin@sysmocom.de> | 2021-10-22 16:16:13 +0200 |
commit | 709b9c0ede3948ba142076510547850ad221fae8 (patch) | |
tree | eb8bb2e37f0dd856b14a18e2bee8684867d6d473 | |
parent | e3781334ccf49d32f362420ff330bcf213ea56ab (diff) |
per_support: Fix bit error in encoding process
Thanks to Dieter Spaar for finding and fixing this !
-rw-r--r-- | skeletons/per_support.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/skeletons/per_support.c b/skeletons/per_support.c index e8299c73..173e696c 100644 --- a/skeletons/per_support.c +++ b/skeletons/per_support.c @@ -336,7 +336,8 @@ per_put_few_bits(asn_per_outp_t *po, uint32_t bits, int obits) { buf[3] = bits; else { ASN_DEBUG("->[PER out split %d]", obits); - per_put_few_bits(po, bits >> 8, 24); + po->nboff -= obits; /* undo incrementation from a few lines above */ + per_put_few_bits(po, bits >> (obits - 24), 24); /* shift according to the rest of the bits */ per_put_few_bits(po, bits, obits - 24); ASN_DEBUG("<-[PER out split %d]", obits); } |