Fixed defects

List of Defects

Error: CPPCHECK_WARNING: [#def1]
libvpl-2.10.2-build/libvpl-2.10.2/tools/legacy/metrics_monitor/sample/cttmetrics_sample.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CPPCHECK_WARNING: [#def2]
libvpl-2.10.2-build/libvpl-2.10.2/tools/legacy/metrics_monitor/src/cttmetrics_i915_custom.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def3]
libvpl-2.10.2-build/libvpl-2.10.2/tools/legacy/metrics_monitor/src/cttmetrics_i915_custom.cpp:80:13: warning[deadcode.DeadStores]: Although the value stored to 'ret_in' is used in the enclosing expression, the value is never actually read from 'ret_in'
#   78|   
#   79|       // process the file (may have multiple rings)
#   80|->     while ((ret_in = getline(&buffer, &len, fd)) != -1) {
#   81|           // Get first Token
#   82|           stat = strtok(buffer, delim);

Error: CLANG_WARNING: [#def4]
libvpl-2.10.2-build/libvpl-2.10.2/tools/legacy/metrics_monitor/src/cttmetrics_i915_custom.cpp:161:13: warning[deadcode.DeadStores]: Although the value stored to 'ret_in' is used in the enclosing expression, the value is never actually read from 'ret_in'
#  159|   
#  160|       // process the file (may have multiple rings)
#  161|->     while ((ret_in = getline(&buffer, &len, statfile_fd)) != -1) {
#  162|           // Get first Token
#  163|           stat = strtok(buffer, delim);

Error: CPPCHECK_WARNING: [#def5]
libvpl-2.10.2-build/libvpl-2.10.2/tools/legacy/metrics_monitor/src/cttmetrics_i915_pmu.cpp: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.

Error: CLANG_WARNING: [#def6]
libvpl-2.10.2-build/libvpl-2.10.2/tools/legacy/sample_common/src/avc_bitstream.cpp:7: included_from: Included from here.
libvpl-2.10.2-build/libvpl-2.10.2/tools/legacy/sample_common/include/avc_bitstream.h:179:5: warning[core.BitwiseShift]: Right operand is negative in right shift
#  177|       mfxU32 w, n = nbits;
#  178|   
#  179|->     avcGetNBits(m_pbs, m_bitOffset, n, w);
#  180|       return w;
#  181|   }

Error: COMPILER_WARNING (CWE-477): [#def7]
libvpl-2.10.2-build/libvpl-2.10.2/tools/legacy/sample_common/src/base_allocator.cpp:7: included_from: Included from here.
libvpl-2.10.2-build/libvpl-2.10.2/tools/legacy/sample_common/include/base_allocator.h:165:27: warning[-Wdeprecated-declarations]: ‘template<class _Arg1, class _Arg2, class _Result> struct std::binary_function’ is deprecated
#  165 |             : public std::binary_function<mfxFrameAllocResponse, mfxFrameAllocResponse, bool> {
#      |                           ^~~~~~~~~~~~~~~
/usr/include/c++/14/functional:49: included_from: Included from here.
libvpl-2.10.2-build/libvpl-2.10.2/tools/legacy/sample_common/include/base_allocator.h:11: included_from: Included from here.
/usr/include/c++/14/bits/stl_function.h:131:12: note: declared here
#  131 |     struct binary_function
#      |            ^~~~~~~~~~~~~~~
#  163|   
#  164|       struct IsSame
#  165|->             : public std::binary_function<mfxFrameAllocResponse, mfxFrameAllocResponse, bool> {
#  166|           bool operator()(const mfxFrameAllocResponse& l, const mfxFrameAllocResponse& r) const {
#  167|               return r.mids != 0 && l.mids != 0 && r.mids[0] == l.mids[0] &&

Error: CLANG_WARNING: [#def8]
libvpl-2.10.2-build/libvpl-2.10.2/tools/legacy/sample_common/src/avc_bitstream.cpp:1379:13: warning[deadcode.DeadStores]: Value stored to 'reordering_of_pic_nums_idc' is never read
# 1377|   
# 1378|               reorder_idx                = 0;
# 1379|->             reordering_of_pic_nums_idc = 0;
# 1380|   
# 1381|               // Get reorder idc,pic_num pairs until idc==3

Error: CLANG_WARNING: [#def9]
libvpl-2.10.2-build/libvpl-2.10.2/tools/legacy/sample_common/src/avc_bitstream.cpp:1415:17: warning[deadcode.DeadStores]: Value stored to 'reordering_of_pic_nums_idc' is never read
# 1413|                   // Get reorder idc,pic_num pairs until idc==3
# 1414|                   reorder_idx                = 0;
# 1415|->                 reordering_of_pic_nums_idc = 0;
# 1416|                   while (bOk) {
# 1417|                       reordering_of_pic_nums_idc = GetVLCElement(false);

Error: CLANG_WARNING: [#def10]
libvpl-2.10.2-build/libvpl-2.10.2/tools/legacy/sample_common/src/avc_nal_spl.cpp:251:21: warning[deadcode.DeadStores]: Value stored to 'zeroCount' is never read
#  249|                       size -= i + 1;
#  250|                       pb++; // remove 0x01 symbol
#  251|->                     zeroCount = 0;
#  252|                       if (size >= 1) {
#  253|                           return pb[0] & AVC_NAL_UNITTYPE_BITS_MASK;

Error: CLANG_WARNING: [#def11]
libvpl-2.10.2-build/libvpl-2.10.2/tools/legacy/sample_common/src/avc_nal_spl.cpp:273:5: warning[deadcode.DeadStores]: Value stored to 'zeroCount' is never read
#  271|       pb -= zeroCount;
#  272|       size += zeroCount;
#  273|->     zeroCount     = 0;
#  274|       startCodeSize = 0;
#  275|       return 0;

Error: COMPILER_WARNING (CWE-477): [#def12]
libvpl-2.10.2-build/libvpl-2.10.2/tools/legacy/sample_common/src/base_allocator.cpp: scope_hint: In member function ‘virtual mfxStatus BaseFrameAllocator::FreeFrames(mfxFrameAllocResponse*)’
libvpl-2.10.2-build/libvpl-2.10.2/tools/legacy/sample_common/src/base_allocator.cpp:167:70: warning[-Wdeprecated-declarations]: ‘std::binder1st<_Operation> std::bind1st(const _Operation&, const _Tp&) [with _Operation = BaseFrameAllocator::IsSame; _Tp = mfxFrameAllocResponse]’ is deprecated: use 'std::bind' instead
#  167 |                                                          std::bind1st(IsSame(), *response));
#      |                                                          ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_function.h:1435: included_from: Included from here.
/usr/include/c++/14/backward/binders.h:136:5: note: declared here
#  136 |     bind1st(const _Operation& __fn, const _Tp& __x)
#      |     ^~~~~~~
#  165|       std::list<UniqueResponse>::iterator i = std::find_if(m_ExtResponses.begin(),
#  166|                                                            m_ExtResponses.end(),
#  167|->                                                          std::bind1st(IsSame(), *response));
#  168|   
#  169|       if (i != m_ExtResponses.end()) {

Error: COMPILER_WARNING (CWE-477): [#def13]
libvpl-2.10.2-build/libvpl-2.10.2/tools/legacy/sample_common/src/base_allocator.cpp:179:74: warning[-Wdeprecated-declarations]: ‘std::binder1st<_Operation> std::bind1st(const _Operation&, const _Tp&) [with _Operation = BaseFrameAllocator::IsSame; _Tp = mfxFrameAllocResponse]’ is deprecated: use 'std::bind' instead
#  179 |         std::find_if(m_responses.begin(), m_responses.end(), std::bind1st(IsSame(), *response));
#      |                                                              ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/backward/binders.h:136:5: note: declared here
#  136 |     bind1st(const _Operation& __fn, const _Tp& __x)
#      |     ^~~~~~~
#  177|       // if not found so far, then search in internal responses
#  178|       std::list<mfxFrameAllocResponse>::iterator i2 =
#  179|->         std::find_if(m_responses.begin(), m_responses.end(), std::bind1st(IsSame(), *response));
#  180|   
#  181|       if (i2 != m_responses.end()) {

Error: CLANG_WARNING: [#def14]
libvpl-2.10.2-build/libvpl-2.10.2/tools/legacy/sample_common/src/brc_routines.cpp:682:9: warning[deadcode.DeadStores]: Value stored to 'fAbLong' is never read
#  680|       if (e2pe > BRC_SCENE_CHANGE_RATIO2) {
#  681|           // scene change, resetting BRC statistics
#  682|->         fAbLong = m_ctx.fAbLong = m_par.inputBitsPerFrame;
#  683|           fAbShort = m_ctx.fAbShort = m_par.inputBitsPerFrame;
#  684|           fAbLong  = m_ctx.fAbLong + (bitsEncoded - m_ctx.fAbLong) / m_par.fAbPeriodLong;

Error: CLANG_WARNING: [#def15]
libvpl-2.10.2-build/libvpl-2.10.2/tools/legacy/sample_common/src/brc_routines.cpp:683:9: warning[deadcode.DeadStores]: Value stored to 'fAbShort' is never read
#  681|           // scene change, resetting BRC statistics
#  682|           fAbLong = m_ctx.fAbLong = m_par.inputBitsPerFrame;
#  683|->         fAbShort = m_ctx.fAbShort = m_par.inputBitsPerFrame;
#  684|           fAbLong  = m_ctx.fAbLong + (bitsEncoded - m_ctx.fAbLong) / m_par.fAbPeriodLong;
#  685|           fAbShort = m_ctx.fAbShort + (bitsEncoded - m_ctx.fAbShort) / m_par.fAbPeriodShort;

Error: CLANG_WARNING: [#def16]
libvpl-2.10.2-build/libvpl-2.10.2/tools/legacy/sample_common/src/brc_routines.cpp:880:13: warning[deadcode.DeadStores]: Value stored to 'bNeedUpdateQP' is never read
#  878|                   UpdateQPParams(quant_new, picType, m_ctx, 0, m_ctx.QuantMin, m_ctx.QuantMax, layer);
#  879|               }
#  880|->             bNeedUpdateQP = false;
#  881|           }
#  882|           SetRecodeParams(brcSts, quant, quant_new, m_ctx.QuantMin, m_ctx.QuantMax, m_ctx, status);

Error: CLANG_WARNING: [#def17]
libvpl-2.10.2-build/libvpl-2.10.2/tools/legacy/sample_common/src/brc_routines.cpp:927:20: warning[deadcode.DeadStores]: Value stored to 'quant_new' during its initialization is never read
#  925|   
#  926|           if (!m_ctx.bPanic && (!oldScene) && bNeedUpdateQP) {
#  927|->             mfxI32 quant_new = m_ctx.Quant;
#  928|               //Update QP
#  929|   

Error: CLANG_WARNING: [#def18]
libvpl-2.10.2-build/libvpl-2.10.2/tools/legacy/sample_common/src/vaapi_utils.cpp:257:13: warning[deadcode.DeadStores]: Value stored to 'mfxRes' is never read
#  255|               break;
#  256|           case VA_STATUS_ERROR_INVALID_PARAMETER:
#  257|->             mfxRes = MFX_ERR_INVALID_VIDEO_PARAM;
#  258|           default:
#  259|               mfxRes = MFX_ERR_UNKNOWN;

Error: CLANG_WARNING: [#def19]
libvpl-2.10.2-build/libvpl-2.10.2/tools/legacy/sample_common/src/vpl_implementation_loader.cpp:189:5: warning[deadcode.DeadStores]: Value stored to 'sts' is never read
#  187|       mfxStatus sts = MFX_ERR_NONE;
#  188|   
#  189|->     sts = CreateConfig(version.Version, "mfxImplDescription.ApiVersion.Version");
#  190|       sts = CreateConfig(version.Major, "mfxImplDescription.ApiVersion.Major");
#  191|       sts = CreateConfig(version.Minor, "mfxImplDescription.ApiVersion.Minor");

Error: CLANG_WARNING: [#def20]
libvpl-2.10.2-build/libvpl-2.10.2/tools/legacy/sample_common/src/vpl_implementation_loader.cpp:190:5: warning[deadcode.DeadStores]: Value stored to 'sts' is never read
#  188|   
#  189|       sts = CreateConfig(version.Version, "mfxImplDescription.ApiVersion.Version");
#  190|->     sts = CreateConfig(version.Major, "mfxImplDescription.ApiVersion.Major");
#  191|       sts = CreateConfig(version.Minor, "mfxImplDescription.ApiVersion.Minor");
#  192|       printf("CONFIGURE LOADER: required version: %d.%d.%d\n",

Error: COMPILER_WARNING (CWE-697): [#def21]
libvpl-2.10.2-build/libvpl-2.10.2/tools/legacy/sample_encode/src/pipeline_encode.cpp: scope_hint: In member function ‘virtual mfxStatus CEncodingPipeline::Run()’
libvpl-2.10.2-build/libvpl-2.10.2/tools/legacy/sample_encode/src/pipeline_encode.cpp:2439:37: warning[-Waddress]: comparing the result of pointer addition ‘(((CEncodingPipeline*)this)->CEncodingPipeline::m_pEncSurfaces + ((sizetype)(((long unsigned int)nEncSurfIdx) * 184)))’ and NULL
# 2439 |             if (m_bTCBRCFileMode && &m_pEncSurfaces[nEncSurfIdx]) {
#      |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 2437|               m_bInsertIDR = false;
# 2438|   
# 2439|->             if (m_bTCBRCFileMode && &m_pEncSurfaces[nEncSurfIdx]) {
# 2440|                   sts = ConfigTCBRCTest(&m_pEncSurfaces[nEncSurfIdx]);
# 2441|                   MSDK_CHECK_STATUS(sts, "TCBRC reset failed");

Error: CLANG_WARNING: [#def22]
libvpl-2.10.2-build/libvpl-2.10.2/tools/legacy/sample_encode/src/pipeline_region_encode.cpp:204:9: warning[deadcode.DeadStores]: Value stored to 'sts' is never read
#  202|   
#  203|           mfxHDL hdl = NULL;
#  204|->         sts        = m_hwdev->GetHandle(MFX_HANDLE_VA_DISPLAY, &hdl);
#  205|   
#  206|           for (int i = 0; i < m_resources.GetSize(); i++) {

Error: CLANG_WARNING: [#def23]
libvpl-2.10.2-build/libvpl-2.10.2/tools/legacy/sample_encode/src/pipeline_region_encode.cpp:241:13: warning[deadcode.DeadStores]: Value stored to 'sts' is never read
#  239|   
#  240|               mfxHDL hdl = NULL;
#  241|->             sts        = m_hwdev->GetHandle(MFX_HANDLE_VA_DISPLAY, &hdl);
#  242|               for (int i = 0; i < m_resources.GetSize(); i++) {
#  243|                   // provide device manager to MediaSDK

Error: CLANG_WARNING: [#def24]
libvpl-2.10.2-build/libvpl-2.10.2/tools/legacy/sample_multi_transcode/src/sample_multi_transcode.cpp:426:25: warning[cplusplus.NewDeleteLeaks]: Potential leak of memory pointed to by 'pVAAPIParams'
#  424|   
#  425|                       if (!hwdev.get()) {
#  426|->                         printf("error: failed to initialize VAAPI device\n");
#  427|                           return MFX_ERR_DEVICE_FAILED;
#  428|                       }

Error: CLANG_WARNING: [#def25]
libvpl-2.10.2-build/libvpl-2.10.2/tools/legacy/sample_multi_transcode/src/sample_multi_transcode.cpp:581:13: warning[deadcode.DeadStores]: Value stored to 'sts' is never read
#  579|           else if (!msdk_match(m_InputParamsArray[i].strDstFile, "null")) {
#  580|               auto writer = std::make_shared<CSmplBitstreamWriter>();
#  581|->             sts         = writer->Init(m_InputParamsArray[i].strDstFile.c_str());
#  582|   
#  583|               sts = m_pExtBSProcArray.back()->SetWriter(writer);

Error: CLANG_WARNING: [#def26]
libvpl-2.10.2-build/libvpl-2.10.2/tools/legacy/sample_multi_transcode/src/sample_multi_transcode.cpp:624:9: warning[deadcode.DeadStores]: Value stored to 'sts' is never read
#  622|           // if session has VPP plus ENCODE only (-i::source option)
#  623|           // use decode source session as input
#  624|->         sts = MFX_ERR_MORE_DATA;
#  625|   
#  626|           auto pipeline = Source == m_InputParamsArray[i].eMode ? pSinkPipeline : pParentPipeline;

Error: CLANG_WARNING: [#def27]
libvpl-2.10.2-build/libvpl-2.10.2/tools/legacy/sample_vpp/src/sample_vpp_config.cpp:99:14: warning[deadcode.DeadStores]: Value stored to 'colorfillConfig' during its initialization is never read
#   97|   
#   98|       if (VPP_FILTER_ENABLED_CONFIGURED == pParams->colorfillParam[paramID].mode) {
#   99|->         auto colorfillConfig = pVppParam->AddExtBuffer<mfxExtVPPColorFill>();
#  100|           colorfillConfig      = &pParams->colorfillParam[paramID];
#  101|           std::ignore          = colorfillConfig;

Error: CLANG_WARNING: [#def28]
libvpl-2.10.2-build/libvpl-2.10.2/tools/legacy/sample_vpp/src/sample_vpp_frc.cpp:135:22: warning[core.DivideZero]: Division by zero
#  133|   
#  134|       GCD = CalculateGCD(m_FramePeriod_In, m_FramePeriod_Out);
#  135|->     m_FramePeriod_In /= GCD;
#  136|       m_FramePeriod_Out /= GCD;
#  137|   }

Error: CLANG_WARNING: [#def29]
libvpl-2.10.2-build/libvpl-2.10.2/tools/legacy/sample_vpp/src/sample_vpp_frc.cpp:140:78: warning[core.DivideZero]: Division by zero
#  138|   
#  139|   void FRCChecker::DefineEdges() {
#  140|->     m_BottomEdge = (m_FramePeriod_In > m_FramePeriod_Out) ? m_FramePeriod_In / m_FramePeriod_Out
#  141|                                                             : m_FramePeriod_Out / m_FramePeriod_In;
#  142|       m_UpperEdge  = m_BottomEdge + 1;

Error: CLANG_WARNING: [#def30]
libvpl-2.10.2-build/libvpl-2.10.2/tools/legacy/sample_vpp/src/sample_vpp_frc.cpp:141:79: warning[core.DivideZero]: Division by zero
#  139|   void FRCChecker::DefineEdges() {
#  140|       m_BottomEdge = (m_FramePeriod_In > m_FramePeriod_Out) ? m_FramePeriod_In / m_FramePeriod_Out
#  141|->                                                           : m_FramePeriod_Out / m_FramePeriod_In;
#  142|       m_UpperEdge  = m_BottomEdge + 1;
#  143|   }

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
diffbase-analyzer-version-clang18.1.7
diffbase-analyzer-version-cppcheck2.14.2
diffbase-analyzer-version-gcc14.1.1
diffbase-analyzer-version-gcc-analyzer14.1.1
diffbase-analyzer-version-shellcheck0.10.0
diffbase-enabled-pluginsclang, cppcheck, gcc, shellcheck
diffbase-exit-code0
diffbase-hostip-172-16-1-131.us-west-2.compute.internal
diffbase-mock-configfedora-41-x86_64
diffbase-project-namelibvpl-2.11.0-1.fc41
diffbase-store-results-to/tmp/tmpwqunubdl/libvpl-2.11.0-1.fc41.tar.xz
diffbase-time-created2024-07-03 16:03:35
diffbase-time-finished2024-07-03 16:04:43
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpwqunubdl/libvpl-2.11.0-1.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpwqunubdl/libvpl-2.11.0-1.fc41.src.rpm'
diffbase-tool-versioncsmock-3.5.3-1.el9
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-131.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-namelibvpl-2.10.2-1.fc40
store-results-to/tmp/tmpm3h_2fik/libvpl-2.10.2-1.fc40.tar.xz
time-created2024-07-03 15:59:48
time-finished2024-07-03 16:03:17
titleFixed defects
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpm3h_2fik/libvpl-2.10.2-1.fc40.tar.xz' '--gcc-analyze' '/tmp/tmpm3h_2fik/libvpl-2.10.2-1.fc40.src.rpm'
tool-versioncsmock-3.5.3-1.el9