Newly introduced findings

List of Findings

Error: COMPILER_WARNING: [#def1]
MediaInfoLib/Source/MediaInfo/Archive/File_Mz.cpp: scope_hint: In member function ‘void MediaInfoLib::File_Mz::Parse_Resources()’
MediaInfoLib/Source/MediaInfo/Archive/File_Mz.cpp:578:21: warning[-Wrange-loop-construct]: loop variable ‘directory_offset’ of type ‘const int&’ binds to a temporary constructed from type ‘unsigned int’
#  578 |     for (const int& directory_offset : OffsetToDirectories) {
#      |                     ^~~~~~~~~~~~~~~~
MediaInfoLib/Source/MediaInfo/Archive/File_Mz.cpp:578:21: note: use non-reference type ‘const int’ to make the copy explicit or ‘const unsigned int&’ to prevent copying
#  576|           

#  577|       }

#  578|->     for (const int& directory_offset : OffsetToDirectories) {

#  579|           Element_Offset = directory_offset;

#  580|           if (Element_Offset > Element_Size) Element_Offset = Element_Size;


Error: COMPILER_WARNING: [#def2]
MediaInfoLib/Source/MediaInfo/Archive/File_Mz.cpp:584:21: warning[-Wrange-loop-construct]: loop variable ‘data_offset’ of type ‘const int&’ binds to a temporary constructed from type ‘unsigned int’
#  584 |     for (const int& data_offset : OffsetsToData) {
#      |                     ^~~~~~~~~~~
MediaInfoLib/Source/MediaInfo/Archive/File_Mz.cpp:584:21: note: use non-reference type ‘const int’ to make the copy explicit or ‘const unsigned int&’ to prevent copying
#  582|       }

#  583|       auto rsrc = to_parse[State::Resources];

#  584|->     for (const int& data_offset : OffsetsToData) {

#  585|           Element_Offset = data_offset;

#  586|           if (Element_Offset > Element_Size) Element_Offset = Element_Size;


Error: COMPILER_WARNING (CWE-457): [#def3]
MediaInfoLib/Source/MediaInfo/Audio/File_Ac4.cpp: scope_hint: In member function ‘MediaInfoLib::File_Ac4::Streams_Fill()’
MediaInfoLib/Source/MediaInfo/Audio/File_Ac4.cpp:1814:51: warning[-Wmaybe-uninitialized]: ‘n_objects’ may be used uninitialized
# 1814 |                             if (!GroupInfo.b_ajoc && n_objects>num_channels_in_bed)
#      |                                 ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MediaInfoLib/Source/MediaInfo/Audio/File_Ac4.cpp:1798:31: note: ‘n_objects’ was declared here
# 1798 |                         int8u n_objects;
#      |                               ^~~~~~~~~
# 1812|                               Ztring BedChannelConfiguration=AC4_nonstd_bed_channel_assignment_mask_ChannelLayout(GroupInfo.nonstd_bed_channel_assignment_mask, Groups.size());

# 1813|                               int8u num_channels_in_bed=AC4_nonstd_bed_channel_assignment_mask_2_num_channels_in_bed(GroupInfo.nonstd_bed_channel_assignment_mask);

# 1814|->                             if (!GroupInfo.b_ajoc && n_objects>num_channels_in_bed)

# 1815|                                   Fill_Dup(Stream_Audio, 0, (S+" NumberOfDynamicObjects").c_str(), Ztring::ToZtring(n_objects-num_channels_in_bed));

# 1816|                               Fill_Dup(Stream_Audio, 0, (S+" BedChannelCount").c_str(), Ztring::ToZtring(num_channels_in_bed));


Error: COMPILER_WARNING (CWE-9001): [#def4]
MediaInfoLib/Source/MediaInfo/Audio/File_Adm.cpp:3387: warning[-Wunknown-pragmas]: ignoring ‘#pragma warning ’
# 3387 |                 #pragma warning(suppress: 6297, justification: "shifting k by 2 will not overflow an int")
# 3385|               // Handling generic errors from arrays

# 3386|               for (int k = 0; k < Info_Flag_Max; k++) {

# 3387|->                 #pragma warning(suppress: 6297, justification: "shifting k by 2 will not overflow an int")

# 3388|                   if (!Info.Flags[Count0 + Count_Max1 + (k << 2)]) {

# 3389|                       Item.AddError(Error, 0x80 | (int8u)j, E((unsigned)E::Present0 + Count_Max1), 0, (source)k);


Error: COMPILER_WARNING (CWE-195): [#def5]
MediaInfoLib/Source/MediaInfo/Audio/File_Adm.cpp: scope_hint: In function ‘void MediaInfoLib::CheckErrors_Elements(file_adm_private*, item)’
MediaInfoLib/Source/MediaInfo/Audio/File_Adm.cpp:3423:18: warning[-Wsign-compare]: comparison of integer expressions of different signedness: ‘MediaInfoLib::type’ and ‘std::size_t’ {aka ‘long unsigned int’}
# 3423 |         if (Type >= size(audioBlockFormat_xxx_Elements)) {
#      |             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 3421|           static const element_items* audioBlockFormat_xxx_Elements[] = { (element_items*)audioBlockFormat_Elements, (element_items*)audioBlockFormat_DirectSpeakers_Elements, (element_items*)audioBlockFormat_Matrix_Elements, (element_items*)audioBlockFormat_Object_Elements };

# 3422|           auto Type = GetType(File_Adm_Private, item_audioChannelFormat, File_Adm_Private->Items[item_audioChannelFormat].Items.size() - 1);

# 3423|->         if (Type >= size(audioBlockFormat_xxx_Elements)) {

# 3424|               Type = Type_Unknown;

# 3425|           }


Error: COMPILER_WARNING (CWE-9001): [#def6]
MediaInfoLib/Source/MediaInfo/Audio/File_Adm.cpp:3440: warning[-Wunknown-pragmas]: ignoring ‘#pragma warning ’
# 3440 |                 #pragma warning(suppress: 6297, justification: "shifting k by 2 will not overflow an int")
# 3438|               // Handling generic errors from arrays

# 3439|               for (int k = 0; k < Info_Flag_Max; k++) {

# 3440|->                 #pragma warning(suppress: 6297, justification: "shifting k by 2 will not overflow an int")

# 3441|                   if (!Info.Flags[Count0 + Count_Max2 + (k << 2)]) {

# 3442|                       Item.AddError(Error, j, E((unsigned)E::Present0 + Count_Max2), Count <= (int8u)-1 ? (int8u)Count : (int8u)-1, (source)k);


Error: COMPILER_WARNING (CWE-9001): [#def7]
MediaInfoLib/Source/MediaInfo/File__Analyze.cpp:3500: warning[-Wunknown-pragmas]: ignoring ‘#pragma warning ’
# 3500 |                 #pragma warning(suppress: 4996, justification: "ensured it is null terminated") //'strncpy': This function or variable may be unsafe.
# 3498|                   std::memset(Event.Name, 0, 16);

# 3499|               if (!ParserName.empty()) {

# 3500|->                 #pragma warning(suppress: 4996, justification: "ensured it is null terminated") //'strncpy': This function or variable may be unsafe.

# 3501|                   strncpy(Event.Name, Ztring().From_UTF8(ParserName).To_Local().c_str(), 15);

# 3502|                   Event.Name[15] = '\0';


Error: COMPILER_WARNING (CWE-195): [#def8]
MediaInfoLib/Source/MediaInfo/File__Analyze_Buffer.cpp: scope_hint: In member function ‘void MediaInfoLib::File__Analyze::Skip_PA(const char*)’
MediaInfoLib/Source/MediaInfo/File__Analyze_Buffer.cpp:52:46: warning[-Wsign-compare]: comparison of integer expressions of different signedness: ‘int’ and ‘ZenLib::int64u’ {aka ‘long long unsigned int’}
#   52 |     if (Element_Offset>Element_Size || _BYTES>Element_Size-Element_Offset) \
#      |                                              ^
MediaInfoLib/Source/MediaInfo/File__Analyze_Buffer.cpp:2047:5: note: in expansion of macro ‘INTEGRITY_SIZE_ATLEAST’
# 2047 |     INTEGRITY_SIZE_ATLEAST(1+Size);
#      |     ^~~~~~~~~~~~~~~~~~~~~~
#   50|   

#   51|   #define INTEGRITY_SIZE_ATLEAST(_BYTES) \

#   52|->     if (Element_Offset>Element_Size || _BYTES>Element_Size-Element_Offset) \

#   53|       { \

#   54|           Trusted_IsNot("Size is wrong"); \


Error: COMPILER_WARNING (CWE-457): [#def9]
MediaInfoLib/Source/MediaInfo/File__Analyze_Element.h:118:18: warning[-Wmaybe-uninitialized]: ‘ID’ may be used uninitialized
#  118 |             data = parameter;
#      |             ~~~~~^~~~~~~~~~~
MediaInfoLib/Source/MediaInfo/Audio/File_Mpegh3da.cpp: scope_hint: In member function ‘MediaInfoLib::File_Mpegh3da::mae_Description(MediaInfoLib::File_Mpegh3da::MaeDataType)’
MediaInfoLib/Source/MediaInfo/Audio/File_Mpegh3da.cpp:1785:15: note: ‘ID’ was declared here
# 1785 |         int8u ID;
#      |               ^~
#  116|           {
#  117|               data.set_Option(Option);
#  118|->             data = parameter;
#  119|               if (_Measure)
#  120|                   Measure = _Measure;

Error: COMPILER_WARNING (CWE-457): [#def10]
MediaInfoLib/Source/MediaInfo/Image/File_Jpeg.cpp: scope_hint: In member function ‘MediaInfoLib::File_Jpeg::Data_Parse()’
MediaInfoLib/Source/MediaInfo/Image/File_Jpeg.cpp:848:152: warning[-Wmaybe-uninitialized]: ‘StreamPos_First’ may be used uninitialized
#  848 |                         Fill(StreamKind_Last, StreamPos_Last, "MuxingMode_MoreInfo", fmt::format("Muxed in {} #{}", StreamKind_String, StreamPos_First + 1));
#      |                                                                                                                                        ~~~~~~~~~~~~~~~~^~~
MediaInfoLib/Source/MediaInfo/Image/File_Jpeg.cpp:813:16: note: ‘StreamPos_First’ was declared here
#  813 |         size_t StreamPos_First;
#      |                ^~~~~~~~~~~~~~~
#  846|                       }

#  847|                       if (StreamKind_String) {

#  848|->                         Fill(StreamKind_Last, StreamPos_Last, "MuxingMode_MoreInfo", fmt::format("Muxed in {} #{}", StreamKind_String, StreamPos_First + 1));

#  849|                       }

#  850|                   }


Error: COMPILER_WARNING (CWE-9001): [#def11]
MediaInfoLib/Source/MediaInfo/File__Analyze.cpp:36: included_from: Included from here.
MediaInfoLib/Source/MediaInfo/MediaInfo_Events_Internal.h:108: warning[-Wunknown-pragmas]: ignoring ‘#pragma warning ’
#  108 |                 #pragma warning(suppress : 4996) //'strcpy': This function or variable may be unsafe.
#  106|               string PCR_HR=Ztring().Duration_From_Milliseconds(PCR/1000000).To_UTF8();

#  107|               if (PCR_HR.size()==12)

#  108|->                 #pragma warning(suppress : 4996) //'strcpy': This function or variable may be unsafe.

#  109|                   strcpy(Event_PCR_HR, PCR_HR.c_str());

#  110|               else


Error: COMPILER_WARNING (CWE-9001): [#def12]
MediaInfoLib/Source/MediaInfo/MediaInfo_Events_Internal.h:124: warning[-Wunknown-pragmas]: ignoring ‘#pragma warning ’
#  124 |                 #pragma warning(suppress : 4996) //'strcpy': This function or variable may be unsafe.
#  122|               string PTS_HR=Ztring().Duration_From_Milliseconds(PTS/1000000).To_UTF8();

#  123|               if (PTS_HR.size()==12)

#  124|->                 #pragma warning(suppress : 4996) //'strcpy': This function or variable may be unsafe.

#  125|                   strcpy(Event_PTS_HR, PTS_HR.c_str());

#  126|               else


Error: COMPILER_WARNING (CWE-9001): [#def13]
MediaInfoLib/Source/MediaInfo/MediaInfo_Events_Internal.h:140: warning[-Wunknown-pragmas]: ignoring ‘#pragma warning ’
#  140 |                 #pragma warning(suppress : 4996) //'strcpy': This function or variable may be unsafe.
#  138|               string DTS_HR=Ztring().Duration_From_Milliseconds(DTS/1000000).To_UTF8();

#  139|               if (DTS_HR.size()==12)

#  140|->                 #pragma warning(suppress : 4996) //'strcpy': This function or variable may be unsafe.

#  141|                   strcpy(Event_DTS_HR, DTS_HR.c_str());

#  142|               else


Error: COMPILER_WARNING (CWE-9001): [#def14]
MediaInfoLib/Source/MediaInfo/Multiple/File_Mpeg4_Elements.cpp:1126: warning[-Wunknown-pragmas]: ignoring ‘#pragma warning ’
# 1126 |     #pragma warning(push)
# 1124|   void File_Mpeg4::Data_Parse()

# 1125|   {

# 1126|->     #pragma warning(push)

# 1127|       #pragma warning(disable: 4065) // switch statement contains 'default' but no 'case' labels

# 1128|   


Error: COMPILER_WARNING (CWE-9001): [#def15]
MediaInfoLib/Source/MediaInfo/Multiple/File_Mpeg4_Elements.cpp:1127: warning[-Wunknown-pragmas]: ignoring ‘#pragma warning ’
# 1127 |     #pragma warning(disable: 4065) // switch statement contains 'default' but no 'case' labels
# 1125|   {

# 1126|       #pragma warning(push)

# 1127|->     #pragma warning(disable: 4065) // switch statement contains 'default' but no 'case' labels

# 1128|   

# 1129|       //mdat


Error: COMPILER_WARNING (CWE-9001): [#def16]
MediaInfoLib/Source/MediaInfo/Multiple/File_Mpeg4_Elements.cpp:1611: warning[-Wunknown-pragmas]: ignoring ‘#pragma warning ’
# 1611 |     #pragma warning(pop)
# 1609|       DATA_END

# 1610|   

# 1611|->     #pragma warning(pop)

# 1612|   }

# 1613|   


Error: COMPILER_WARNING (CWE-9001): [#def17]
MediaInfoLib/Source/MediaInfo/Multiple/File_Mxf.cpp:127: warning[-Wunknown-pragmas]: ignoring ‘#pragma warning ’
#  127 | #pragma warning(disable: 4065) // switch statement contains 'default' but no 'case' labels
#  125|   {

#  126|   

#  127|-> #pragma warning(disable: 4065) // switch statement contains 'default' but no 'case' labels

#  128|   

#  129|   #if defined(MEDIAINFO_IAB_YES)


Error: COMPILER_WARNING (CWE-9001): [#def18]
MediaInfoLib/Source/MediaInfo/Reader/Reader_libcurl.cpp:823: warning[-Wunknown-pragmas]: ignoring ‘#pragma warning ’
#  823 |         #pragma warning(suppress : 4996) //'getenv': This function or variable may be unsafe.
#  821|           return false; //Environment is not aviable

#  822|       #else

#  823|->         #pragma warning(suppress : 4996) //'getenv': This function or variable may be unsafe.

#  824|           return getenv("HOME")?true:false;

#  825|       #endif


Error: COMPILER_WARNING (CWE-9001): [#def19]
MediaInfoLib/Source/MediaInfo/Reader/Reader_libcurl.cpp:836: warning[-Wunknown-pragmas]: ignoring ‘#pragma warning ’
#  836 |             #pragma warning(suppress : 4996) //'getenv': This function or variable may be unsafe.
#  834|           if (FileName_Modified.find(__T("$HOME"))==0)

#  835|           {

#  836|->             #pragma warning(suppress : 4996) //'getenv': This function or variable may be unsafe.

#  837|               char* env=getenv("HOME");

#  838|               if (env)


Error: COMPILER_WARNING (CWE-9001): [#def20]
MediaInfoLib/Source/MediaInfo/Reader/Reader_libcurl.cpp:843: warning[-Wunknown-pragmas]: ignoring ‘#pragma warning ’
#  843 |             #pragma warning(suppress : 4996) //'getenv': This function or variable may be unsafe.
#  841|           if (FileName_Modified.find(__T('~'))==0)

#  842|           {

#  843|->             #pragma warning(suppress : 4996) //'getenv': This function or variable may be unsafe.

#  844|               char* env=getenv("HOME");

#  845|               if (env)


Error: COMPILER_WARNING (CWE-9001): [#def21]
MediaInfoLib/Source/MediaInfo/Tag/File_C2pa.cpp:221: warning[-Wunknown-pragmas]: ignoring ‘#pragma warning ’
#  221 |     #pragma warning(push)
#  219|   void File_C2pa::Data_Parse()

#  220|   {

#  221|->     #pragma warning(push)

#  222|       #pragma warning(disable: 4065) // switch statement contains 'default' but no 'case' labels

#  223|   


Error: COMPILER_WARNING (CWE-9001): [#def22]
MediaInfoLib/Source/MediaInfo/Tag/File_C2pa.cpp:222: warning[-Wunknown-pragmas]: ignoring ‘#pragma warning ’
#  222 |     #pragma warning(disable: 4065) // switch statement contains 'default' but no 'case' labels
#  220|   {

#  221|       #pragma warning(push)

#  222|->     #pragma warning(disable: 4065) // switch statement contains 'default' but no 'case' labels

#  223|   

#  224|       //Parsing


Error: COMPILER_WARNING (CWE-9001): [#def23]
MediaInfoLib/Source/MediaInfo/Tag/File_C2pa.cpp:285: warning[-Wunknown-pragmas]: ignoring ‘#pragma warning ’
#  285 |     #pragma warning(pop)
#  283|       DATA_END_DEFAULT

#  284|   

#  285|->     #pragma warning(pop)

#  286|   }

#  287|   


Error: COMPILER_WARNING: [#def24]
MediaInfoLib/Source/MediaInfo/Video/File_Av2.cpp: scope_hint: In member function ‘void MediaInfoLib::File_Av2::tile_params(ZenLib::int16u, ZenLib::int16u, ZenLib::int8u, ZenLib::int8u, bool)’
MediaInfoLib/Source/MediaInfo/Video/File_Av2.cpp:1409:18: warning[-Wunused-but-set-variable=]: variable ‘i’ set but not used
# 1409 |         for (int i = 0; startSb < sbCols; ++i) {
#      |                  ^
# 1407|           auto widestTileSb = 1;
# 1408|           auto startSb = 0;
# 1409|->         for (int i = 0; startSb < sbCols; ++i) {
# 1410|               auto maxWidth = std::min(sbCols - startSb, maxTileWidthSb);
# 1411|               int64u width_in_sbs_minus_1;

Error: COMPILER_WARNING: [#def25]
MediaInfoLib/Source/MediaInfo/Video/File_Av2.cpp:1418:18: warning[-Wunused-but-set-variable=]: variable ‘i’ set but not used
# 1418 |         for (int i = 0; startSb < sbRows; ++i) {
#      |                  ^
# 1416|           }
# 1417|           startSb = 0;
# 1418|->         for (int i = 0; startSb < sbRows; ++i) {
# 1419|               auto maxTileHeightSb = std::max(maxTileAreaSb / widestTileSb, 1);
# 1420|               auto maxHeight = std::min(sbRows - startSb, maxTileHeightSb);

Scan Properties

analyzer-version-clippy1.97.1
analyzer-version-cppcheck2.21.1
analyzer-version-gcc16.1.1
analyzer-version-gcc-analyzer16.1.1
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.97.1
diffbase-analyzer-version-cppcheck2.21.1
diffbase-analyzer-version-gcc16.1.1
diffbase-analyzer-version-gcc-analyzer16.1.1
diffbase-analyzer-version-shellcheck0.11.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-217.us-west-2.compute.internal
diffbase-known-false-positives/usr/share/csmock/known-false-positives.js
diffbase-known-false-positives-rpmknown-false-positives-0.0.0.20260524.213755.g3c6d0be.main-1.el9.noarch
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-namelibmediainfo-25.10-2.fc44
diffbase-store-results-to/tmp/tmp7ay9t2uq/libmediainfo-25.10-2.fc44.tar.xz
diffbase-time-created2026-08-03 17:30:59
diffbase-time-finished2026-08-03 17:38:59
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,clippy,unicontrol,shellcheck,cppcheck' '-o' '/tmp/tmp7ay9t2uq/libmediainfo-25.10-2.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp7ay9t2uq/libmediainfo-25.10-2.fc44.src.rpm'
diffbase-tool-versioncsmock-3.8.7.20260803.142340.gb75b18e-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-217.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20260524.213755.g3c6d0be.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namelibmediainfo-26.05-2.fc45
store-results-to/tmp/tmpvgsaf4xm/libmediainfo-26.05-2.fc45.tar.xz
time-created2026-08-03 17:39:12
time-finished2026-08-03 17:47:37
titleNewly introduced findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,clippy,unicontrol,shellcheck,cppcheck' '-o' '/tmp/tmpvgsaf4xm/libmediainfo-26.05-2.fc45.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpvgsaf4xm/libmediainfo-26.05-2.fc45.src.rpm'
tool-versioncsmock-3.8.7.20260803.142340.gb75b18e-1.el9