wavpack-5.7.0-1.fc41

List of Defects

Error: CPPCHECK_WARNING: [#def1]
wavpack-5.7.0-build/wavpack-5.7.0/cli/aiff.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def2]
wavpack-5.7.0-build/wavpack-5.7.0/cli/aiff_write.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def3]
wavpack-5.7.0-build/wavpack-5.7.0/cli/caff.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def4]
wavpack-5.7.0-build/wavpack-5.7.0/cli/caff.c:183:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'channel_identities'
#  181|           if (!DoReadFile (infile, &caf_chunk_header, sizeof (CAFChunkHeader), &bcount) ||
#  182|               bcount != sizeof (CAFChunkHeader)) {
#  183|->                 error_line ("%s is not a valid .CAF file!", infilename);
#  184|                   return WAVPACK_SOFT_ERROR;
#  185|           }

Error: CLANG_WARNING: [#def5]
wavpack-5.7.0-build/wavpack-5.7.0/cli/caff.c:183:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'channel_reorder'
#  181|           if (!DoReadFile (infile, &caf_chunk_header, sizeof (CAFChunkHeader), &bcount) ||
#  182|               bcount != sizeof (CAFChunkHeader)) {
#  183|->                 error_line ("%s is not a valid .CAF file!", infilename);
#  184|                   return WAVPACK_SOFT_ERROR;
#  185|           }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def6]
wavpack-5.7.0-build/wavpack-5.7.0/cli/caff.c: scope_hint: In function ‘ParseCaffHeaderConfig’
wavpack-5.7.0-build/wavpack-5.7.0/cli/caff.c:338:25: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘channel_reorder’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memset’ must be non-null
#  336|   
#  337|                           channel_reorder = malloc (num_descriptions);
#  338|->                         memset (channel_reorder, -1, num_descriptions);
#  339|                           channel_identities = malloc (num_descriptions+1);
#  340|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def7]
wavpack-5.7.0-build/wavpack-5.7.0/cli/caff.c:367:67: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘channel_identities’
#  365|   
#  366|                                   if (clabel == 0 || clabel == 0xffffffff || clabel == 100)
#  367|->                                     channel_identities [idents++] = 0xff;
#  368|                                   else if ((clabel >= 33 && clabel <= 44) || (clabel >= 200 && clabel <= 207) || (clabel >= 301 && clabel <= 305))
#  369|                                       channel_identities [idents++] = clabel >= 301 ? clabel - 80 : clabel;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def8]
wavpack-5.7.0-build/wavpack-5.7.0/cli/caff.c:369:67: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘channel_identities’
#  367|                                       channel_identities [idents++] = 0xff;
#  368|                                   else if ((clabel >= 33 && clabel <= 44) || (clabel >= 200 && clabel <= 207) || (clabel >= 301 && clabel <= 305))
#  369|->                                     channel_identities [idents++] = clabel >= 301 ? clabel - 80 : clabel;
#  370|                                   else {
#  371|                                       error_line ("warning: unknown channel descriptions label: %d", clabel);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def9]
wavpack-5.7.0-build/wavpack-5.7.0/cli/caff.c:372:67: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘channel_identities’
#  370|                                   else {
#  371|                                       error_line ("warning: unknown channel descriptions label: %d", clabel);
#  372|->                                     channel_identities [idents++] = 0xff;
#  373|                                   }
#  374|   

Error: CPPCHECK_WARNING: [#def10]
wavpack-5.7.0-build/wavpack-5.7.0/cli/caff_write.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def11]
wavpack-5.7.0-build/wavpack-5.7.0/cli/dsdiff.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def12]
wavpack-5.7.0-build/wavpack-5.7.0/cli/dsdiff_write.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def13]
wavpack-5.7.0-build/wavpack-5.7.0/cli/dsf.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def14]
wavpack-5.7.0-build/wavpack-5.7.0/cli/dsf_write.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def15]
wavpack-5.7.0-build/wavpack-5.7.0/cli/import_id3.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-131): [#def16]
wavpack-5.7.0-build/wavpack-5.7.0/cli/import_id3.c: scope_hint: In function ‘ID3v2StringsToUTF8’
wavpack-5.7.0-build/wavpack-5.7.0/cli/import_id3.c:556:23: warning[-Wanalyzer-allocation-size]: allocated buffer size is not a multiple of the pointee's size
#  554|               return -1;
#  555|   
#  556|->         wide_string = malloc (src_length + 2);
#  557|   
#  558|           while (fp <= fe - 2 && (!num_segments || fp [0] || fp [1])) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def17]
wavpack-5.7.0-build/wavpack-5.7.0/cli/import_id3.c:566:62: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘wide_string’
#  564|                   fp += 2;
#  565|   
#  566|->                 if ((wchar != 0xFEFF) && !(wide_string [i++] = wchar))
#  567|                       break;
#  568|               }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def18]
wavpack-5.7.0-build/wavpack-5.7.0/cli/import_id3.c:571:33: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘wide_string’
#  569|   
#  570|               if (fp > fe - 2)
#  571|->                 wide_string [i] = 0;
#  572|   
#  573|               WideCharToUTF8 (wide_string, dst, (int)(dst_end - dst));

Error: CLANG_WARNING: [#def19]
wavpack-5.7.0-build/wavpack-5.7.0/cli/import_id3.c:598:12: warning[core.uninitialized.Branch]: Branch condition evaluates to a garbage value
#  596|       int outndx = 0;
#  597|   
#  598|->     while (*pWide) {
#  599|           if (*pWide < 0x80 && outndx + 1 < len)
#  600|               pUTF8 [outndx++] = (unsigned char) *pWide++;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def20]
wavpack-5.7.0-build/wavpack-5.7.0/cli/import_id3.c: scope_hint: In function ‘Latin1ToUTF8’
wavpack-5.7.0-build/wavpack-5.7.0/cli/import_id3.c:652:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘temp’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memset’ must be non-null
#  650|       iconv_t converter;
#  651|   
#  652|->     memset(temp, 0, len);
#  653|   
#  654|       insize = strlen (string);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def21]
wavpack-5.7.0-build/wavpack-5.7.0/cli/import_id3.c:657:8: warning[-Wanalyzer-malloc-leak]: leak of ‘iconv_open("UTF-8", "ISO-8859-1")’
#  655|       converter = iconv_open ("UTF-8", "ISO-8859-1");
#  656|   
#  657|->     if (converter != (iconv_t) -1) {
#  658|           err = iconv (converter, &inp, &insize, &outp, &outsize);
#  659|           iconv_close (converter);

Error: CPPCHECK_WARNING: [#def22]
wavpack-5.7.0-build/wavpack-5.7.0/cli/riff.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def23]
wavpack-5.7.0-build/wavpack-5.7.0/cli/riff_write.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def24]
wavpack-5.7.0-build/wavpack-5.7.0/cli/utils.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def25]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wave64.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def26]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wavpack.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING (CWE-401): [#def27]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wavpack.c:390: error[memleakOnRealloc]: Common realloc mistake: 'argv_fn' nulled but not freed upon failure
#  388|                   char *option = malloc (option_len + 1);
#  389|   
#  390|->                 argv_fn = realloc (argv_fn, sizeof (char *) * ++argc_fn);
#  391|                   memcpy (option, open_brace + 1, option_len);
#  392|                   argv_fn [argc_fn - 1] = option;

Error: CLANG_WARNING: [#def28]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wavpack.c:435:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'matches'
#  433|   
#  434|               if (!strcmp (long_option, "help")) {                        // --help
#  435|->                 printf ("%s", help);
#  436|                   return 0;
#  437|               }

Error: CPPCHECK_WARNING (CWE-401): [#def29]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wavpack.c:881: error[memleakOnRealloc]: Common realloc mistake: 'tag_items' nulled but not freed upon failure
#  879|                   int i = num_tag_items;
#  880|   
#  881|->                 tag_items = realloc (tag_items, ++num_tag_items * sizeof (*tag_items));
#  882|                   tag_items [i].item = malloc (cp - argcp + 1);
#  883|                   memcpy (tag_items [i].item, argcp, cp - argcp);

Error: CPPCHECK_WARNING (CWE-401): [#def30]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wavpack.c:936: error[memleakOnRealloc]: Common realloc mistake: 'matches' nulled but not freed upon failure
#  934|           }
#  935|           else {
#  936|->             matches = realloc (matches, (num_files + 1) * sizeof (*matches));
#  937|               matches [num_files] = malloc (strlen (argcp) + 10);
#  938|               strcpy (matches [num_files], argcp);

Error: CLANG_WARNING: [#def31]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wavpack.c:1056:54: warning[core.NullDereference]: Array access (from variable 'matches') results in a null pointer dereference
# 1054|               // user may have specified on the command line
# 1055|   
# 1056|->             if (!file && num_files && filespec_name (matches [0]) && *matches [0] != '-') {
# 1057|                   char *temp = malloc (strlen (matches [0]) + PATH_MAX);
# 1058|   

Error: CLANG_WARNING: [#def32]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wavpack.c:1166:28: warning[core.NullDereference]: Array access (from variable 'matches') results in a null pointer dereference
# 1164|   
# 1165|       for (file_index = 0; file_index < num_files; ++file_index) {
# 1166|->         char *infilename = matches [file_index];
# 1167|   
# 1168|           // If the single infile specification begins with a '@', then it

Error: CPPCHECK_WARNING (CWE-401): [#def33]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wavpack.c:1193: error[memleakOnRealloc]: Common realloc mistake: 'listbuff' nulled but not freed upon failure
# 1191|                   int bytes_read;
# 1192|   
# 1193|->                 listbuff = realloc (listbuff, listbytes + 1024);
# 1194|                   memset (listbuff + listbytes, 0, 1024);
# 1195|                   listbytes += bytes_read = (int) fread (listbuff + listbytes, 1, 1024, list);

Error: CPPCHECK_WARNING (CWE-401): [#def34]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wavpack.c:1221: error[memleakOnRealloc]: Common realloc mistake: 'matches' nulled but not freed upon failure
# 1219|   
# 1220|                       fname [ci++] = '\0';
# 1221|->                     matches = realloc (matches, ++num_files * sizeof (*matches));
# 1222|   
# 1223|                       for (di = num_files - 1; di > file_index + 1; di--)

Error: CLANG_WARNING: [#def35]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wavpack.c:1294:9: warning[deadcode.DeadStores]: Value stored to 'c' is never read
# 1292|   
# 1293|           memset (listbuff, 0, sizeof (listbuff));
# 1294|->         c = (int) fread (listbuff, 1, sizeof (listbuff) - 1, list);   // assign c only to suppress warning
# 1295|   
# 1296|   #if defined (_WIN32)

Error: CPPCHECK_WARNING (CWE-401): [#def36]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wavpack.c:2123: error[memleakOnRealloc]: Common realloc mistake: 'buffer' nulled but not freed upon failure
# 2121|           while (DoReadFile (infile, buffer + wrapper_size, buffer_size - wrapper_size, &bcount) && bcount)
# 2122|               if ((wrapper_size += bcount) == buffer_size)
# 2123|->                 buffer = realloc (buffer, buffer_size += 65536);
# 2124|   
# 2125|           // if we got something and are storing wrapper, write it to the outfile file

Error: CLANG_WARNING: [#def37]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wavpack.c:3629:13: warning[unix.Malloc]: Potential leak of memory pointed to by 'format_buffer'
# 3627|   
# 3628|           if (!WavpackPackSamples (outfile, sample_buffer, sample_count)) {
# 3629|->             error_line ("%s", WavpackGetErrorMessage (outfile));
# 3630|               free (sample_buffer);
# 3631|               return WAVPACK_HARD_ERROR;

Error: CLANG_WARNING: [#def38]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wavpack.c:3668:71: warning[core.DivideZero]: Division by zero
# 3666|                       }
# 3667|   
# 3668|->                     sample_count = (uint32_t) ((dptr - format_buffer) / num_channels);
# 3669|                   }
# 3670|                   else {

Error: CLANG_WARNING: [#def39]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wavpack.c:3687:13: warning[unix.Malloc]: Potential leak of memory pointed to by 'dptr'
# 3685|               fprintf (stderr, "^C\n");
# 3686|   #else
# 3687|->             fprintf (stderr, "\n");
# 3688|   #endif
# 3689|               fflush (stderr);

Error: CPPCHECK_WARNING (CWE-457): [#def40]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wavpack.c:3748: error[uninitvar]: Uninitialized variable: temp
# 3746|           }
# 3747|   
# 3748|->         memcpy (start, temp, num_chans * bytes_per_sample);
# 3749|       }
# 3750|   

Error: CLANG_WARNING: [#def41]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wavpack.c:3947:17: warning[core.CallAndMessage]: 3rd function call argument is an uninitialized value
# 3945|   
# 3946|               for (i = 0; i < 16; ++i) {
# 3947|->                 sprintf (md5_string1 + (i * 2), "%02x", md5_digest_source [i]);
# 3948|                   sprintf (md5_string2 + (i * 2), "%02x", md5_digest_result [i]);
# 3949|               }

Error: CLANG_WARNING: [#def42]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wavpack.c:4515:13: warning[unix.Malloc]: Potential leak of memory pointed to by 'outp'
# 4513|       if (len > 3 && (unsigned char) inp [0] == 0xEF && (unsigned char) inp [1] == 0xBB &&
# 4514|           (unsigned char) inp [2] == 0xBF) {
# 4515|->             memmove (inp, inp + 3, len - 3);
# 4516|               inp [len - 3] = 0;
# 4517|               return;

Error: CPPCHECK_WARNING: [#def43]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvgain.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def44]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvgain.c:180:25: warning[unix.Malloc]: Potential leak of memory pointed to by 'matches'
#  178|   
#  179|                       case 'V': case 'v':
#  180|->                         printf ("wvgain %s\n", PACKAGE_VERSION);
#  181|                           printf ("libwavpack %s\n", WavpackGetLibraryVersionString ());
#  182|                           return 0;

Error: CPPCHECK_WARNING (CWE-401): [#def45]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvgain.c:239: error[memleakOnRealloc]: Common realloc mistake: 'matches' nulled but not freed upon failure
#  237|                   }
#  238|           else {
#  239|->             matches = realloc (matches, (num_files + 1) * sizeof (*matches));
#  240|               matches [num_files] = malloc (strlen (*argv) + 10);
#  241|               strcpy (matches [num_files], *argv);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def46]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvgain.c: scope_hint: In function ‘main’
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvgain.c:240:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘matches’
#  238|           else {
#  239|               matches = realloc (matches, (num_files + 1) * sizeof (*matches));
#  240|->             matches [num_files] = malloc (strlen (*argv) + 10);
#  241|               strcpy (matches [num_files], *argv);
#  242|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def47]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvgain.c:241:13: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘malloc(strlen(*argv) + 10)’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_strcpy’ must be non-null
#  239|               matches = realloc (matches, (num_files + 1) * sizeof (*matches));
#  240|               matches [num_files] = malloc (strlen (*argv) + 10);
#  241|->             strcpy (matches [num_files], *argv);
#  242|   
#  243|               if (*(matches [num_files]) != '-' && *(matches [num_files]) != '@' &&

Error: CLANG_WARNING: [#def48]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvgain.c:282:28: warning[core.NullDereference]: Array access (from variable 'matches') results in a null pointer dereference
#  280|   
#  281|       for (file_index = 0; file_index < num_files; ++file_index) {
#  282|->         char *infilename = matches [file_index];
#  283|   
#  284|           // If the single infile specification begins with a '@', then it

Error: GCC_ANALYZER_WARNING (CWE-126): [#def49]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvgain.c:295:40: warning[-Wanalyzer-out-of-bounds]: heap-based buffer over-read
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvgain.c:295:40: note: read of 8 bytes from after the end of the region
#                                      └──────────────────────────────────┘
#                                                       ^
#  293|   
#  294|               for (di = file_index; di < num_files - 1; di++)
#  295|->                 matches [di] = matches [di + 1];
#  296|   
#  297|               file_index--;

Error: CPPCHECK_WARNING (CWE-401): [#def50]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvgain.c:309: error[memleakOnRealloc]: Common realloc mistake: 'listbuff' nulled but not freed upon failure
#  307|                   int bytes_read;
#  308|   
#  309|->                 listbuff = realloc (listbuff, listbytes + 1024);
#  310|                   memset (listbuff + listbytes, 0, 1024);
#  311|                   listbytes += bytes_read = (int) fread (listbuff + listbytes, 1, 1024, list);

Error: GCC_ANALYZER_WARNING (CWE-415): [#def51]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvgain.c:309:28: warning[-Wanalyzer-double-free]: double-‘free’ of ‘listbuff’
#  307|                   int bytes_read;
#  308|   
#  309|->                 listbuff = realloc (listbuff, listbytes + 1024);
#  310|                   memset (listbuff + listbytes, 0, 1024);
#  311|                   listbytes += bytes_read = (int) fread (listbuff + listbytes, 1, 1024, list);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def52]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvgain.c:310:17: warning[-Wanalyzer-null-argument]: use of NULL ‘listbuff’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memset’ must be non-null
#  308|   
#  309|                   listbuff = realloc (listbuff, listbytes + 1024);
#  310|->                 memset (listbuff + listbytes, 0, 1024);
#  311|                   listbytes += bytes_read = (int) fread (listbuff + listbytes, 1, 1024, list);
#  312|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def53]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvgain.c:313:20: warning[-Wanalyzer-malloc-leak]: leak of ‘listbuff’
#  311|                   listbytes += bytes_read = (int) fread (listbuff + listbytes, 1, 1024, list);
#  312|   
#  313|->                 if (bytes_read < 1024)
#  314|                       break;
#  315|               }

Error: GCC_ANALYZER_WARNING (CWE-416): [#def54]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvgain.c:323:25: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘cp’
#  321|               cp = listbuff;
#  322|   
#  323|->             while ((c = *cp++)) {
#  324|   
#  325|                   while (c == '\n' || c == '\r')

Error: GCC_ANALYZER_WARNING (CWE-476): [#def55]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvgain.c:333:38: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘fname’
#  331|   
#  332|                       do
#  333|->                         fname [ci++] = c;
#  334|                       while ((c = *cp++) != '\n' && c != '\r' && c && ci < PATH_MAX);
#  335|   

Error: CPPCHECK_WARNING (CWE-401): [#def56]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvgain.c:337: error[memleakOnRealloc]: Common realloc mistake: 'matches' nulled but not freed upon failure
#  335|   
#  336|                       fname [ci++] = '\0';
#  337|->                     matches = realloc (matches, ++num_files * sizeof (*matches));
#  338|   
#  339|                       for (di = num_files - 1; di > file_index + 1; di--)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def57]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvgain.c:342:44: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘matches’
#  340|                           matches [di] = matches [di - 1];
#  341|   
#  342|->                     matches [++file_index] = fname;
#  343|                   }
#  344|   

Error: CLANG_WARNING: [#def58]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvgain.c:501:49: warning[core.NullDereference]: Array access (from variable 'matches') results in a null pointer dereference
#  499|   
#  500|                   if (num_files > 1 && !quiet_mode) {
#  501|->                     fprintf (stderr, "\n%s:\n", matches [file_index]);
#  502|                       fflush (stderr);
#  503|                   }

Error: CLANG_WARNING: [#def59]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvgain.c:506:46: warning[core.NullDereference]: Array access (from variable 'matches') results in a null pointer dereference
#  504|   
#  505|                   if (show_mode)
#  506|->                     result = show_file_info (matches [file_index], stdout);
#  507|                   else
#  508|                       result = update_file (matches [file_index], track_gains [file_index], track_peaks [file_index], album_gain, album_peak);

Error: CLANG_WARNING: [#def60]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvgain.c:508:43: warning[core.NullDereference]: Array access (from variable 'matches') results in a null pointer dereference
#  506|                       result = show_file_info (matches [file_index], stdout);
#  507|                   else
#  508|->                     result = update_file (matches [file_index], track_gains [file_index], track_peaks [file_index], album_gain, album_peak);
#  509|   
#  510|                   free (matches [file_index]);

Error: CPPCHECK_WARNING: [#def61]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvtag.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def62]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvtag.c:288:25: warning[unix.Malloc]: Potential leak of memory pointed to by 'matches'
#  286|   
#  287|                       case 'V': case 'v':
#  288|->                         printf ("wvtag %s\n", PACKAGE_VERSION);
#  289|                           printf ("libwavpack %s\n", WavpackGetLibraryVersionString ());
#  290|                           return 0;

Error: CPPCHECK_WARNING (CWE-401): [#def63]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvtag.c:333: error[memleakOnRealloc]: Common realloc mistake: 'tag_items' nulled but not freed upon failure
#  331|                   int i = num_tag_items;
#  332|   
#  333|->                 tag_items = realloc (tag_items, ++num_tag_items * sizeof (*tag_items));
#  334|                   tag_items [i].item = malloc (cp - *argv + 1);
#  335|                   memcpy (tag_items [i].item, *argv, cp - *argv);

Error: CPPCHECK_WARNING (CWE-401): [#def64]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvtag.c:358: error[memleakOnRealloc]: Common realloc mistake: 'tag_items' nulled but not freed upon failure
#  356|               }
#  357|   
#  358|->             tag_items = realloc (tag_items, ++num_tag_items * sizeof (*tag_items));
#  359|               tag_items [i].item = strdup (*argv);
#  360|               tag_items [i].binary = 0;

Error: CPPCHECK_WARNING (CWE-401): [#def65]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvtag.c:366: error[memleakOnRealloc]: Common realloc mistake: 'matches' nulled but not freed upon failure
#  364|           }
#  365|           else {
#  366|->             matches = realloc (matches, (num_files + 1) * sizeof (*matches));
#  367|               matches [num_files] = malloc (strlen (*argv) + 10);
#  368|               strcpy (matches [num_files], *argv);

Error: CLANG_WARNING: [#def66]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvtag.c:509:14: warning[deadcode.DeadStores]: Although the value stored to 'total_tag_size' is used in the enclosing expression, the value is never actually read from 'total_tag_size'
#  507|           }
#  508|   
#  509|->         if ((total_tag_size += tag_items [i].vsize) > 1048576 * (allow_huge_tags ? 16 : 1)) {
#  510|               error_line ("total APEv2 tag size exceeds %d MB !", allow_huge_tags ? 16 : 1);
#  511|               ++error_count;

Error: CPPCHECK_WARNING (CWE-401): [#def67]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvtag.c:552: error[memleakOnRealloc]: Common realloc mistake: 'listbuff' nulled but not freed upon failure
#  550|                   int bytes_read;
#  551|   
#  552|->                 listbuff = realloc (listbuff, listbytes + 1024);
#  553|                   memset (listbuff + listbytes, 0, 1024);
#  554|                   listbytes += bytes_read = (int) fread (listbuff + listbytes, 1, 1024, list);

Error: CPPCHECK_WARNING (CWE-401): [#def68]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvtag.c:580: error[memleakOnRealloc]: Common realloc mistake: 'matches' nulled but not freed upon failure
#  578|   
#  579|                       fname [ci++] = '\0';
#  580|->                     matches = realloc (matches, ++num_files * sizeof (*matches));
#  581|   
#  582|                       for (di = num_files - 1; di > file_index + 1; di--)

Error: CPPCHECK_WARNING (CWE-401): [#def69]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvtag.c:903: error[memleakOnRealloc]: Common realloc mistake: 'tag_extractions' nulled but not freed upon failure
#  901|   static void add_tag_extraction_to_list (char *spec)
#  902|   {
#  903|->     tag_extractions = realloc (tag_extractions, (num_tag_extractions + 1) * sizeof (*tag_extractions));
#  904|       tag_extractions [num_tag_extractions] = malloc (strlen (spec) + 10);
#  905|       strcpy (tag_extractions [num_tag_extractions], spec);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def70]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvtag.c: scope_hint: In function ‘add_tag_extraction_to_list’
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvtag.c:905:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘malloc(strlen(spec) + 10)’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_strcpy’ must be non-null
#  903|       tag_extractions = realloc (tag_extractions, (num_tag_extractions + 1) * sizeof (*tag_extractions));
#  904|       tag_extractions [num_tag_extractions] = malloc (strlen (spec) + 10);
#  905|->     strcpy (tag_extractions [num_tag_extractions], spec);
#  906|       num_tag_extractions++;
#  907|   }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def71]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvtag.c: scope_hint: In function ‘do_tag_extractions’
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvtag.c:916:29: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘extraction_spec’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_strchr’ must be non-null
#  914|       for (i = 0; result == WAVPACK_NO_ERROR && i < num_tag_extractions; ++i) {
#  915|           char *extraction_spec = strdup (tag_extractions [i]);
#  916|->         char *output_spec = strchr (extraction_spec, '=');
#  917|           char tag_filename [256];
#  918|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def72]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvtag.c:919:61: warning[-Wanalyzer-null-argument]: use of NULL ‘output_spec’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null
#  917|           char tag_filename [256];
#  918|   
#  919|->         if (output_spec && output_spec > extraction_spec && strlen (output_spec) > 1)
#  920|               *output_spec++ = 0;
#  921|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def73]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvtag.c:923:65: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘tag_filename[0]’
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvtag.c:30: included_from: Included from here.
/usr/include/string.h:407:15: note: argument 1 of ‘strlen’ must be a pointer to a null-terminated string
#  921|   
#  922|           if (dump_tag_item_to_file (wpc, extraction_spec, NULL, tag_filename)) {
#  923|->             int max_length = (int) strlen (outfilename) + (int) strlen (tag_filename) + 10;
#  924|               char *full_filename;
#  925|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def74]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvtag.c:930:13: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘full_filename’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_strcpy’ must be non-null
#  928|   
#  929|               full_filename = malloc (max_length * 2 + 1);
#  930|->             strcpy (full_filename, outfilename);
#  931|   
#  932|               if (output_spec) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def75]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvtag.c: scope_hint: In function ‘dump_UTF8_string’
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvtag.c:1312:22: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘p’
# 1310|           while (*string) {
# 1311|               if (*string != '\r')
# 1312|->                 *p++ = *string;
# 1313|   
# 1314|               if (*string++ == '\n')

Error: GCC_ANALYZER_WARNING (CWE-476): [#def76]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvtag.c:1318:12: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘p’
# 1316|           }
# 1317|   
# 1318|->         *p = 0;
# 1319|   
# 1320|   #ifdef _WIN32

Error: GCC_ANALYZER_WARNING (CWE-688): [#def77]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvtag.c: scope_hint: In function ‘UTF8ToAnsi’
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvtag.c:1370:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘temp’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memset’ must be non-null
# 1368|       iconv_t converter;
# 1369|   
# 1370|->     memset(temp, 0, len);
# 1371|       old_locale = setlocale (LC_CTYPE, "");
# 1372|       converter = iconv_open ("", "UTF-8");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def78]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvtag.c:1374:8: warning[-Wanalyzer-malloc-leak]: leak of ‘iconv_open("", "UTF-8")’
# 1372|       converter = iconv_open ("", "UTF-8");
# 1373|   
# 1374|->     if (converter != (iconv_t) -1) {
# 1375|           err = iconv (converter, &inp, &insize, &outp, &outsize);
# 1376|           iconv_close (converter);

Error: CLANG_WARNING: [#def79]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvtag.c:1521:13: warning[unix.Malloc]: Potential leak of memory pointed to by 'outp'
# 1519|       if (len > 3 && (unsigned char) inp [0] == 0xEF && (unsigned char) inp [1] == 0xBB &&
# 1520|           (unsigned char) inp [2] == 0xBF) {
# 1521|->             memmove (inp, inp + 3, len - 3);
# 1522|               inp [len - 3] = 0;
# 1523|               return;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def80]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvtag.c:1523:13: warning[-Wanalyzer-malloc-leak]: leak of ‘converter’
# 1521|               memmove (inp, inp + 3, len - 3);
# 1522|               inp [len - 3] = 0;
# 1523|->             return;
# 1524|       }
# 1525|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def81]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvtag.c: scope_hint: In function ‘TextToUTF8’
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvtag.c:1523:13: warning[-Wanalyzer-malloc-leak]: leak of ‘temp’
# 1521|               memmove (inp, inp + 3, len - 3);
# 1522|               inp [len - 3] = 0;
# 1523|->             return;
# 1524|       }
# 1525|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def82]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvtag.c:1526:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘temp’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memset’ must be non-null
# 1524|       }
# 1525|   
# 1526|->     memset(temp, 0, len);
# 1527|       old_locale = setlocale (LC_CTYPE, "");
# 1528|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def83]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvtag.c: scope_hint: In function ‘wild_fopen’
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvtag.c:1638:13: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘matchname’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_strcpy’ must be non-null
# 1636|           else {
# 1637|               matchname = malloc (strlen (globbuf.gl_pathv [i]) + 10);
# 1638|->             strcpy (matchname, globbuf.gl_pathv [i]);
# 1639|           }
# 1640|       }

Error: CPPCHECK_WARNING: [#def84]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvunpack.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING (CWE-401): [#def85]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvunpack.c:312: error[memleakOnRealloc]: Common realloc mistake: 'argv_fn' nulled but not freed upon failure
#  310|                   char *option = malloc (option_len + 1);
#  311|   
#  312|->                 argv_fn = realloc (argv_fn, sizeof (char *) * ++argc_fn);
#  313|                   memcpy (option, open_brace + 1, option_len);
#  314|                   argv_fn [argc_fn - 1] = option;

Error: CLANG_WARNING: [#def86]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvunpack.c:355:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'argv_fn'
#  353|   
#  354|               if (!strcmp (long_option, "help")) {                        // --help
#  355|->                 printf ("%s", help);
#  356|                   return 0;
#  357|               }

Error: CLANG_WARNING: [#def87]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvunpack.c:355:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'matches'
#  353|   
#  354|               if (!strcmp (long_option, "help")) {                        // --help
#  355|->                 printf ("%s", help);
#  356|                   return 0;
#  357|               }

Error: CPPCHECK_WARNING (CWE-401): [#def88]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvunpack.c:613: error[memleakOnRealloc]: Common realloc mistake: 'matches' nulled but not freed upon failure
#  611|               }
#  612|               else {
#  613|->                 matches = realloc (matches, (num_files + 1) * sizeof (*matches));
#  614|                   matches [num_files] = malloc (strlen (argcp) + 10);
#  615|                   strcpy (matches [num_files], argcp);

Error: CLANG_WARNING: [#def89]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvunpack.c:717:28: warning[core.NullDereference]: Array access (from variable 'matches') results in a null pointer dereference
#  715|   
#  716|       for (file_index = 0; file_index < num_files; ++file_index) {
#  717|->         char *infilename = matches [file_index];
#  718|   
#  719|           // If the single infile specification begins with a '@', then it

Error: CLANG_WARNING: [#def90]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvunpack.c:736:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'matches'
#  734|   
#  735|               if (list == NULL) {
#  736|->                 error_line ("file %s not found!", infilename+1);
#  737|                   free (infilename);
#  738|                   return 1;

Error: CPPCHECK_WARNING (CWE-401): [#def91]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvunpack.c:744: error[memleakOnRealloc]: Common realloc mistake: 'listbuff' nulled but not freed upon failure
#  742|                   int bytes_read;
#  743|   
#  744|->                 listbuff = realloc (listbuff, listbytes + 1024);
#  745|                   memset (listbuff + listbytes, 0, 1024);
#  746|                   listbytes += bytes_read = (int) fread (listbuff + listbytes, 1, 1024, list);

Error: CPPCHECK_WARNING (CWE-401): [#def92]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvunpack.c:772: error[memleakOnRealloc]: Common realloc mistake: 'matches' nulled but not freed upon failure
#  770|   
#  771|                       fname [ci++] = '\0';
#  772|->                     matches = realloc (matches, ++num_files * sizeof (*matches));
#  773|   
#  774|                       for (di = num_files - 1; di > file_index + 1; di--)

Error: CLANG_WARNING: [#def93]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvunpack.c:845:9: warning[deadcode.DeadStores]: Value stored to 'c' is never read
#  843|   
#  844|           memset (listbuff, 0, sizeof (listbuff));
#  845|->         c = (int) fread (listbuff, 1, sizeof (listbuff) - 1, list);   // assign c only to suppress warning
#  846|   
#  847|   #if defined (_WIN32)

Error: CLANG_WARNING: [#def94]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvunpack.c:1905:13: warning[core.CallAndMessage]: 3rd function call argument is an uninitialized value
# 1903|   
# 1904|           for (i = 0; i < 16; ++i)
# 1905|->             sprintf (md5_string2 + (i * 2), "%02x", md5_unpacked [i]);
# 1906|   
# 1907|           error_line ("unpacked md5:  %s", md5_string2);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def95]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvunpack.c: scope_hint: In function ‘unpack_audio’
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvunpack.c:2133:39: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘new_channel_order’
# 2131|   
# 2132|               for (i = 0; i < num_channels; ++i)
# 2133|->                 new_channel_order [i] = i;
# 2134|   
# 2135|               WavpackGetChannelLayout (wpc, new_channel_order);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def96]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvunpack.c: scope_hint: In function ‘unpack_dsd_audio’
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvunpack.c:2283:39: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘new_channel_order’
# 2281|   
# 2282|               for (i = 0; i < num_channels; ++i)
# 2283|->                 new_channel_order [i] = i;
# 2284|   
# 2285|               WavpackGetChannelLayout (wpc, new_channel_order);

Error: CPPCHECK_WARNING (CWE-401): [#def97]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvunpack.c:2400: error[memleakOnRealloc]: Common realloc mistake: 'tag_extractions' nulled but not freed upon failure
# 2398|   static void add_tag_extraction_to_list (char *spec)
# 2399|   {
# 2400|->     tag_extractions = realloc (tag_extractions, (num_tag_extractions + 1) * sizeof (*tag_extractions));
# 2401|       tag_extractions [num_tag_extractions] = malloc (strlen (spec) + 10);
# 2402|       strcpy (tag_extractions [num_tag_extractions], spec);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def98]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvunpack.c: scope_hint: In function ‘add_tag_extraction_to_list’
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvunpack.c:2402:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘malloc(strlen(spec) + 10)’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_strcpy’ must be non-null
# 2400|       tag_extractions = realloc (tag_extractions, (num_tag_extractions + 1) * sizeof (*tag_extractions));
# 2401|       tag_extractions [num_tag_extractions] = malloc (strlen (spec) + 10);
# 2402|->     strcpy (tag_extractions [num_tag_extractions], spec);
# 2403|       num_tag_extractions++;
# 2404|   }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def99]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvunpack.c: scope_hint: In function ‘do_tag_extractions’
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvunpack.c:2413:29: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘extraction_spec’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_strchr’ must be non-null
# 2411|       for (i = 0; result == WAVPACK_NO_ERROR && i < num_tag_extractions; ++i) {
# 2412|           char *extraction_spec = strdup (tag_extractions [i]);
# 2413|->         char *output_spec = strchr (extraction_spec, '=');
# 2414|           char tag_filename [256];
# 2415|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def100]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvunpack.c:2416:61: warning[-Wanalyzer-null-argument]: use of NULL ‘output_spec’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null
# 2414|           char tag_filename [256];
# 2415|   
# 2416|->         if (output_spec && output_spec > extraction_spec && strlen (output_spec) > 1)
# 2417|               *output_spec++ = 0;
# 2418|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def101]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvunpack.c:2420:65: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘tag_filename[0]’
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvunpack.c:41: included_from: Included from here.
/usr/include/string.h:407:15: note: argument 1 of ‘strlen’ must be a pointer to a null-terminated string
# 2418|   
# 2419|           if (dump_tag_item_to_file (wpc, extraction_spec, NULL, tag_filename)) {
# 2420|->             int max_length = (int) strlen (outfilename) + (int) strlen (tag_filename) + 10;
# 2421|               char *full_filename;
# 2422|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def102]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvunpack.c:2427:13: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘full_filename’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_strcpy’ must be non-null
# 2425|   
# 2426|               full_filename = malloc (max_length * 2 + 1);
# 2427|->             strcpy (full_filename, outfilename);
# 2428|   
# 2429|               if (output_spec) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def103]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvunpack.c: scope_hint: In function ‘unreorder_channels’
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvunpack.c:2738:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘temp’
# 2736|   
# 2737|           for (chan = 0; chan < num_chans; ++chan)
# 2738|->             temp [chan] = data [order[chan]];
# 2739|   
# 2740|           memcpy (data, temp, num_chans * sizeof (*data));

Error: GCC_ANALYZER_WARNING (CWE-457): [#def104]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvunpack.c:2740:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘temp’
# 2738|               temp [chan] = data [order[chan]];
# 2739|   
# 2740|->         memcpy (data, temp, num_chans * sizeof (*data));
# 2741|           data += num_chans;
# 2742|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def105]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvunpack.c: scope_hint: In function ‘dump_UTF8_string’
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvunpack.c:3237:22: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘p’
# 3235|           while (*string) {
# 3236|               if (*string != '\r')
# 3237|->                 *p++ = *string;
# 3238|   
# 3239|               if (*string++ == '\n')

Error: GCC_ANALYZER_WARNING (CWE-476): [#def106]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvunpack.c:3243:12: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘p’
# 3241|           }
# 3242|   
# 3243|->         *p = 0;
# 3244|   
# 3245|   #ifdef _WIN32

Error: GCC_ANALYZER_WARNING (CWE-688): [#def107]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvunpack.c: scope_hint: In function ‘UTF8ToAnsi’
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvunpack.c:3404:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘temp’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memset’ must be non-null
# 3402|       iconv_t converter;
# 3403|   
# 3404|->     memset(temp, 0, len);
# 3405|       old_locale = setlocale (LC_CTYPE, "");
# 3406|       converter = iconv_open ("", "UTF-8");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def108]
wavpack-5.7.0-build/wavpack-5.7.0/cli/wvunpack.c:3408:8: warning[-Wanalyzer-malloc-leak]: leak of ‘iconv_open("", "UTF-8")’
# 3406|       converter = iconv_open ("", "UTF-8");
# 3407|   
# 3408|->     if (converter != (iconv_t) -1) {
# 3409|           err = iconv (converter, &inp, &insize, &outp, &outsize);
# 3410|           iconv_close (converter);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def109]
wavpack-5.7.0-build/wavpack-5.7.0/src/wavpack_local.h:14: included_from: Included from here.
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_utils.c: scope_hint: In function 'write_metadata_block'
wavpack-5.7.0-build/wavpack-5.7.0/include/wavpack.h:100:29: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'block_buff'
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_utils.c:1512:9: note: in expansion of macro 'SET_TOTAL_SAMPLES'
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_utils.c:1512:9: note: in expansion of macro 'SET_TOTAL_SAMPLES'
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_utils.c:1512:9: note: in expansion of macro 'SET_TOTAL_SAMPLES'
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_utils.c:1512:9: note: in expansion of macro 'SET_TOTAL_SAMPLES'
#   98|       int64_t tmp = (value);                      \
#   99|       if (tmp < 0)                                \
#  100|->         (hdr).total_samples = (uint32_t) -1;    \
#  101|       else {                                      \
#  102|           tmp += (tmp / 0xffffffffLL);            \

Error: GCC_ANALYZER_WARNING (CWE-476): [#def110]
wavpack-5.7.0-build/wavpack-5.7.0/include/wavpack.h:103:29: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'block_buff'
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_utils.c:1512:9: note: in expansion of macro 'SET_TOTAL_SAMPLES'
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_utils.c:1512:9: note: in expansion of macro 'SET_TOTAL_SAMPLES'
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_utils.c:1512:9: note: in expansion of macro 'SET_TOTAL_SAMPLES'
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_utils.c:1512:9: note: in expansion of macro 'SET_TOTAL_SAMPLES'
#  101|       else {                                      \
#  102|           tmp += (tmp / 0xffffffffLL);            \
#  103|->         (hdr).total_samples = (uint32_t) tmp;   \
#  104|           (hdr).total_samples_u8 =                \
#  105|               (unsigned char) (tmp >> 32);        \

Error: CPPCHECK_WARNING: [#def111]
wavpack-5.7.0-build/wavpack-5.7.0/src/common_utils.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def112]
wavpack-5.7.0-build/wavpack-5.7.0/src/extra1.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING (CWE-758): [#def113]
wavpack-5.7.0-build/wavpack-5.7.0/src/extra1.c:97: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#   95|   
#   96|               left -= apply_weight (dpp->weight_A, sam_A);
#   97|->             update_weight (dpp->weight_A, dpp->delta, sam_A, left);
#   98|               dpp->sum_A += dpp->weight_A;
#   99|               out_samples [0] = left;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def114]
wavpack-5.7.0-build/wavpack-5.7.0/src/extra1.c: scope_hint: In function 'decorr_mono_pass'
wavpack-5.7.0-build/wavpack-5.7.0/src/extra1.c:99:29: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'out_samples'
wavpack-5.7.0-build/wavpack-5.7.0/src/extra1.c:18: included_from: Included from here.
wavpack-5.7.0-build/wavpack-5.7.0/src/extra1.c:551:5: note: in expansion of macro 'CLEARA'
#   97|               update_weight (dpp->weight_A, dpp->delta, sam_A, left);
#   98|               dpp->sum_A += dpp->weight_A;
#   99|->             out_samples [0] = left;
#  100|               in_samples += dir;
#  101|               out_samples += dir;

Error: CPPCHECK_WARNING (CWE-758): [#def115]
wavpack-5.7.0-build/wavpack-5.7.0/src/extra1.c:114: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  112|   
#  113|               left -= apply_weight (dpp->weight_A, sam_A);
#  114|->             update_weight (dpp->weight_A, dpp->delta, sam_A, left);
#  115|               dpp->sum_A += dpp->weight_A;
#  116|               out_samples [0] = left;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def116]
wavpack-5.7.0-build/wavpack-5.7.0/src/extra1.c: scope_hint: In function 'analyze_mono'
wavpack-5.7.0-build/wavpack-5.7.0/src/extra1.c:433:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'info.sampleptrs[*wps.mask_decorr]' where non-null expected
<built-in>: note: argument 1 of '__builtin_memcpy' must be non-null
#  431|   
#  432|       memcpy (info.dps, wps->decorr_passes, sizeof (info.dps));
#  433|->     memcpy (info.sampleptrs [0], samples, wps->wphdr.block_samples * 4);
#  434|   
#  435|       for (i = 0; i < info.nterms && info.dps [i].term; ++i)

Error: CLANG_WARNING: [#def117]
wavpack-5.7.0-build/wavpack-5.7.0/src/extra1.c:433:5: warning[core.CallAndMessage]: 1st function call argument is an uninitialized value
#  431|   
#  432|       memcpy (info.dps, wps->decorr_passes, sizeof (info.dps));
#  433|->     memcpy (info.sampleptrs [0], samples, wps->wphdr.block_samples * 4);
#  434|   
#  435|       for (i = 0; i < info.nterms && info.dps [i].term; ++i)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def118]
wavpack-5.7.0-build/wavpack-5.7.0/src/extra1.c:433:29: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'info.sampleptrs[0]'
#  431|   
#  432|       memcpy (info.dps, wps->decorr_passes, sizeof (info.dps));
#  433|->     memcpy (info.sampleptrs [0], samples, wps->wphdr.block_samples * 4);
#  434|   
#  435|       for (i = 0; i < info.nterms && info.dps [i].term; ++i)

Error: CLANG_WARNING: [#def119]
wavpack-5.7.0-build/wavpack-5.7.0/src/extra1.c:438:22: warning[core.CallAndMessage]: 1st function call argument is an uninitialized value
#  436|           decorr_mono_pass (info.sampleptrs [i], info.sampleptrs [i + 1], wps->wphdr.block_samples, info.dps + i, 1);
#  437|   
#  438|->     info.best_bits = LOG2BUFFER (info.sampleptrs [info.nterms], wps->wphdr.block_samples, 0) * 1;
#  439|       info.best_bits += log2overhead (info.dps [0].term, i);
#  440|       memcpy (info.sampleptrs [info.nterms + 1], info.sampleptrs [i], wps->wphdr.block_samples * 4);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def120]
wavpack-5.7.0-build/wavpack-5.7.0/src/extra1.c: scope_hint: In function 'execute_mono'
wavpack-5.7.0-build/wavpack-5.7.0/src/extra1.c:605:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'malloc((long unsigned int)buf_size)' where non-null expected
wavpack-5.7.0-build/wavpack-5.7.0/src/extra1.c:551:5: note: in expansion of macro 'CLEARA'
<built-in>: note: argument 1 of '__builtin_memcpy' must be non-null
#  603|   
#  604|           while (1) {
#  605|->         memcpy (temp_buffer [0], noisy_buffer ? noisy_buffer : samples, buf_size);
#  606|           CLEARA (save_decorr_passes);
#  607|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def121]
wavpack-5.7.0-build/wavpack-5.7.0/src/extra1.c:640:13: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'best_buffer' where non-null expected
wavpack-5.7.0-build/wavpack-5.7.0/src/extra1.c:551:5: note: in expansion of macro 'CLEARA'
<built-in>: note: argument 1 of '__builtin_memcpy' must be non-null
#  638|   
#  639|           if (size < best_size) {
#  640|->             memcpy (best_buffer, temp_buffer [j&1], buf_size);
#  641|               memcpy (wps->decorr_passes, save_decorr_passes, sizeof (struct decorr_pass) * MAX_NTERMS);
#  642|               wps->num_terms = nterms;

Error: CPPCHECK_WARNING: [#def122]
wavpack-5.7.0-build/wavpack-5.7.0/src/extra2.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING (CWE-758): [#def123]
wavpack-5.7.0-build/wavpack-5.7.0/src/extra2.c:104: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  102|                   dpp->samples_A [0] = dpp->samples_A [1];
#  103|                   out_samples [0] = tmp = (dpp->samples_A [1] = in_samples [0]) - apply_weight (dpp->weight_A, sam);
#  104|->                 update_weight (dpp->weight_A, dpp->delta, sam, tmp);
#  105|                   dpp->sum_A += dpp->weight_A;
#  106|   

Error: CPPCHECK_WARNING (CWE-758): [#def124]
wavpack-5.7.0-build/wavpack-5.7.0/src/extra2.c:110: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  108|                   dpp->samples_B [0] = dpp->samples_B [1];
#  109|                   out_samples [1] = tmp = (dpp->samples_B [1] = in_samples [1]) - apply_weight (dpp->weight_B, sam);
#  110|->                 update_weight (dpp->weight_B, dpp->delta, sam, tmp);
#  111|                   dpp->sum_B += dpp->weight_B;
#  112|   

Error: CPPCHECK_WARNING (CWE-758): [#def125]
wavpack-5.7.0-build/wavpack-5.7.0/src/extra2.c:126: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  124|                   dpp->samples_A [1] = dpp->samples_A [0];
#  125|                   out_samples [0] = tmp = (dpp->samples_A [0] = in_samples [0]) - apply_weight (dpp->weight_A, sam);
#  126|->                 update_weight (dpp->weight_A, dpp->delta, sam, tmp);
#  127|                   dpp->sum_A += dpp->weight_A;
#  128|   

Error: CPPCHECK_WARNING (CWE-758): [#def126]
wavpack-5.7.0-build/wavpack-5.7.0/src/extra2.c:132: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  130|                   dpp->samples_B [1] = dpp->samples_B [0];
#  131|                   out_samples [1] = tmp = (dpp->samples_B [0] = in_samples [1]) - apply_weight (dpp->weight_B, sam);
#  132|->                 update_weight (dpp->weight_B, dpp->delta, sam, tmp);
#  133|                   dpp->sum_B += dpp->weight_B;
#  134|   

Error: CPPCHECK_WARNING (CWE-758): [#def127]
wavpack-5.7.0-build/wavpack-5.7.0/src/extra2.c:148: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  146|                   dpp->samples_A [1] = dpp->samples_A [0];
#  147|                   out_samples [0] = tmp = (dpp->samples_A [0] = in_samples [0]) - apply_weight (dpp->weight_A, sam);
#  148|->                 update_weight (dpp->weight_A, dpp->delta, sam, tmp);
#  149|                   dpp->sum_A += dpp->weight_A;
#  150|   

Error: CPPCHECK_WARNING (CWE-758): [#def128]
wavpack-5.7.0-build/wavpack-5.7.0/src/extra2.c:154: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  152|                   dpp->samples_B [1] = dpp->samples_B [0];
#  153|                   out_samples [1] = tmp = (dpp->samples_B [0] = in_samples [1]) - apply_weight (dpp->weight_B, sam);
#  154|->                 update_weight (dpp->weight_B, dpp->delta, sam, tmp);
#  155|                   dpp->sum_B += dpp->weight_B;
#  156|   

Error: CPPCHECK_WARNING (CWE-758): [#def129]
wavpack-5.7.0-build/wavpack-5.7.0/src/extra2.c:171: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  169|                   sam = dpp->samples_A [m];
#  170|                   out_samples [0] = tmp = (dpp->samples_A [k] = in_samples [0]) - apply_weight (dpp->weight_A, sam);
#  171|->                 update_weight (dpp->weight_A, dpp->delta, sam, tmp);
#  172|                   dpp->sum_A += dpp->weight_A;
#  173|   

Error: CPPCHECK_WARNING (CWE-758): [#def130]
wavpack-5.7.0-build/wavpack-5.7.0/src/extra2.c:176: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  174|                   sam = dpp->samples_B [m];
#  175|                   out_samples [1] = tmp = (dpp->samples_B [k] = in_samples [1]) - apply_weight (dpp->weight_B, sam);
#  176|->                 update_weight (dpp->weight_B, dpp->delta, sam, tmp);
#  177|                   dpp->sum_B += dpp->weight_B;
#  178|   

Error: CPPCHECK_WARNING (CWE-758): [#def131]
wavpack-5.7.0-build/wavpack-5.7.0/src/extra2.c:208: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  206|                   sam_A = dpp->samples_A [0];
#  207|                   out_samples [0] = tmp = (sam_B = in_samples [0]) - apply_weight (dpp->weight_A, sam_A);
#  208|->                 update_weight_clip (dpp->weight_A, dpp->delta, sam_A, tmp);
#  209|                   dpp->sum_A += dpp->weight_A;
#  210|   

Error: CPPCHECK_WARNING (CWE-758): [#def132]
wavpack-5.7.0-build/wavpack-5.7.0/src/extra2.c:212: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  210|   
#  211|                   out_samples [1] = tmp = (dpp->samples_A [0] = in_samples [1]) - apply_weight (dpp->weight_B, sam_B);
#  212|->                 update_weight_clip (dpp->weight_B, dpp->delta, sam_B, tmp);
#  213|                   dpp->sum_B += dpp->weight_B;
#  214|   

Error: CPPCHECK_WARNING (CWE-758): [#def133]
wavpack-5.7.0-build/wavpack-5.7.0/src/extra2.c:227: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  225|                   sam_B = dpp->samples_B [0];
#  226|                   out_samples [1] = tmp = (sam_A = in_samples [1]) - apply_weight (dpp->weight_B, sam_B);
#  227|->                 update_weight_clip (dpp->weight_B, dpp->delta, sam_B, tmp);
#  228|                   dpp->sum_B += dpp->weight_B;
#  229|   

Error: CPPCHECK_WARNING (CWE-758): [#def134]
wavpack-5.7.0-build/wavpack-5.7.0/src/extra2.c:231: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  229|   
#  230|                   out_samples [0] = tmp = (dpp->samples_B [0] = in_samples [0]) - apply_weight (dpp->weight_A, sam_A);
#  231|->                 update_weight_clip (dpp->weight_A, dpp->delta, sam_A, tmp);
#  232|                   dpp->sum_A += dpp->weight_A;
#  233|   

Error: CPPCHECK_WARNING (CWE-758): [#def135]
wavpack-5.7.0-build/wavpack-5.7.0/src/extra2.c:249: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  247|                   dpp->samples_A [0] = tmp = in_samples [1];
#  248|                   out_samples [1] = tmp -= apply_weight (dpp->weight_B, sam_B);
#  249|->                 update_weight_clip (dpp->weight_B, dpp->delta, sam_B, tmp);
#  250|                   dpp->sum_B += dpp->weight_B;
#  251|   

Error: CPPCHECK_WARNING (CWE-758): [#def136]
wavpack-5.7.0-build/wavpack-5.7.0/src/extra2.c:254: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  252|                   dpp->samples_B [0] = tmp = in_samples [0];
#  253|                   out_samples [0] = tmp -= apply_weight (dpp->weight_A, sam_A);
#  254|->                 update_weight_clip (dpp->weight_A, dpp->delta, sam_A, tmp);
#  255|                   dpp->sum_A += dpp->weight_A;
#  256|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def137]
wavpack-5.7.0-build/wavpack-5.7.0/src/extra2.c: scope_hint: In function 'analyze_stereo'
wavpack-5.7.0-build/wavpack-5.7.0/src/extra2.c:597:5: warning[-Wanalyzer-null-argument]: use of NULL 'samples' where non-null expected
<built-in>: note: argument 2 of '__builtin_memcpy' must be non-null
#  595|   
#  596|       memcpy (info.dps, wps->decorr_passes, sizeof (info.dps));
#  597|->     memcpy (info.sampleptrs [0], samples, wps->wphdr.block_samples * 8);
#  598|   
#  599|       for (i = 0; i < info.nterms && info.dps [i].term; ++i)

Error: GCC_ANALYZER_WARNING (CWE-688): [#def138]
wavpack-5.7.0-build/wavpack-5.7.0/src/extra2.c:597:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'info.sampleptrs[*wps.best_decorr]' where non-null expected
<built-in>: note: argument 1 of '__builtin_memcpy' must be non-null
#  595|   
#  596|       memcpy (info.dps, wps->decorr_passes, sizeof (info.dps));
#  597|->     memcpy (info.sampleptrs [0], samples, wps->wphdr.block_samples * 8);
#  598|   
#  599|       for (i = 0; i < info.nterms && info.dps [i].term; ++i)

Error: CLANG_WARNING: [#def139]
wavpack-5.7.0-build/wavpack-5.7.0/src/extra2.c:597:5: warning[core.CallAndMessage]: 1st function call argument is an uninitialized value
#  595|   
#  596|       memcpy (info.dps, wps->decorr_passes, sizeof (info.dps));
#  597|->     memcpy (info.sampleptrs [0], samples, wps->wphdr.block_samples * 8);
#  598|   
#  599|       for (i = 0; i < info.nterms && info.dps [i].term; ++i)

Error: CLANG_WARNING: [#def140]
wavpack-5.7.0-build/wavpack-5.7.0/src/extra2.c:597:5: warning[core.NonNullParamChecker]: Null pointer passed to 2nd parameter expecting 'nonnull'
#  595|   
#  596|       memcpy (info.dps, wps->decorr_passes, sizeof (info.dps));
#  597|->     memcpy (info.sampleptrs [0], samples, wps->wphdr.block_samples * 8);
#  598|   
#  599|       for (i = 0; i < info.nterms && info.dps [i].term; ++i)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def141]
wavpack-5.7.0-build/wavpack-5.7.0/src/extra2.c:597:29: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'info.sampleptrs[0]'
#  595|   
#  596|       memcpy (info.dps, wps->decorr_passes, sizeof (info.dps));
#  597|->     memcpy (info.sampleptrs [0], samples, wps->wphdr.block_samples * 8);
#  598|   
#  599|       for (i = 0; i < info.nterms && info.dps [i].term; ++i)

Error: CLANG_WARNING: [#def142]
wavpack-5.7.0-build/wavpack-5.7.0/src/extra2.c:602:22: warning[core.CallAndMessage]: 1st function call argument is an uninitialized value
#  600|           decorr_stereo_pass (info.sampleptrs [i], info.sampleptrs [i + 1], wps->wphdr.block_samples, info.dps + i, 1);
#  601|   
#  602|->     info.best_bits = LOG2BUFFER (info.sampleptrs [info.nterms], wps->wphdr.block_samples * 2, 0) * 1;
#  603|       info.best_bits += log2overhead (info.dps [0].term, i);
#  604|       memcpy (info.sampleptrs [info.nterms + 1], info.sampleptrs [i], wps->wphdr.block_samples * 8);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def143]
wavpack-5.7.0-build/wavpack-5.7.0/src/extra2.c: scope_hint: In function 'execute_stereo'
wavpack-5.7.0-build/wavpack-5.7.0/src/extra2.c:801:21: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'js_buffer' where non-null expected
<built-in>: note: argument 1 of '__builtin_memcpy' must be non-null
#  799|   
#  800|                       lptr = js_buffer = malloc (buf_size);
#  801|->                     memcpy (js_buffer, noisy_buffer ? noisy_buffer : samples, buf_size);
#  802|   
#  803|                       while (cnt--) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def144]
wavpack-5.7.0-build/wavpack-5.7.0/src/extra2.c:812:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'malloc((long unsigned int)buf_size)' where non-null expected
wavpack-5.7.0-build/wavpack-5.7.0/src/extra2.c:19: included_from: Included from here.
wavpack-5.7.0-build/wavpack-5.7.0/src/extra2.c:742:5: note: in expansion of macro 'CLEARA'
<built-in>: note: argument 1 of '__builtin_memcpy' must be non-null
#  810|               }
#  811|               else
#  812|->                 memcpy (temp_buffer [0], noisy_buffer ? noisy_buffer : samples, buf_size);
#  813|   
#  814|               CLEARA (save_decorr_passes);

Error: CLANG_WARNING: [#def145]
wavpack-5.7.0-build/wavpack-5.7.0/src/extra2.c:870:17: warning[core.NonNullParamChecker]: Null pointer passed to 2nd parameter expecting 'nonnull'
#  868|   
#  869|               if (do_samples)
#  870|->                 memcpy (samples, js_buffer, buf_size);
#  871|           }
#  872|           else if (noisy_buffer) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def146]
wavpack-5.7.0-build/wavpack-5.7.0/src/open_filename.c: scope_hint: In function 'WavpackOpenFileInput'
wavpack-5.7.0-build/wavpack-5.7.0/src/open_filename.c:302:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'in2filename' where non-null expected
<built-in>: note: argument 1 of '__builtin_strcpy' must be non-null
#  300|           char *in2filename = malloc (strlen (infilename) + 10);
#  301|   
#  302|->         strcpy (in2filename, infilename);
#  303|           strcat (in2filename, "c");
#  304|           wvc_id = fopen_func (in2filename, "rb");

Error: GCC_ANALYZER_WARNING (CWE-476): [#def147]
wavpack-5.7.0-build/wavpack-5.7.0/src/open_legacy.c: scope_hint: In function 'WavpackOpenFileInputEx'
wavpack-5.7.0-build/wavpack-5.7.0/src/open_legacy.c:103:26: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'trans_wv'
#  101|       if (wv_id) {
#  102|           trans_wv = (WavpackReaderTranslator *)malloc (sizeof (WavpackReaderTranslator));
#  103|->         trans_wv->reader = reader;
#  104|           trans_wv->id = wv_id;
#  105|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def148]
wavpack-5.7.0-build/wavpack-5.7.0/src/open_legacy.c:109:27: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'trans_wvc'
#  107|       if (wvc_id) {
#  108|           trans_wvc = (WavpackReaderTranslator *)malloc (sizeof (WavpackReaderTranslator));
#  109|->         trans_wvc->reader = reader;
#  110|           trans_wvc->id = wvc_id;
#  111|       }

Error: CPPCHECK_WARNING: [#def149]
wavpack-5.7.0-build/wavpack-5.7.0/src/open_raw.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-688): [#def150]
wavpack-5.7.0-build/wavpack-5.7.0/src/open_raw.c: scope_hint: In function 'WavpackOpenRawDecoder'
wavpack-5.7.0-build/wavpack-5.7.0/src/open_raw.c:151:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'raw_wv' where non-null expected
<built-in>: note: argument 1 of '__builtin_memset' must be non-null
#  149|   
#  150|           raw_wv = malloc (sizeof (WavpackRawContext));
#  151|->         memset (raw_wv, 0, sizeof (WavpackRawContext));
#  152|   
#  153|           if (corr_data && corr_size) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def151]
wavpack-5.7.0-build/wavpack-5.7.0/src/open_raw.c:155:13: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'raw_wvc' where non-null expected
<built-in>: note: argument 1 of '__builtin_memset' must be non-null
#  153|           if (corr_data && corr_size) {
#  154|               raw_wvc = malloc (sizeof (WavpackRawContext));
#  155|->             memset (raw_wvc, 0, sizeof (WavpackRawContext));
#  156|           }
#  157|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def152]
wavpack-5.7.0-build/wavpack-5.7.0/src/open_raw.c:205:31: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'wphdr'
#  203|                   memset (wphdr, 0, sizeof (WavpackHeader));
#  204|                   memcpy (wphdr->ckID, "wvpk", 4);
#  205|->                 wphdr->ckSize = sizeof (WavpackHeader) - 8 + block_size;
#  206|                   SET_TOTAL_SAMPLES (*wphdr, block_samples);
#  207|                   wphdr->block_samples = block_samples;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def153]
wavpack-5.7.0-build/wavpack-5.7.0/src/open_raw.c:214:34: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
#  212|   
#  213|                   raw_wv->num_segments += 2;
#  214|->                 raw_wv->segments = realloc (raw_wv->segments, sizeof (RawSegment) * raw_wv->num_segments);
#  215|                   raw_wv->segments [msi].dptr = raw_wv->segments [msi].sptr = (unsigned char *) wphdr;
#  216|                   raw_wv->segments [msi].eptr = raw_wv->segments [msi].dptr + sizeof (WavpackHeader);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def154]
wavpack-5.7.0-build/wavpack-5.7.0/src/open_raw.c:215:75: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
#  213|                   raw_wv->num_segments += 2;
#  214|                   raw_wv->segments = realloc (raw_wv->segments, sizeof (RawSegment) * raw_wv->num_segments);
#  215|->                 raw_wv->segments [msi].dptr = raw_wv->segments [msi].sptr = (unsigned char *) wphdr;
#  216|                   raw_wv->segments [msi].eptr = raw_wv->segments [msi].dptr + sizeof (WavpackHeader);
#  217|                   raw_wv->segments [msi++].free_required = 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def155]
wavpack-5.7.0-build/wavpack-5.7.0/src/open_raw.c:252:35: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'wphdr'
#  250|                       memset (wphdr, 0, sizeof (WavpackHeader));
#  251|                       memcpy (wphdr->ckID, "wvpk", 4);
#  252|->                     wphdr->ckSize = sizeof (WavpackHeader) - 8 + block_size;
#  253|                       SET_TOTAL_SAMPLES (*wphdr, block_samples);
#  254|                       wphdr->block_samples = block_samples;

Error: GCC_ANALYZER_WARNING (CWE-416): [#def156]
wavpack-5.7.0-build/wavpack-5.7.0/src/open_raw.c:260:28: warning[-Wanalyzer-use-after-free]: use after 'free' of 'raw_wvc'
#  258|                       WavpackLittleEndianToNative (wphdr, WavpackHeaderFormat);
#  259|   
#  260|->                     raw_wvc->num_segments += 2;
#  261|                       raw_wvc->segments = realloc (raw_wvc->segments, sizeof (RawSegment) * raw_wvc->num_segments);
#  262|                       raw_wvc->segments [csi].dptr = raw_wvc->segments [csi].sptr = (unsigned char *) wphdr;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def157]
wavpack-5.7.0-build/wavpack-5.7.0/src/open_raw.c:262:81: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
#  260|                       raw_wvc->num_segments += 2;
#  261|                       raw_wvc->segments = realloc (raw_wvc->segments, sizeof (RawSegment) * raw_wvc->num_segments);
#  262|->                     raw_wvc->segments [csi].dptr = raw_wvc->segments [csi].sptr = (unsigned char *) wphdr;
#  263|                       raw_wvc->segments [csi].eptr = raw_wvc->segments [csi].dptr + sizeof (WavpackHeader);
#  264|                       raw_wvc->segments [csi++].free_required = 1;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def158]
wavpack-5.7.0-build/wavpack-5.7.0/src/open_raw.c:285:34: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'raw_wv'
#  283|               raw_wv = malloc (sizeof (WavpackRawContext));
#  284|               memset (raw_wv, 0, sizeof (WavpackRawContext));
#  285|->             raw_wv->num_segments = 1;
#  286|               raw_wv->segments = malloc (sizeof (RawSegment) * raw_wv->num_segments);
#  287|               raw_wv->segments [0].dptr = raw_wv->segments [0].sptr = main_data;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def159]
wavpack-5.7.0-build/wavpack-5.7.0/src/open_raw.c:287:67: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'malloc(32)'
#  285|               raw_wv->num_segments = 1;
#  286|               raw_wv->segments = malloc (sizeof (RawSegment) * raw_wv->num_segments);
#  287|->             raw_wv->segments [0].dptr = raw_wv->segments [0].sptr = main_data;
#  288|               raw_wv->segments [0].eptr = raw_wv->segments [0].dptr + main_size;
#  289|               raw_wv->segments [0].free_required = 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def160]
wavpack-5.7.0-build/wavpack-5.7.0/src/open_raw.c:295:35: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'raw_wvc'
#  293|               raw_wvc = malloc (sizeof (WavpackRawContext));
#  294|               memset (raw_wvc, 0, sizeof (WavpackRawContext));
#  295|->             raw_wvc->num_segments = 1;
#  296|               raw_wvc->segments = malloc (sizeof (RawSegment) * raw_wvc->num_segments);
#  297|               raw_wvc->segments [0].dptr = raw_wvc->segments [0].sptr = corr_data;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def161]
wavpack-5.7.0-build/wavpack-5.7.0/src/open_raw.c:297:69: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'malloc(32)'
#  295|               raw_wvc->num_segments = 1;
#  296|               raw_wvc->segments = malloc (sizeof (RawSegment) * raw_wvc->num_segments);
#  297|->             raw_wvc->segments [0].dptr = raw_wvc->segments [0].sptr = corr_data;
#  298|               raw_wvc->segments [0].eptr = raw_wvc->segments [0].dptr + corr_size;
#  299|               raw_wvc->segments [0].free_required = 0;

Error: CPPCHECK_WARNING: [#def162]
wavpack-5.7.0-build/wavpack-5.7.0/src/open_utils.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-688): [#def163]
wavpack-5.7.0-build/wavpack-5.7.0/src/open_utils.c: scope_hint: In function 'read_channel_identities'
wavpack-5.7.0-build/wavpack-5.7.0/src/open_utils.c:565:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL '*wpc.channel_identities' where non-null expected
<built-in>: note: argument 1 of '__builtin_memcpy' must be non-null
#  563|       if (!wpc->channel_identities) {
#  564|           wpc->channel_identities = (unsigned char *)malloc (wpmd->byte_length + 1);
#  565|->         memcpy (wpc->channel_identities, wpmd->data, wpmd->byte_length);
#  566|           wpc->channel_identities [wpmd->byte_length] = 0;
#  567|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def164]
wavpack-5.7.0-build/wavpack-5.7.0/src/open_utils.c: scope_hint: In function 'read_sample_rate'
wavpack-5.7.0-build/wavpack-5.7.0/src/open_utils.c:681:45: warning[-Wanalyzer-null-dereference]: dereference of NULL 'byteptr'
#  679|   
#  680|       if (bytecnt == 3 || bytecnt == 4) {
#  681|->         wpc->config.sample_rate = (int32_t) *byteptr++;
#  682|           wpc->config.sample_rate |= (int32_t) *byteptr++ << 8;
#  683|           wpc->config.sample_rate |= (int32_t) *byteptr++ << 16;

Error: CPPCHECK_WARNING: [#def165]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def166]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack.c: scope_hint: In function 'write_decorr_terms'
wavpack-5.7.0-build/wavpack-5.7.0/src/pack.c:110:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'byteptr'
#  108|   
#  109|       for (dpp = wps->decorr_passes; tcount--; ++dpp)
#  110|->         *byteptr++ = ((dpp->term + 5) & 0x1f) | ((dpp->delta << 5) & 0xe0);
#  111|   
#  112|       wpmd->byte_length = (int32_t)(byteptr - (char *) wpmd->data);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def167]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack.c: scope_hint: In function 'write_int32_info'
wavpack-5.7.0-build/wavpack-5.7.0/src/pack.c:281:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'wpmd.data'
#  279|       byteptr = wpmd->data = malloc (4);
#  280|       wpmd->id = ID_INT32_INFO;
#  281|->     *byteptr++ = wps->int32_sent_bits;
#  282|       *byteptr++ = wps->int32_zeros;
#  283|       *byteptr++ = wps->int32_ones;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def168]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack.c: scope_hint: In function 'write_float_info'
wavpack-5.7.0-build/wavpack-5.7.0/src/pack.c:294:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'wpmd.data'
#  292|       byteptr = wpmd->data = malloc (4);
#  293|       wpmd->id = ID_FLOAT_INFO;
#  294|->     *byteptr++ = wps->float_flags;
#  295|       *byteptr++ = wps->float_shift;
#  296|       *byteptr++ = wps->float_max_exp;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def169]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack.c: scope_hint: In function 'write_channel_info'
wavpack-5.7.0-build/wavpack-5.7.0/src/pack.c:314:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'wpmd.data'
#  312|   
#  313|       if (wps->wpc->num_streams > OLD_MAX_STREAMS) {       // if > 8 streams, use 6 or 7 bytes (breaks old decoders
#  314|->         *byteptr++ = wps->wpc->config.num_channels - 1;  // that could only handle 8 streams) and allow (in theory)
#  315|           *byteptr++ = wps->wpc->num_streams - 1;          // up to 4096 channels
#  316|           *byteptr++ = (((wps->wpc->num_streams - 1) >> 4) & 0xf0) | (((wps->wpc->config.num_channels - 1) >> 8) & 0xf);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def170]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack.c:325:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'wpmd.data'
#  323|       }
#  324|       else {                                          // otherwise use only 1 to 5 bytes
#  325|->         *byteptr++ = wps->wpc->config.num_channels;
#  326|   
#  327|           while (mask) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def171]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack.c: scope_hint: In function 'write_config_info'
wavpack-5.7.0-build/wavpack-5.7.0/src/pack.c:361:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'wpmd.data'
#  359|       byteptr = wpmd->data = malloc (8);
#  360|       wpmd->id = ID_CONFIG_BLOCK;
#  361|->     *byteptr++ = (char) (wps->wpc->config.flags >> 8);
#  362|       *byteptr++ = (char) (wps->wpc->config.flags >> 16);
#  363|       *byteptr++ = (char) (wps->wpc->config.flags >> 24);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def172]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack.c: scope_hint: In function 'write_new_config_info'
wavpack-5.7.0-build/wavpack-5.7.0/src/pack.c:388:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'wpmd.data'
#  386|   
#  387|       if (wps->wpc->file_format || (wps->wpc->config.qmode & 0xff) || wps->wpc->channel_layout) {
#  388|->         *byteptr++ = (char) wps->wpc->file_format;
#  389|           *byteptr++ = (char) wps->wpc->config.qmode;
#  390|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def173]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack.c: scope_hint: In function 'write_sample_rate'
wavpack-5.7.0-build/wavpack-5.7.0/src/pack.c:431:16: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'wpmd.data'
#  429|       byteptr = wpmd->data = malloc (4);
#  430|       wpmd->id = ID_SAMPLE_RATE;
#  431|->     *byteptr++ = (char) (wps->wpc->config.sample_rate);
#  432|       *byteptr++ = (char) (wps->wpc->config.sample_rate >> 8);
#  433|       *byteptr++ = (char) (wps->wpc->config.sample_rate >> 16);

Error: CLANG_WARNING: [#def174]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack.c:547:14: warning[deadcode.DeadStores]: Although the value stored to 'mag' is used in the enclosing expression, the value is never actually read from 'mag'
#  545|               }
#  546|   
#  547|->         if ((mag -= shift) < 0)
#  548|               flags &= ~MAG_MASK;
#  549|           else

Error: GCC_ANALYZER_WARNING (CWE-688): [#def175]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack.c: scope_hint: In function 'pack_block'
wavpack-5.7.0-build/wavpack-5.7.0/src/pack.c:569:13: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'orig_data' where non-null expected
<built-in>: note: argument 1 of '__builtin_memcpy' must be non-null
#  567|           if ((!(flags & HYBRID_FLAG) || wps->wpc->wvc_flag) && !(wps->wpc->config.flags & CONFIG_SKIP_WVX)) {
#  568|               orig_data = malloc (sizeof (f32) * ((flags & MONO_DATA) ? sample_count : sample_count * 2));
#  569|->             memcpy (orig_data, buffer, sizeof (f32) * ((flags & MONO_DATA) ? sample_count : sample_count * 2));
#  570|   
#  571|               if (flags & FLOAT_DATA) {                                       // if lossless float data come here

Error: GCC_ANALYZER_WARNING (CWE-688): [#def176]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack.c: scope_hint: In function 'pack_samples'
wavpack-5.7.0-build/wavpack-5.7.0/src/pack.c:1109:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'saved_buffer' where non-null expected
<built-in>: note: argument 1 of '__builtin_memcpy' must be non-null
# 1107|       if (repack_possible && !(flags & HYBRID_FLAG)) {
# 1108|           saved_buffer = malloc (sample_count * sizeof (int32_t) * (flags & MONO_DATA ? 1 : 2));
# 1109|->         memcpy (saved_buffer, buffer, sample_count * sizeof (int32_t) * (flags & MONO_DATA ? 1 : 2));
# 1110|       }
# 1111|   

Error: CPPCHECK_WARNING (CWE-758): [#def177]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack.c:1254: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
# 1252|                   while (--dpp >= wps->decorr_passes) {
# 1253|                       if (dpp->term > MAX_TERM) {
# 1254|->                         update_weight (dpp->weight_A, dpp->delta, dpp->samples_A [2], code);
# 1255|                           dpp->samples_A [1] = dpp->samples_A [0];
# 1256|                           dpp->samples_A [0] = (code += dpp->aweight_A);

Error: CPPCHECK_WARNING (CWE-758): [#def178]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack.c:1261: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
# 1259|                           int32_t sam = dpp->samples_A [m];
# 1260|   
# 1261|->                         update_weight (dpp->weight_A, dpp->delta, sam, code);
# 1262|                           dpp->samples_A [(m + dpp->term) & (MAX_TERM - 1)] = (code += dpp->aweight_A);
# 1263|                       }

Error: CPPCHECK_WARNING (CWE-758): [#def179]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack.c:1364: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
# 1362|                   while (--dpp >= wps->decorr_passes)
# 1363|                       if (dpp->term > MAX_TERM) {
# 1364|->                         update_weight (dpp->weight_A, dpp->delta, dpp->samples_A [2], left);
# 1365|                           update_weight (dpp->weight_B, dpp->delta, dpp->samples_B [2], right);
# 1366|   

Error: CPPCHECK_WARNING (CWE-758): [#def180]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack.c:1365: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
# 1363|                       if (dpp->term > MAX_TERM) {
# 1364|                           update_weight (dpp->weight_A, dpp->delta, dpp->samples_A [2], left);
# 1365|->                         update_weight (dpp->weight_B, dpp->delta, dpp->samples_B [2], right);
# 1366|   
# 1367|                           dpp->samples_A [1] = dpp->samples_A [0];

Error: CPPCHECK_WARNING (CWE-758): [#def181]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack.c:1376: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
# 1374|                           int k = (m + dpp->term) & (MAX_TERM - 1);
# 1375|   
# 1376|->                         update_weight (dpp->weight_A, dpp->delta, dpp->samples_A [m], left);
# 1377|                           dpp->samples_A [k] = (left += dpp->aweight_A);
# 1378|   

Error: CPPCHECK_WARNING (CWE-758): [#def182]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack.c:1379: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
# 1377|                           dpp->samples_A [k] = (left += dpp->aweight_A);
# 1378|   
# 1379|->                         update_weight (dpp->weight_B, dpp->delta, dpp->samples_B [m], right);
# 1380|                           dpp->samples_B [k] = (right += dpp->aweight_B);
# 1381|                       }

Error: CPPCHECK_WARNING (CWE-758): [#def183]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack.c:1392: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
# 1390|                           }
# 1391|   
# 1392|->                         update_weight_clip (dpp->weight_A, dpp->delta, dpp->samples_A [0], left);
# 1393|                           update_weight_clip (dpp->weight_B, dpp->delta, dpp->samples_B [0], right);
# 1394|                           dpp->samples_B [0] = (left += dpp->aweight_A);

Error: CPPCHECK_WARNING (CWE-758): [#def184]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack.c:1393: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
# 1391|   
# 1392|                           update_weight_clip (dpp->weight_A, dpp->delta, dpp->samples_A [0], left);
# 1393|->                         update_weight_clip (dpp->weight_B, dpp->delta, dpp->samples_B [0], right);
# 1394|                           dpp->samples_B [0] = (left += dpp->aweight_A);
# 1395|                           dpp->samples_A [0] = (right += dpp->aweight_B);

Error: CPPCHECK_WARNING: [#def185]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_dns.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING (CWE-758): [#def186]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_dns.c:38: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#   36|                   sam = (3 * bptr [1] - bptr [2]) >> 1;
#   37|                   temp = *bptr-- - apply_weight (ap->weight_A, sam);
#   38|->                 update_weight (ap->weight_A, 2, sam, temp);
#   39|               }
#   40|           else

Error: CPPCHECK_WARNING (CWE-758): [#def187]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_dns.c:44: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#   42|                   sam = (3 * bptr [2] - bptr [4]) >> 1;
#   43|                   temp = *bptr-- - apply_weight (ap->weight_B, sam);
#   44|->                 update_weight (ap->weight_B, 2, sam, temp);
#   45|                   sam = (3 * bptr [2] - bptr [4]) >> 1;
#   46|                   temp = *bptr-- - apply_weight (ap->weight_A, sam);

Error: CPPCHECK_WARNING (CWE-758): [#def188]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_dns.c:47: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#   45|                   sam = (3 * bptr [2] - bptr [4]) >> 1;
#   46|                   temp = *bptr-- - apply_weight (ap->weight_A, sam);
#   47|->                 update_weight (ap->weight_A, 2, sam, temp);
#   48|               }
#   49|       }

Error: CPPCHECK_WARNING (CWE-758): [#def189]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_dns.c:60: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#   58|                   sam = (3 * ap->samples_A [0] - ap->samples_A [1]) >> 1;
#   59|                   temp = *bptr - apply_weight (ap->weight_A, sam);
#   60|->                 update_weight (ap->weight_A, 2, sam, temp);
#   61|                   ap->samples_A [1] = ap->samples_A [0];
#   62|                   ap->samples_A [0] = *bptr++;

Error: CPPCHECK_WARNING (CWE-758): [#def190]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_dns.c:69: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#   67|                   sam = (3 * ap->samples_A [0] - ap->samples_A [1]) >> 1;
#   68|                   temp = *bptr - apply_weight (ap->weight_A, sam);
#   69|->                 update_weight (ap->weight_A, 2, sam, temp);
#   70|                   ap->samples_A [1] = ap->samples_A [0];
#   71|                   ap->samples_A [0] = *bptr++;

Error: CPPCHECK_WARNING (CWE-758): [#def191]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_dns.c:75: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#   73|                   sam = (3 * ap->samples_B [0] - ap->samples_B [1]) >> 1;
#   74|                   temp = *bptr - apply_weight (ap->weight_B, sam);
#   75|->                 update_weight (ap->weight_B, 2, sam, temp);
#   76|                   ap->samples_B [1] = ap->samples_B [0];
#   77|                   ap->samples_B [0] = *bptr++;

Error: CPPCHECK_WARNING: [#def192]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_dsd.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-688): [#def193]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_dsd.c: scope_hint: In function 'calculate_probabilities'
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_dsd.c:205:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'probs' where non-null expected
<built-in>: note: argument 1 of '__builtin_memset' must be non-null
#  203|   
#  204|       if (max_hits == 0) {
#  205|->         memset (probs, 0, sizeof (*probs) * 256);
#  206|           memset (prob_sums, 0, sizeof (*prob_sums) * 256);
#  207|           return;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def194]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_dsd.c:206:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'prob_sums' where non-null expected
<built-in>: note: argument 1 of '__builtin_memset' must be non-null
#  204|       if (max_hits == 0) {
#  205|           memset (probs, 0, sizeof (*probs) * 256);
#  206|->         memset (prob_sums, 0, sizeof (*prob_sums) * 256);
#  207|           return;
#  208|       }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def195]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_dsd.c:237:27: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'prob_sums'
#  235|                   value = 0;
#  236|   
#  237|->             prob_sums [i] = sum_values += value;
#  238|               probs [i] = value;
#  239|           }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def196]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_dsd.c:238:23: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'probs'
#  236|   
#  237|               prob_sums [i] = sum_values += value;
#  238|->             probs [i] = value;
#  239|           }
#  240|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def197]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_dsd.c: scope_hint: In function 'encode_buffer_fast'
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_dsd.c:311:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'histogram' where non-null expected
<built-in>: note: argument 1 of '__builtin_memset' must be non-null
#  309|       history_bins = 1 << history_bits;
#  310|       histogram = malloc (sizeof (*histogram) * history_bins);
#  311|->     memset (histogram, 0, sizeof (*histogram) * history_bins);
#  312|       probabilities = malloc (sizeof (*probabilities) * history_bins);
#  313|       summed_probabilities = malloc (sizeof (*summed_probabilities) * history_bins);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def198]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_dsd.c:333:65: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value '*<unknown>[255]'
#  331|       for (p0 = 0; p0 < history_bins; p0++) {
#  332|           calculate_probabilities (histogram [p0], probabilities [p0], summed_probabilities [p0]);
#  333|->         total_summed_probabilities += summed_probabilities [p0] [255];
#  334|       }
#  335|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def199]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_dsd.c: scope_hint: In function 'init_ptable'
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_dsd.c:457:19: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'table'
#  455|   
#  456|       for (i = 0; i < PTABLE_BINS/2; ++i) {
#  457|->         table [i] = value;
#  458|           table [PTABLE_BINS-1-i] = 0x100ffff - value;
#  459|   

Error: CPPCHECK_WARNING (CWE-758): [#def200]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_dsd.c:586: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  584|   
#  585|               sp [0].value += sp [0].filter6 * 8;
#  586|->             sp [0].factor += (((sp [0].value ^ sp [0].filter0) >> 31) | 1) & ((sp [0].value ^ (sp [0].value - (sp [0].filter6 * 16))) >> 31);
#  587|               sp [0].filter1 += ((sp [0].filter0 & VALUE_ONE) - sp [0].filter1) >> 6;
#  588|               sp [0].filter2 += ((sp [0].filter0 & VALUE_ONE) - sp [0].filter2) >> 4;

Error: CPPCHECK_WARNING (CWE-758): [#def201]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_dsd.c:620: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  618|   
#  619|               sp [1].value += sp [1].filter6 * 8;
#  620|->             sp [1].factor += (((sp [1].value ^ sp [1].filter0) >> 31) | 1) & ((sp [1].value ^ (sp [1].value - (sp [1].filter6 * 16))) >> 31);
#  621|               sp [1].filter1 += ((sp [1].filter0 & VALUE_ONE) - sp [1].filter1) >> 6;
#  622|               sp [1].filter2 += ((sp [1].filter0 & VALUE_ONE) - sp [1].filter2) >> 4;

Error: CPPCHECK_WARNING: [#def202]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_floats.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING (CWE-758): [#def203]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_floats.c:48: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#   46|       // max magnitude that does not have an exponent of 255 (reserved for +/-inf and NaN).
#   47|       for (dp = values, count = num_values; count--; dp++) {
#   48|->         crc = crc * 27 + get_mantissa (*dp) * 9 + get_exponent (*dp) * 3 + get_sign (*dp);
#   49|   
#   50|           if (get_exponent (*dp) < 255 && get_magnitude (*dp) > max_mag)

Error: CPPCHECK_WARNING (CWE-758): [#def204]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_floats.c:105: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  103|               if (get_exponent (*dp) || get_mantissa (*dp))
#  104|                   ++false_zeros;
#  105|->             else if (get_sign (*dp))
#  106|                   ++neg_zeros;
#  107|   #ifdef DISPLAY_DIAGNOSTICS

Error: CPPCHECK_WARNING (CWE-758): [#def205]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_floats.c:130: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  128|   
#  129|           ordata |= value;
#  130|->         * (int32_t *) dp = (get_sign (*dp)) ? -value : value;
#  131|       }
#  132|   

Error: CPPCHECK_WARNING (CWE-758): [#def206]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_floats.c:250: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  248|                       }
#  249|   
#  250|->                     putbit (get_sign (*dp), &wps->wvxbits);
#  251|                   }
#  252|                   else {

Error: CPPCHECK_WARNING (CWE-758): [#def207]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_floats.c:256: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  254|   
#  255|                       if (wps->float_flags & FLOAT_NEG_ZEROS)
#  256|->                         putbit (get_sign (*dp), &wps->wvxbits);
#  257|                   }
#  258|               }

Error: CPPCHECK_WARNING: [#def208]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_utils.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-688): [#def209]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_utils.c: scope_hint: In function 'pack_streams'
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_utils.c:1167:13: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'wps_copy' where non-null expected
<built-in>: note: argument 1 of '__builtin_memcpy' must be non-null
# 1165|               WavpackStream *wps_copy = malloc (sizeof (WavpackStream));
# 1166|   
# 1167|->             memcpy (wps_copy, wps, sizeof (WavpackStream));
# 1168|   
# 1169|               // If there is a discontinuity (i.e., the previous block is not done, so we can't get any

Error: GCC_ANALYZER_WARNING (CWE-688): [#def210]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_utils.c:1178:13: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'malloc((long unsigned int)(block_samples * <unknown>))' where non-null expected
<built-in>: note: argument 1 of '__builtin_memcpy' must be non-null
# 1176|   
# 1177|               wps_copy->sample_buffer = malloc (block_samples * (wps->wphdr.flags & MONO_FLAG ? 4 : 8));
# 1178|->             memcpy (wps_copy->sample_buffer, wps->sample_buffer, block_samples * (wps->wphdr.flags & MONO_FLAG ? 4 : 8));
# 1179|   
# 1180|               if (wps->discontinuous && wps->pre_sample_buffer && wps->num_pre_samples) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def211]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_utils.c:1182:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'malloc((long unsigned int)(*wps.num_pre_samples * <unknown>))' where non-null expected
<built-in>: note: argument 1 of '__builtin_memcpy' must be non-null
# 1180|               if (wps->discontinuous && wps->pre_sample_buffer && wps->num_pre_samples) {
# 1181|                   wps_copy->pre_sample_buffer = malloc (wps->num_pre_samples * (wps->wphdr.flags & MONO_FLAG ? 4 : 8));
# 1182|->                 memcpy (wps_copy->pre_sample_buffer, wps->pre_sample_buffer, wps->num_pre_samples * (wps->wphdr.flags & MONO_FLAG ? 4 : 8));
# 1183|               }
# 1184|               else {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def212]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_utils.c:1191:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'malloc(1024)' where non-null expected
<built-in>: note: argument 1 of '__builtin_memcpy' must be non-null
# 1189|               if (wps->dsd.ptable) {
# 1190|                   wps_copy->dsd.ptable = malloc (256 * sizeof (*wps->dsd.ptable));
# 1191|->                 memcpy (wps_copy->dsd.ptable, wps->dsd.ptable, 256 * sizeof (*wps->dsd.ptable));
# 1192|               }
# 1193|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def213]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_utils.c:1244:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL '*wps.pre_sample_buffer' where non-null expected
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_utils.c:22: included_from: Included from here.
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_utils.c:1822:5: note: in expansion of macro 'wp_mutex_release'
<built-in>: note: argument 1 of '__builtin_memcpy' must be non-null
# 1242|   
# 1243|               if (wps->wpc->block_samples > wps->wpc->max_pre_samples) {
# 1244|->                 memcpy (wps->pre_sample_buffer,
# 1245|                       wps->sample_buffer + (wps->wpc->block_samples - wps->wpc->max_pre_samples) * (wps->wphdr.flags & MONO_FLAG ? 1 : 2),
# 1246|                       wps->wpc->max_pre_samples * (wps->wphdr.flags & MONO_FLAG ? 4 : 8));

Error: GCC_ANALYZER_WARNING (CWE-688): [#def214]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_utils.c:1251:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL '*wps.pre_sample_buffer' where non-null expected
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_utils.c:1822:5: note: in expansion of macro 'wp_mutex_release'
<built-in>: note: argument 1 of '__builtin_memcpy' must be non-null
# 1249|               }
# 1250|               else {
# 1251|->                 memcpy (wps->pre_sample_buffer, wps->sample_buffer, wps->wpc->block_samples * (wps->wphdr.flags & MONO_FLAG ? 4 : 8));
# 1252|                   wps->num_pre_samples = wps->wpc->block_samples;
# 1253|               }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def215]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_utils.c: scope_hint: In function 'WavpackUpdateNumSamples'
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_utils.c:1299:13: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
<built-in>: note: argument 1 of '__builtin_memcpy' must be non-null
# 1297|   
# 1298|           if (wrapper_size == create_riff_header (wpc, WavpackGetSampleIndex64 (wpc), riff_header))
# 1299|->             memcpy (WavpackGetWrapperLocation (first_block, NULL), riff_header, wrapper_size);
# 1300|       }
# 1301|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def216]
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_utils.c: scope_hint: In function 'worker_threads_create'
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_utils.c:1841:36: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL '*wpc.workers'
wavpack-5.7.0-build/wavpack-5.7.0/src/pack_utils.c:1835:9: note: in expansion of macro 'wp_mutex_init'
# 1839|   
# 1840|           for (i = 0; i < wpc->num_workers; ++i) {
# 1841|->             wpc->workers [i].mutex = &wpc->mutex;
# 1842|               wpc->workers [i].global_cond = &wpc->global_cond;
# 1843|               wpc->workers [i].workers_ready = &wpc->workers_ready;

Error: CPPCHECK_WARNING: [#def217]
wavpack-5.7.0-build/wavpack-5.7.0/src/read_words.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def218]
wavpack-5.7.0-build/wavpack-5.7.0/src/tag_utils.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def219]
wavpack-5.7.0-build/wavpack-5.7.0/src/tag_utils.c:471:13: warning[deadcode.DeadStores]: Value stored to 'result' is never read
#  469|               m_tag->ape_tag_hdr.flags |= APE_TAG_THIS_IS_HEADER;
#  470|               WavpackNativeToLittleEndian (&m_tag->ape_tag_hdr, APE_Tag_Hdr_Format);
#  471|->             result = wpc->blockout (wpc->wv_out, &m_tag->ape_tag_hdr, sizeof (m_tag->ape_tag_hdr));
#  472|               WavpackLittleEndianToNative (&m_tag->ape_tag_hdr, APE_Tag_Hdr_Format);
#  473|           }

Error: CLANG_WARNING: [#def220]
wavpack-5.7.0-build/wavpack-5.7.0/src/tag_utils.c:476:13: warning[deadcode.DeadStores]: Value stored to 'result' is never read
#  474|   
#  475|           if (m_tag->ape_tag_hdr.length > sizeof (m_tag->ape_tag_hdr))
#  476|->             result = wpc->blockout (wpc->wv_out, m_tag->ape_tag_data, m_tag->ape_tag_hdr.length - sizeof (m_tag->ape_tag_hdr));
#  477|   
#  478|           m_tag->ape_tag_hdr.flags &= ~APE_TAG_THIS_IS_HEADER;    // this is NOT header

Error: CLANG_WARNING: [#def221]
wavpack-5.7.0-build/wavpack-5.7.0/src/tag_utils.c:538:13: warning[deadcode.DeadStores]: Value stored to 'result' is never read
#  536|               m_tag->ape_tag_hdr.flags |= APE_TAG_THIS_IS_HEADER;
#  537|               WavpackNativeToLittleEndian (&m_tag->ape_tag_hdr, APE_Tag_Hdr_Format);
#  538|->             result = (wpc->reader->write_bytes (wpc->wv_in, &m_tag->ape_tag_hdr, sizeof (m_tag->ape_tag_hdr)) == sizeof (m_tag->ape_tag_hdr));
#  539|               WavpackLittleEndianToNative (&m_tag->ape_tag_hdr, APE_Tag_Hdr_Format);
#  540|           }

Error: CLANG_WARNING: [#def222]
wavpack-5.7.0-build/wavpack-5.7.0/src/tag_utils.c:542:9: warning[deadcode.DeadStores]: Value stored to 'result' is never read
#  540|           }
#  541|   
#  542|->         result = (wpc->reader->write_bytes (wpc->wv_in, m_tag->ape_tag_data, m_tag->ape_tag_hdr.length - sizeof (m_tag->ape_tag_hdr)) == sizeof (m_tag->ape_tag_hdr));
#  543|           m_tag->ape_tag_hdr.flags &= ~APE_TAG_THIS_IS_HEADER;    // this is NOT header
#  544|           WavpackNativeToLittleEndian (&m_tag->ape_tag_hdr, APE_Tag_Hdr_Format);

Error: CPPCHECK_WARNING: [#def223]
wavpack-5.7.0-build/wavpack-5.7.0/src/tags.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def224]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING (CWE-758): [#def225]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack.c:250: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  248|   
#  249|                   temp = apply_weight (dpp->weight_A, sam) + read_word;
#  250|->                 update_weight (dpp->weight_A, dpp->delta, sam, read_word);
#  251|                   dpp->samples_A [k] = read_word = temp;
#  252|               }

Error: CPPCHECK_WARNING (CWE-758): [#def226]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack.c:366: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  364|                       right2 = apply_weight (dpp->weight_B, sam_B) + right;
#  365|   
#  366|->                     update_weight (dpp->weight_A, dpp->delta, sam_A, left);
#  367|                       update_weight (dpp->weight_B, dpp->delta, sam_B, right);
#  368|   

Error: CPPCHECK_WARNING (CWE-758): [#def227]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack.c:367: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  365|   
#  366|                       update_weight (dpp->weight_A, dpp->delta, sam_A, left);
#  367|->                     update_weight (dpp->weight_B, dpp->delta, sam_B, right);
#  368|   
#  369|                       dpp->samples_A [k] = left = left2;

Error: CPPCHECK_WARNING (CWE-758): [#def228]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack.c:374: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  372|                   else if (dpp->term == -1) {
#  373|                       left2 = left + apply_weight (dpp->weight_A, dpp->samples_A [0]);
#  374|->                     update_weight_clip (dpp->weight_A, dpp->delta, dpp->samples_A [0], left);
#  375|                       left = left2;
#  376|                       right2 = right + apply_weight (dpp->weight_B, left2);

Error: CPPCHECK_WARNING (CWE-758): [#def229]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack.c:377: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  375|                       left = left2;
#  376|                       right2 = right + apply_weight (dpp->weight_B, left2);
#  377|->                     update_weight_clip (dpp->weight_B, dpp->delta, left2, right);
#  378|                       dpp->samples_A [0] = right = right2;
#  379|                   }

Error: CPPCHECK_WARNING (CWE-758): [#def230]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack.c:382: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  380|                   else {
#  381|                       right2 = right + apply_weight (dpp->weight_B, dpp->samples_B [0]);
#  382|->                     update_weight_clip (dpp->weight_B, dpp->delta, dpp->samples_B [0], right);
#  383|                       right = right2;
#  384|   

Error: CPPCHECK_WARNING (CWE-758): [#def231]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack.c:391: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  389|   
#  390|                       left2 = left + apply_weight (dpp->weight_A, right2);
#  391|->                     update_weight_clip (dpp->weight_A, dpp->delta, right2, left);
#  392|                       dpp->samples_B [0] = left = left2;
#  393|                   }

Error: CPPCHECK_WARNING (CWE-758): [#def232]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack.c:536: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  534|                   dpp->samples_A [1] = dpp->samples_A [0];
#  535|                   dpp->samples_A [0] = apply_weight (weight_A, sam_A) + bptr [0];
#  536|->                 update_weight (weight_A, delta, sam_A, bptr [0]);
#  537|                   bptr [0] = dpp->samples_A [0];
#  538|               }

Error: CPPCHECK_WARNING (CWE-758): [#def233]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack.c:547: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  545|                   dpp->samples_A [1] = dpp->samples_A [0];
#  546|                   dpp->samples_A [0] = apply_weight (weight_A, sam_A) + bptr [0];
#  547|->                 update_weight (weight_A, delta, sam_A, bptr [0]);
#  548|                   bptr [0] = dpp->samples_A [0];
#  549|               }

Error: CPPCHECK_WARNING (CWE-758): [#def234]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack.c:557: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  555|                   sam_A = dpp->samples_A [m];
#  556|                   dpp->samples_A [k] = apply_weight (weight_A, sam_A) + bptr [0];
#  557|->                 update_weight (weight_A, delta, sam_A, bptr [0]);
#  558|                   bptr [0] = dpp->samples_A [k];
#  559|                   m = (m + 1) & (MAX_TERM - 1);

Error: CPPCHECK_WARNING (CWE-758): [#def235]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack.c:598: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  596|                   dpp->samples_A [1] = dpp->samples_A [0];
#  597|                   bptr [0] = dpp->samples_A [0] = apply_weight (dpp->weight_A, sam) + (tmp = bptr [0]);
#  598|->                 update_weight (dpp->weight_A, dpp->delta, sam, tmp);
#  599|   
#  600|                   sam = 2 * dpp->samples_B [0] - dpp->samples_B [1];

Error: CPPCHECK_WARNING (CWE-758): [#def236]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack.c:603: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  601|                   dpp->samples_B [1] = dpp->samples_B [0];
#  602|                   bptr [1] = dpp->samples_B [0] = apply_weight (dpp->weight_B, sam) + (tmp = bptr [1]);
#  603|->                 update_weight (dpp->weight_B, dpp->delta, sam, tmp);
#  604|               }
#  605|   

Error: CPPCHECK_WARNING (CWE-758): [#def237]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack.c:615: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  613|                   dpp->samples_A [1] = dpp->samples_A [0];
#  614|                   bptr [0] = dpp->samples_A [0] = apply_weight (dpp->weight_A, sam) + (tmp = bptr [0]);
#  615|->                 update_weight (dpp->weight_A, dpp->delta, sam, tmp);
#  616|   
#  617|                   sam = dpp->samples_B [0] + ((dpp->samples_B [0] - dpp->samples_B [1]) >> 1);

Error: CPPCHECK_WARNING (CWE-758): [#def238]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack.c:620: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  618|                   dpp->samples_B [1] = dpp->samples_B [0];
#  619|                   bptr [1] = dpp->samples_B [0] = apply_weight (dpp->weight_B, sam) + (tmp = bptr [1]);
#  620|->                 update_weight (dpp->weight_B, dpp->delta, sam, tmp);
#  621|               }
#  622|   

Error: CPPCHECK_WARNING (CWE-758): [#def239]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack.c:631: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  629|                   sam = dpp->samples_A [m];
#  630|                   dpp->samples_A [k] = apply_weight (dpp->weight_A, sam) + bptr [0];
#  631|->                 update_weight (dpp->weight_A, dpp->delta, sam, bptr [0]);
#  632|                   bptr [0] = dpp->samples_A [k];
#  633|   

Error: CPPCHECK_WARNING (CWE-758): [#def240]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack.c:636: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  634|                   sam = dpp->samples_B [m];
#  635|                   dpp->samples_B [k] = apply_weight (dpp->weight_B, sam) + bptr [1];
#  636|->                 update_weight (dpp->weight_B, dpp->delta, sam, bptr [1]);
#  637|                   bptr [1] = dpp->samples_B [k];
#  638|   

Error: CPPCHECK_WARNING (CWE-758): [#def241]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack.c:650: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  648|   
#  649|                   sam = bptr [0] + apply_weight (dpp->weight_A, dpp->samples_A [0]);
#  650|->                 update_weight_clip (dpp->weight_A, dpp->delta, dpp->samples_A [0], bptr [0]);
#  651|                   bptr [0] = sam;
#  652|                   dpp->samples_A [0] = bptr [1] + apply_weight (dpp->weight_B, sam);

Error: CPPCHECK_WARNING (CWE-758): [#def242]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack.c:653: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  651|                   bptr [0] = sam;
#  652|                   dpp->samples_A [0] = bptr [1] + apply_weight (dpp->weight_B, sam);
#  653|->                 update_weight_clip (dpp->weight_B, dpp->delta, sam, bptr [1]);
#  654|                   bptr [1] = dpp->samples_A [0];
#  655|               }

Error: CPPCHECK_WARNING (CWE-758): [#def243]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack.c:664: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  662|   
#  663|                   sam = bptr [1] + apply_weight (dpp->weight_B, dpp->samples_B [0]);
#  664|->                 update_weight_clip (dpp->weight_B, dpp->delta, dpp->samples_B [0], bptr [1]);
#  665|                   bptr [1] = sam;
#  666|                   dpp->samples_B [0] = bptr [0] + apply_weight (dpp->weight_A, sam);

Error: CPPCHECK_WARNING (CWE-758): [#def244]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack.c:667: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  665|                   bptr [1] = sam;
#  666|                   dpp->samples_B [0] = bptr [0] + apply_weight (dpp->weight_A, sam);
#  667|->                 update_weight_clip (dpp->weight_A, dpp->delta, sam, bptr [0]);
#  668|                   bptr [0] = dpp->samples_B [0];
#  669|               }

Error: CPPCHECK_WARNING (CWE-758): [#def245]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack.c:678: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  676|   
#  677|                   sam_A = bptr [0] + apply_weight (dpp->weight_A, dpp->samples_A [0]);
#  678|->                 update_weight_clip (dpp->weight_A, dpp->delta, dpp->samples_A [0], bptr [0]);
#  679|                   sam_B = bptr [1] + apply_weight (dpp->weight_B, dpp->samples_B [0]);
#  680|                   update_weight_clip (dpp->weight_B, dpp->delta, dpp->samples_B [0], bptr [1]);

Error: CPPCHECK_WARNING (CWE-758): [#def246]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack.c:680: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  678|                   update_weight_clip (dpp->weight_A, dpp->delta, dpp->samples_A [0], bptr [0]);
#  679|                   sam_B = bptr [1] + apply_weight (dpp->weight_B, dpp->samples_B [0]);
#  680|->                 update_weight_clip (dpp->weight_B, dpp->delta, dpp->samples_B [0], bptr [1]);
#  681|                   bptr [0] = dpp->samples_B [0] = sam_A;
#  682|                   bptr [1] = dpp->samples_A [0] = sam_B;

Error: CLANG_WARNING: [#def247]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack.c:727:29: warning[core.BitwiseShift]: Left shift overflows the capacity of 'uint32_t'
#  725|   
#  726|                           if (width <= max_width || (bits_to_read -= width - max_width) > 0) {
#  727|->                             getbits (&data, bits_to_read, &wps->wvxbits);
#  728|                               data &= (1U << bits_to_read) - 1;
#  729|                               *dptr = (((uint32_t) *dptr << bits_to_read) | data) << (sent_bits - bits_to_read);

Error: CLANG_WARNING: [#def248]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack.c:735:25: warning[core.BitwiseShift]: Left shift overflows the capacity of 'uint32_t'
#  733|                       }
#  734|                       else {
#  735|->                         getbits (&data, sent_bits, &wps->wvxbits);
#  736|                           *dptr = ((uint32_t) *dptr << sent_bits) | (data & mask);
#  737|                       }

Error: CPPCHECK_WARNING: [#def249]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack_dsd.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-688): [#def250]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack_dsd.c: scope_hint: In function 'init_dsd_block_fast'
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack_dsd.c:159:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL '*wps.dsd.value_lookup' where non-null expected
<built-in>: note: argument 1 of '__builtin_memset' must be non-null
#  157|       lb_ptr = wps->dsd.lookup_buffer = (unsigned char *)malloc (wps->dsd.history_bins * MAX_BYTES_PER_BIN);
#  158|       wps->dsd.value_lookup = (unsigned char **)malloc (sizeof (*wps->dsd.value_lookup) * wps->dsd.history_bins);
#  159|->     memset (wps->dsd.value_lookup, 0, sizeof (*wps->dsd.value_lookup) * wps->dsd.history_bins);
#  160|       wps->dsd.summed_probabilities = (uint16_t (*)[256])malloc (sizeof (*wps->dsd.summed_probabilities) * wps->dsd.history_bins);
#  161|       wps->dsd.probabilities = (unsigned char (*)[256])malloc (sizeof (*wps->dsd.probabilities) * wps->dsd.history_bins);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def251]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack_dsd.c:176:31: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'outptr'
#  174|   
#  175|                   while (outptr < outend && zcount--)
#  176|->                     *outptr++ = 0;
#  177|               }
#  178|               else if (code)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def252]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack_dsd.c:179:27: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'outptr'
#  177|               }
#  178|               else if (code)
#  179|->                 *outptr++ = code;
#  180|               else
#  181|                   break;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def253]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack_dsd.c:188:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL '*wps.dsd.probabilities' where non-null expected
<built-in>: note: argument 1 of '__builtin_memcpy' must be non-null
#  186|       }
#  187|       else if (wps->dsd.endptr - wps->dsd.byteptr > (int) sizeof (*wps->dsd.probabilities) * wps->dsd.history_bins) {
#  188|->         memcpy (wps->dsd.probabilities, wps->dsd.byteptr, sizeof (*wps->dsd.probabilities) * wps->dsd.history_bins);
#  189|           wps->dsd.byteptr += sizeof (*wps->dsd.probabilities) * wps->dsd.history_bins;
#  190|       }

Error: CLANG_WARNING: [#def254]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack_dsd.c:198:65: warning[core.uninitialized.Assign]: Assigned value is garbage or undefined
#  196|   
#  197|           for (sum_values = i = 0; i < 256; ++i)
#  198|->             wps->dsd.summed_probabilities [bi] [i] = sum_values += wps->dsd.probabilities [bi] [i];
#  199|   
#  200|           if (sum_values) {

Error: GCC_ANALYZER_WARNING (CWE-457): [#def255]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack_dsd.c:198:96: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value '*<unknown>[i]'
#  196|   
#  197|           for (sum_values = i = 0; i < 256; ++i)
#  198|->             wps->dsd.summed_probabilities [bi] [i] = sum_values += wps->dsd.probabilities [bi] [i];
#  199|   
#  200|           if (sum_values) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def256]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack_dsd.c: scope_hint: In function 'init_ptable'
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack_dsd.c:308:19: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'table'
#  306|   
#  307|       for (i = 0; i < PTABLE_BINS/2; ++i) {
#  308|->         table [i] = value;
#  309|           table [PTABLE_BINS-1-i] = 0x100ffff - value;
#  310|   

Error: CPPCHECK_WARNING (CWE-758): [#def257]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack_dsd.c:400: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  398|               sp [0].value += sp [0].filter6 * 8;
#  399|               sp [0].byte = (sp [0].byte << 1) | (sp [0].filter0 & 1);
#  400|->             sp [0].factor += (((sp [0].value ^ sp [0].filter0) >> 31) | 1) & ((sp [0].value ^ (sp [0].value - (sp [0].filter6 * 16))) >> 31);
#  401|               sp [0].filter1 += ((sp [0].filter0 & VALUE_ONE) - sp [0].filter1) >> 6;
#  402|               sp [0].filter2 += ((sp [0].filter0 & VALUE_ONE) - sp [0].filter2) >> 4;

Error: CPPCHECK_WARNING (CWE-758): [#def258]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack_dsd.c:435: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  433|               sp [1].value += sp [1].filter6 * 8;
#  434|               sp [1].byte = (sp [1].byte << 1) | (sp [1].filter0 & 1);
#  435|->             sp [1].factor += (((sp [1].value ^ sp [1].filter0) >> 31) | 1) & ((sp [1].value ^ (sp [1].value - (sp [1].filter6 * 16))) >> 31);
#  436|               sp [1].filter1 += ((sp [1].filter0 & VALUE_ONE) - sp [1].filter1) >> 6;
#  437|               sp [1].filter2 += ((sp [1].filter0 & VALUE_ONE) - sp [1].filter2) >> 4;

Error: CPPCHECK_WARNING: [#def259]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack_floats.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def260]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack_floats.c:93:29: warning[core.BitwiseShift]: Left shift overflows the capacity of 'uint32_t'
#   91|   
#   92|                           if ((shift_count -= num_zeros) > 0) {
#   93|->                             getbits (&temp, shift_count, &wps->wvxbits);
#   94|                               *values |= (temp << num_zeros) & mask;
#   95|                           }

Error: CPPCHECK_WARNING (CWE-758): [#def261]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack_floats.c:104: error[shiftTooManyBitsSigned]: Shifting signed 32-bit value by 31 bits is undefined behaviour
#  102|           }
#  103|   
#  104|->         crc = crc * 27 + get_mantissa (outval) * 9 + get_exponent (outval) * 3 + get_sign (outval);
#  105|           * (f32 *) values++ = outval;
#  106|       }

Error: CPPCHECK_WARNING: [#def262]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack_seek.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def263]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack_seek.c:68:10: warning[core.NullDereference]: Dereference of null pointer
#   66|   #endif
#   67|   
#   68|->     if (!wps->wphdr.block_samples || !(wps->wphdr.flags & INITIAL_BLOCK) || sample < GET_BLOCK_INDEX (wps->wphdr) ||
#   69|           sample >= GET_BLOCK_INDEX (wps->wphdr) + wps->wphdr.block_samples) {
#   70|   

Error: COMPILER_WARNING: [#def264]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack_seek.c: scope_hint: In function 'find_header'
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack_seek.c:306:59: warning[-Wuse-after-free]: pointer 'ep_95' used after 'free'
#  306 |                         return reader->get_pos (id) - (ep - sp + 4);
#      |                                                        ~~~^~~~
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack_seek.c:305:25: note: call to 'free' here
#  305 |                         free (buffer);
#      |                         ^~~~~~~~~~~~~
#  304|                       if (wphdr->block_samples && (wphdr->flags & INITIAL_BLOCK)) {
#  305|                           free (buffer);
#  306|->                         return reader->get_pos (id) - (ep - sp + 4);
#  307|                       }
#  308|   

Error: CPPCHECK_WARNING: [#def265]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack_utils.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def266]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack_utils.c: scope_hint: In function 'unpack_samples_interleave'
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack_utils.c:68:23: warning[-Wanalyzer-null-dereference]: dereference of NULL 'src'
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack_utils.c:19: included_from: Included from here.
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack_utils.c:504:9: note: in expansion of macro 'wp_mutex_release'
#   66|       if (wps->wphdr.flags & MONO_FLAG) {
#   67|           while (samcnt--) {
#   68|->             dst [0] = *src++;
#   69|               dst += num_channels;
#   70|           }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def267]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack_utils.c:77:27: warning[-Wanalyzer-null-dereference]: dereference of NULL 'src'
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack_utils.c:504:9: note: in expansion of macro 'wp_mutex_release'
#   75|       else if (offset == num_channels - 1) {
#   76|           while (samcnt--) {
#   77|->             dst [0] = src [0];
#   78|               dst += num_channels;
#   79|               src += 2;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def268]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack_utils.c:87:23: warning[-Wanalyzer-null-dereference]: dereference of NULL 'src'
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack_utils.c:504:9: note: in expansion of macro 'wp_mutex_release'
#   85|       else {
#   86|           while (samcnt--) {
#   87|->             dst [0] = *src++;
#   88|               dst [1] = *src++;
#   89|               dst += num_channels;

Error: CLANG_WARNING: [#def269]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack_utils.c:381:21: warning[core.NullDereference]: Dereference of null pointer
#  379|   
#  380|               if (offset != num_channels) {
#  381|->                 if (wps->wphdr.flags & DSD_FLAG) {
#  382|                       int samples_to_zero = samples_to_unpack * num_channels;
#  383|                       int32_t *zptr = bptr;

Error: CLANG_WARNING: [#def270]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack_utils.c:396:19: warning[core.NullDereference]: Array access (via field 'streams') results in a null pointer dereference
#  394|               // go back to the first stream (we're going to leave them all loaded for now because they might have more samples)
#  395|   
#  396|->             wps = wpc->streams [stream_index = 0];
#  397|           }
#  398|           // catch the error situation where we have only one channel but run into a stereo block

Error: CLANG_WARNING: [#def271]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack_utils.c:396:33: warning[deadcode.DeadStores]: Although the value stored to 'stream_index' is used in the enclosing expression, the value is never actually read from 'stream_index'
#  394|               // go back to the first stream (we're going to leave them all loaded for now because they might have more samples)
#  395|   
#  396|->             wps = wpc->streams [stream_index = 0];
#  397|           }
#  398|           // catch the error situation where we have only one channel but run into a stereo block

Error: CPPCHECK_WARNING (CWE-401): [#def272]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack_utils.c:510: error[memleakOnRealloc]: Common realloc mistake: 'temp_buffer' nulled but not freed upon failure
#  508|   
#  509|           if (cxt->samcnt > temp_samples)             // reallocate temp buffer if not big enough
#  510|->             temp_buffer = (int32_t *) realloc (temp_buffer, (temp_samples = cxt->samcnt) * 8);
#  511|   
#  512|           // this is where the work is done

Error: GCC_ANALYZER_WARNING (CWE-476): [#def273]
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack_utils.c: scope_hint: In function 'worker_threads_create'
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack_utils.c:594:36: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL '*wpc.workers'
wavpack-5.7.0-build/wavpack-5.7.0/src/unpack_utils.c:588:9: note: in expansion of macro 'wp_mutex_init'
#  592|   
#  593|           for (i = 0; i < wpc->num_workers; ++i) {
#  594|->             wpc->workers [i].mutex = &wpc->mutex;
#  595|               wpc->workers [i].global_cond = &wpc->global_cond;
#  596|               wpc->workers [i].workers_ready = &wpc->workers_ready;

Error: CPPCHECK_WARNING: [#def274]
wavpack-5.7.0-build/wavpack-5.7.0/src/write_words.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def275]
wavpack-5.7.0-build/wavpack-5.7.0/src/write_words.c:431:59: warning[core.BitwiseShift]: Right operand is negative in left shift
#  429|                   wps->w.pend_data |= ((code + extras) >> 1) << wps->w.pend_count;
#  430|                   wps->w.pend_count += bitcount - 1;
#  431|->                 wps->w.pend_data |= ((code + extras) & 1) << wps->w.pend_count++;
#  432|               }
#  433|           }

Error: CLANG_WARNING: [#def276]
wavpack-5.7.0-build/wavpack-5.7.0/src/write_words.c:435:45: warning[core.BitwiseShift]: Right operand is negative in left shift
#  433|           }
#  434|   
#  435|->         wps->w.pend_data |= ((int32_t) sign << wps->w.pend_count++);
#  436|   
#  437|           if (!wps->w.holding_zero)

Error: CLANG_WARNING: [#def277]
wavpack-5.7.0-build/wavpack-5.7.0/src/write_words.c:604:32: warning[deadcode.DeadStores]: Although the value stored to 'chan' is used in the enclosing expression, the value is never actually read from 'chan'
#  602|       while (num_samples--) {
#  603|   
#  604|->         value = labs (samples [chan = 0]);
#  605|   
#  606|           if (flags & HYBRID_BITRATE) {

Error: CLANG_WARNING: [#def278]
wavpack-5.7.0-build/wavpack-5.7.0/src/write_words.c:635:36: warning[deadcode.DeadStores]: Although the value stored to 'chan' is used in the enclosing expression, the value is never actually read from 'chan'
#  633|   
#  634|           if (!(flags & MONO_DATA)) {
#  635|->             value = labs (samples [chan = 1]);
#  636|               c++;
#  637|   

Scan Properties

analyzer-version-clang18.1.7
analyzer-version-cppcheck2.14.2
analyzer-version-gcc14.1.1
analyzer-version-gcc-analyzer14.1.1
analyzer-version-shellcheck0.10.0
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-176.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-namewavpack-5.7.0-1.fc41
store-results-to/tmp/tmp_uza3psp/wavpack-5.7.0-1.fc41.tar.xz
time-created2024-07-03 18:25:02
time-finished2024-07-03 18:26:34
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmp_uza3psp/wavpack-5.7.0-1.fc41.tar.xz' '--gcc-analyze' '/tmp/tmp_uza3psp/wavpack-5.7.0-1.fc41.src.rpm'
tool-versioncsmock-3.5.3-1.el9