aboutsummaryrefslogtreecommitdiffstats
path: root/src/csn1.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/csn1.c')
-rw-r--r--src/csn1.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/csn1.c b/src/csn1.c
index 1b3cc55..78444bb 100644
--- a/src/csn1.c
+++ b/src/csn1.c
@@ -338,7 +338,7 @@ csnStreamDecoder(csnStream_t* ar, const CSN_DESCR* pDescr, struct bitvec *vector
nCount = *pui16DATA(data, nCount);
}
- if (remaining_bits_len >= no_of_bits)
+ if (remaining_bits_len >= (no_of_bits * nCount))
{
remaining_bits_len -= (no_of_bits*nCount);
if (no_of_bits <= 8)
@@ -781,7 +781,7 @@ csnStreamDecoder(csnStream_t* ar, const CSN_DESCR* pDescr, struct bitvec *vector
nCount = *pui16DATA(data, nCount);
}
- if (remaining_bits_len >= no_of_bits)
+ if (remaining_bits_len >= (no_of_bits * nCount))
{
remaining_bits_len -= (no_of_bits * nCount);
if (no_of_bits <= 8)
@@ -1650,7 +1650,7 @@ gint16 csnStreamEncoder(csnStream_t* ar, const CSN_DESCR* pDescr, struct bitvec
nCount = *pui16DATA(data, nCount);
}
- if (remaining_bits_len >= no_of_bits)
+ if (remaining_bits_len >= (no_of_bits * nCount))
{
if (no_of_bits <= 8)
{
@@ -2067,7 +2067,7 @@ gint16 csnStreamEncoder(csnStream_t* ar, const CSN_DESCR* pDescr, struct bitvec
nCount = *pui16DATA(data, nCount);
}
- if (remaining_bits_len >= no_of_bits)
+ if (remaining_bits_len >= (no_of_bits * nCount))
{
if (no_of_bits <= 8)
{