From 0316e66b92f7519648ea3f17fe8530fc27f5b84f Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Mon, 17 Mar 2014 20:17:05 +0100 Subject: add assert for figSize to protect memcpy --- src/DabMux.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/DabMux.cpp b/src/DabMux.cpp index 7b6530d..fd008a1 100644 --- a/src/DabMux.cpp +++ b/src/DabMux.cpp @@ -1626,6 +1626,7 @@ int main(int argc, char *argv[]) break; } + assert(figSize <= 30); memcpy(&etiFrame[index], Padding_FIB, 30 - figSize); index += 30 - figSize; @@ -1731,6 +1732,10 @@ int main(int argc, char *argv[]) etiFrame[index++] = ((char *) &CRCtmp)[1]; etiFrame[index++] = ((char *) &CRCtmp)[0]; + /* ETSI EN 300 799 Table 2: + * Only TM3 has a FIB count to CIF count that is + * not 3 to 1. + */ if (ensemble->mode == 3) { memcpy(&etiFrame[index], Padding_FIB, 30); index += 30; -- cgit v1.2.3