mirror of https://gerrit.osmocom.org/asn1c
per_support: Fix bit error in encoding process
Thanks to Dieter Spaar for finding and fixing this !
This commit is contained in:
parent
13e3e9a6bf
commit
821d89c20e
|
@ -336,7 +336,8 @@ per_put_few_bits(asn_per_outp_t *po, uint32_t bits, int obits) {
|
||||||
buf[3] = bits;
|
buf[3] = bits;
|
||||||
else {
|
else {
|
||||||
ASN_DEBUG("->[PER out split %d]", obits);
|
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);
|
per_put_few_bits(po, bits, obits - 24);
|
||||||
ASN_DEBUG("<-[PER out split %d]", obits);
|
ASN_DEBUG("<-[PER out split %d]", obits);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue