aboutsummaryrefslogtreecommitdiffstats
path: root/src/csn1.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/csn1.cpp')
-rw-r--r--src/csn1.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/csn1.cpp b/src/csn1.cpp
index 54cc411c..82bf17f4 100644
--- a/src/csn1.cpp
+++ b/src/csn1.cpp
@@ -2400,7 +2400,12 @@ gint16 csnStreamEncoder(csnStream_t* ar, const CSN_DESCR* pDescr, bitvec *vector
guint8 bits_to_handle = remaining_bits_len%8;
if (bits_to_handle > 0)
{
- guint8 fl = filler&(0xff>>(8-bits_to_handle));
+ /* section 11 of 44.060
+ * The padding bits may be the 'null' string. Otherwise, the
+ * padding bits starts with bit '0', followed by 'spare padding'
+ * < padding bits > ::= { null | 0 < spare padding > ! < Ignore : 1 bit** = < no string > > } ;
+ */
+ guint8 fl = filler&(0xff>>(8-bits_to_handle + 1));
bitvec_write_field(vector, writeIndex, fl, bits_to_handle);
LOGPC(DCSN1, LOGL_NOTICE, "%u|", fl);
remaining_bits_len -= bits_to_handle;