New Defects reported by Coverity Scan for digiKam

scan-admin at coverity.com scan-admin at coverity.com
Wed Apr 17 09:56:06 BST 2024


Hi,

Please find the latest report on new defect(s) introduced to digiKam found with Coverity Scan.

41 new defect(s) introduced to digiKam found with Coverity Scan.
30 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 20 of 41 defect(s)


** CID 1596421:  Incorrect expression  (UNUSED_VALUE)
/home/gilles/devel/GIT/8.x/core/libs/dngwriter/extra/xmp_sdk/XMPCore/source/XMPMeta.cpp: 1371 in XMPMeta::DumpPropertyTraits(int (*)(void *, const char *, unsigned int), void *)()


________________________________________________________________________________________________________
*** CID 1596421:  Incorrect expression  (UNUSED_VALUE)
/home/gilles/devel/GIT/8.x/core/libs/dngwriter/extra/xmp_sdk/XMPCore/source/XMPMeta.cpp: 1371 in XMPMeta::DumpPropertyTraits(int (*)(void *, const char *, unsigned int), void *)()
1365     
1366     /* class-static */ XMP_Status
1367     XMPMeta::DumpPropertyTraits ( XMP_TextOutputProc outProc,
1368                                   void *             refCon )
1369     {
1370         XMP_Assert ( outProc != 0 );    // ! Enforced by wrapper.
>>>     CID 1596421:  Incorrect expression  (UNUSED_VALUE)
>>>     Assigning value from "&outProc" to "p" here, but that stored value is overwritten before it can be used.
1371         void * p; p = &outProc; p = &refCon;    // Avoid unused param warnings.
1372         XMP_Throw ( "Unimplemented method XMPMeta::DumpPropertyTraits", kXMPErr_Unimplemented );
1373     
1374         return -1;  // Avoid no-result warning.
1375     
1376     }   // DumpPropertyTraits

** CID 1596420:  Error handling issues  (UNCAUGHT_EXCEPT)
/home/gilles/devel/GIT/8.x/core/libs/dngwriter/extra/xmp_sdk/public/include/client-glue/TXMPDocOps.incl_cpp: 139 in TXMPDocOps<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::~TXMPDocOps()()


________________________________________________________________________________________________________
*** CID 1596420:  Error handling issues  (UNCAUGHT_EXCEPT)
/home/gilles/devel/GIT/8.x/core/libs/dngwriter/extra/xmp_sdk/public/include/client-glue/TXMPDocOps.incl_cpp: 139 in TXMPDocOps<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::~TXMPDocOps()()
133     	#endif
134     }
135     
136     // -------------------------------------------------------------------------------------------------
137     
138     XMP_CTorDTorIntro(TXMPDocOps)::
>>>     CID 1596420:  Error handling issues  (UNCAUGHT_EXCEPT)
>>>     An exception of type "XMP_Error" is thrown but the exception specification "throw()" doesn't allow it to be thrown. This will result in a call to terminate().
139     ~TXMPDocOps () throw()
140     {
141     	#if XMPDocOps_TraceCTorDTor
142     		XFPeek* xfPtr = (XFPeek*)this->xmpDocRef;
143     		printf ( "Destruct TXMPDocOps @ %.8X, ref= %.8X, count = %d\n", this, xfPtr, xfPtr->clientRefs );
144     	#endif

** CID 1596419:  Memory - corruptions  (OVERRUN)
/home/gilles/devel/GIT/8.x/core/tests/dngwriter/dngcompare_cli.cpp: 419 in compareIfd(dng_ifd *, dng_ifd *)()


________________________________________________________________________________________________________
*** CID 1596419:  Memory - corruptions  (OVERRUN)
/home/gilles/devel/GIT/8.x/core/tests/dngwriter/dngcompare_cli.cpp: 419 in compareIfd(dng_ifd *, dng_ifd *)()
413         if (!AreSame(ifd1->fBestQualityScale.As_real64(), ifd2->fBestQualityScale.As_real64()))
414             qCDebug(DIGIKAM_TESTS_LOG).noquote() << QString::fromLatin1("    BestQualityScale: %1 %2").arg(ifd1->fBestQualityScale.As_real64()).arg(ifd2->fBestQualityScale.As_real64());
415     
416         if (0 != memcmp(ifd1->fBitsPerSample, ifd2->fBitsPerSample, kMaxSamplesPerPixel * sizeof(uint32)))
417             qCDebug(DIGIKAM_TESTS_LOG).noquote() << QString::fromLatin1("    BitsPerSample");
418     
>>>     CID 1596419:  Memory - corruptions  (OVERRUN)
>>>     Overrunning array "ifd2->fBlackLevel" of 2048 bytes by passing it to a function which accesses it at byte offset 2559 using argument "2560UL".
419         if (0 != memcmp(ifd1->fBlackLevel, ifd2->fBlackLevel, kMaxBlackPattern * kMaxBlackPattern * kMaxSamplesPerPixel * sizeof(real64)))
420             qCDebug(DIGIKAM_TESTS_LOG).noquote() << QString::fromLatin1("    BlackLevel");
421     
422         if (ifd1->fBlackLevelDeltaHCount != ifd2->fBlackLevelDeltaHCount)
423             qCDebug(DIGIKAM_TESTS_LOG).noquote() << QString::fromLatin1("    BlackLevelDeltaHCount: %1 %2").arg(ifd1->fBlackLevelDeltaHCount).arg(ifd2->fBlackLevelDeltaHCount);
424     

** CID 1596418:  Resource leaks  (RESOURCE_LEAK)
/home/gilles/devel/GIT/8.x/core/libs/jpegutils/jpegutils.cpp: 682 in Digikam::JPEGUtils::JpegRotator::performJpegTransform(Digikam::MetaEngineRotation::TransformationAction, const QString &, const QString &)()


________________________________________________________________________________________________________
*** CID 1596418:  Resource leaks  (RESOURCE_LEAK)
/home/gilles/devel/GIT/8.x/core/libs/jpegutils/jpegutils.cpp: 682 in Digikam::JPEGUtils::JpegRotator::performJpegTransform(Digikam::MetaEngineRotation::TransformationAction, const QString &, const QString &)()
676         // NOTE : Cast is fine here. See metaengine_rotation.h for details.
677     
678         transformoption.transform       = (JXFORM_CODE)action;
679     
680         if (transformoption.transform == JXFORM_NONE)
681         {
>>>     CID 1596418:  Resource leaks  (RESOURCE_LEAK)
>>>     Variable "output_file" going out of scope leaks the storage it points to.
682             return true;
683         }
684     
685         // A transformation must be done.
686     
687         struct jpeg_decompress_struct srcinfo;

** CID 1596417:  Control flow issues  (DEADCODE)
/home/gilles/devel/GIT/8.x/core/libs/metadataengine/dmetadata/dmetadata_fileio.cpp: 81 in Digikam::DMetadata::load(const QString &, bool, Digikam::MetaEngine::Backend *)()


________________________________________________________________________________________________________
*** CID 1596417:  Control flow issues  (DEADCODE)
/home/gilles/devel/GIT/8.x/core/libs/metadataengine/dmetadata/dmetadata_fileio.cpp: 81 in Digikam::DMetadata::load(const QString &, bool, Digikam::MetaEngine::Backend *)()
75                             if (!(hasLoaded = false/*loadUsingImageMagick(filePath)*/))
76                             {
77                                 usedBackend = NoBackend;
78                             }
79                             else
80                             {
>>>     CID 1596417:  Control flow issues  (DEADCODE)
>>>     Execution cannot reach this statement: "usedBackend = Digikam::Meta...".
81                                 usedBackend = ImageMagickBackend;
82                             }
83                         }
84                         else
85                         {
86                             usedBackend = LibHeifBackend;

** CID 1596416:  Null pointer dereferences  (FORWARD_NULL)


________________________________________________________________________________________________________
*** CID 1596416:  Null pointer dereferences  (FORWARD_NULL)
/home/gilles/devel/GIT/8.x/core/libs/dngwriter/extra/dng_sdk/dng_update_meta.cpp: 1862 in dng_ifd_updater::WriteBigTableGroupIndex(dng_file_updater &, const dng_big_table_group_index &)()
1856         const uint64 tagCount = uint64 (digests.size () * 16);
1857     
1858         const void *data = (!digests.empty ()) ? (&digests [0]) : nullptr;
1859     
1860         const bool doRemove = (updatedCount == 0);
1861     
>>>     CID 1596416:  Null pointer dereferences  (FORWARD_NULL)
>>>     Passing null pointer "data" to "UpdateTag", which dereferences it.
1862         UpdateTag (updater,
1863                    tcBigTableGroupIndex,
1864                    ttByte,
1865                    tagCount,
1866                    data,
1867                    doRemove,

** CID 1596415:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/gilles/devel/GIT/8.x/core/libs/dngwriter/extra/dng_sdk/dng_host.h: 518 in dng_host::SetJXLColorSpaceInfo(std::shared_ptr<const dng_jxl_color_space_info>)()


________________________________________________________________________________________________________
*** CID 1596415:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/gilles/devel/GIT/8.x/core/libs/dngwriter/extra/dng_sdk/dng_host.h: 518 in dng_host::SetJXLColorSpaceInfo(std::shared_ptr<const dng_jxl_color_space_info>)()
512                 {
513                 return fJXLEncodeSettings.get ();
514                 }
515     
516             void SetJXLColorSpaceInfo (std::shared_ptr<const dng_jxl_color_space_info> info)
517                 {
>>>     CID 1596415:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
>>>     "info" is copied in a call to copy assignment "operator =", when it could be moved instead.
518                 fJXLColorSpaceInfo = info;
519                 }
520     
521             const dng_jxl_color_space_info * JXLColorSpaceInfo () const
522                 {
523                 return fJXLColorSpaceInfo.get ();

** CID 1596414:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/gilles/devel/GIT/8.x/core/libs/dngwriter/extra/dng_sdk/dng_negative.cpp: 7952 in dng_negative::ReadSemanticMasks(dng_host &, dng_stream &, dng_info &)()


________________________________________________________________________________________________________
*** CID 1596414:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/gilles/devel/GIT/8.x/core/libs/dngwriter/extra/dng_sdk/dng_negative.cpp: 7952 in dng_negative::ReadSemanticMasks(dng_host &, dng_stream &, dng_info &)()
7946             mask.fLossyCompressed.reset (lossyCompressed.Release ());
7947     
7948             masks.push_back (mask);
7949     
7950             }
7951     
>>>     CID 1596414:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
>>>     "masks" is copied in a call to copy assignment "operator =", when it could be moved instead.
7952         fSemanticMasks = masks;
7953     
7954         }
7955     
7956     /*****************************************************************************/
7957     

** CID 1596413:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/gilles/devel/GIT/8.x/core/libs/rawengine/libraw/src/decoders/pana8.cpp: 396 in pana8_param_t::pana8_param_t(const pana8_tags_t &)()


________________________________________________________________________________________________________
*** CID 1596413:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/gilles/devel/GIT/8.x/core/libs/rawengine/libraw/src/decoders/pana8.cpp: 396 in pana8_param_t::pana8_param_t(const pana8_tags_t &)()
390         uint64_t val = gammaCurve(i);
391         tempGamma[i] = uint16_t(val & 0xffffu);
392         if (i != val)
393           noGammaFlag = 0;
394       }
395       if (!noGammaFlag)
>>>     CID 1596413:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
>>>     "tempGamma" is copied in a call to copy assignment "operator =", when it could be moved instead.
396     	  gammaTable = tempGamma;
397     
398       int v7 = 0;
399     
400       for (unsigned hindex = 0; hindex < 17; hindex++)
401       {

** CID 1596412:  Memory - corruptions  (OVERRUN)
/home/gilles/devel/GIT/8.x/core/libs/dngwriter/extra/dng_sdk/dng_image_writer.cpp: 1546 in exif_tag_set::exif_tag_set(dng_tiff_directory &, const dng_exif &, bool, const void *, unsigned int, bool)()


________________________________________________________________________________________________________
*** CID 1596412:  Memory - corruptions  (OVERRUN)
/home/gilles/devel/GIT/8.x/core/libs/dngwriter/extra/dng_sdk/dng_image_writer.cpp: 1546 in exif_tag_set::exif_tag_set(dng_tiff_directory &, const dng_exif &, bool, const void *, unsigned int, bool)()
1540         if (exif.fImageUniqueID.IsValid ())
1541             {
1542     
1543             for (uint32 j = 0; j < 16; j++)
1544                 {
1545     
>>>     CID 1596412:  Memory - corruptions  (OVERRUN)
>>>     Calling "snprintf" with "this->fImageUniqueIDData + j * 2U" and "33UL" is suspicious because "this->fImageUniqueIDData" points into a buffer of 33 bytes and the function call may access "(char *)(this->fImageUniqueIDData + j * 2U) + 32UL".
1546                 snprintf (fImageUniqueIDData + j * 2,
1547                           33,
1548                           "%02X",
1549                           (unsigned) exif.fImageUniqueID.data [j]);
1550     
1551                 }

** CID 1596411:  API usage errors  (INVALIDATE_ITERATOR)
/home/gilles/devel/GIT/8.x/core/libs/dngwriter/extra/xmp_sdk/XMPCore/source/XMPUtils-FileInfo.cpp: 2736 in XMPUtils::RemoveMultiValueInfo(XMPMeta *, const char *, const char *)()


________________________________________________________________________________________________________
*** CID 1596411:  API usage errors  (INVALIDATE_ITERATOR)
/home/gilles/devel/GIT/8.x/core/libs/dngwriter/extra/xmp_sdk/XMPCore/source/XMPUtils-FileInfo.cpp: 2736 in XMPUtils::RemoveMultiValueInfo(XMPMeta *, const char *, const char *)()
2730             XMP_ExpandedXPath expPath;
2731             ExpandXPath ( propNS, propName, &expPath );     // *** Should have LookupBase utility.
2732             XMP_StringPtr baseProp = expPath[kRootPropStep].step.c_str();
2733             if ( expPath[kRootPropStep].options & kXMP_StepIsAlias ) {
2734                 XMP_AliasMapPos aliasPos = sRegisteredAliasMap->find ( expPath[kRootPropStep].step );
2735                 XMP_Assert ( aliasPos != sRegisteredAliasMap->end() );
>>>     CID 1596411:  API usage errors  (INVALIDATE_ITERATOR)
>>>     Dereferencing iterator "aliasPos" though it is already past the end of its container.
2736                 baseProp = aliasPos->second[kRootPropStep].step.c_str();
2737             }
2738     
2739             if ( diffArray != 0 ) {
2740                 for ( size_t itemNum = 0; itemNum < diffArray->children.size(); ++itemNum ) {
2741                     XMP_Node * diffItem = diffArray->children[itemNum];

** CID 1596410:    (DIVIDE_BY_ZERO)
/home/gilles/devel/GIT/8.x/core/libs/dngwriter/extra/dng_sdk/dng_negative.cpp: 6939 in dng_negative::ConvertToProxy(dng_host &, dng_image_writer &, unsigned int, unsigned long)()
/home/gilles/devel/GIT/8.x/core/libs/dngwriter/extra/dng_sdk/dng_negative.cpp: 6916 in dng_negative::ConvertToProxy(dng_host &, dng_image_writer &, unsigned int, unsigned long)()


________________________________________________________________________________________________________
*** CID 1596410:    (DIVIDE_BY_ZERO)
/home/gilles/devel/GIT/8.x/core/libs/dngwriter/extra/dng_sdk/dng_negative.cpp: 6939 in dng_negative::ConvertToProxy(dng_host &, dng_image_writer &, unsigned int, unsigned long)()
6933     
6934                         }
6935     
6936                     if (points.v > 1)
6937                         {
6938     
>>>     CID 1596410:    (DIVIDE_BY_ZERO)
>>>     In expression "(real64)s3bounds.H() / (real64)defaultCropArea.H()", division by expression "defaultCropArea.H()" which may be zero has undefined behavior.
6939                         newSpacing.v *= ((real64) s3bounds.H () /
6940                                          (real64) defaultCropArea.H ());
6941     
6942                         }
6943     
6944                     // Deal with original buffer.
/home/gilles/devel/GIT/8.x/core/libs/dngwriter/extra/dng_sdk/dng_negative.cpp: 6916 in dng_negative::ConvertToProxy(dng_host &, dng_image_writer &, unsigned int, unsigned long)()
6910                     const dng_point_real64 &oldOrigin = gainTableMap.Origin ();
6911     
6912                     dng_point_real64 originPix
6913                         (Lerp_real64 (s3bounds.t, s3bounds.b, oldOrigin.v),
6914                          Lerp_real64 (s3bounds.l, s3bounds.r, oldOrigin.h));
6915     
>>>     CID 1596410:    (DIVIDE_BY_ZERO)
>>>     In expression "(originPix.v - defaultCropArea.t) / defaultCropArea.H()", division by expression "defaultCropArea.H()" which may be zero has undefined behavior.
6916                     dng_point_real64 newOrigin
6917                         ((originPix.v - defaultCropArea.t) / defaultCropArea.H (),
6918                          (originPix.h - defaultCropArea.l) / defaultCropArea.W ());
6919     
6920                     // Adjust spacing.
6921     

** CID 1596409:  Integer handling issues  (DIVIDE_BY_ZERO)
/home/gilles/devel/GIT/8.x/core/libs/dngwriter/extra/dng_sdk/dng_jpeg_image.cpp: 114 in dng_compressed_image_encode_task::Process(unsigned int, const dng_rect &, dng_abort_sniffer *)()


________________________________________________________________________________________________________
*** CID 1596409:  Integer handling issues  (DIVIDE_BY_ZERO)
/home/gilles/devel/GIT/8.x/core/libs/dngwriter/extra/dng_sdk/dng_jpeg_image.cpp: 114 in dng_compressed_image_encode_task::Process(unsigned int, const dng_rect &, dng_abort_sniffer *)()
108                         {
109                         return;
110                         }
111     
112                     dng_abort_sniffer::SniffForAbort (sniffer);
113     
>>>     CID 1596409:  Integer handling issues  (DIVIDE_BY_ZERO)
>>>     In expression "tileIndex / tilesAcross", division by expression "tilesAcross" which may be zero has undefined behavior.
114                     uint32 rowIndex = tileIndex / tilesAcross;
115                     uint32 colIndex = tileIndex % tilesAcross;
116     
117                     dng_rect tileArea = fIFD.TileArea (rowIndex, colIndex);
118     
119                     dng_memory_stream stream (fHost.Allocator ());

** CID 1596408:  Memory - corruptions  (OVERRUN)
/home/gilles/devel/GIT/8.x/core/tests/dngwriter/dngcompare_cli.cpp: 419 in compareIfd(dng_ifd *, dng_ifd *)()


________________________________________________________________________________________________________
*** CID 1596408:  Memory - corruptions  (OVERRUN)
/home/gilles/devel/GIT/8.x/core/tests/dngwriter/dngcompare_cli.cpp: 419 in compareIfd(dng_ifd *, dng_ifd *)()
413         if (!AreSame(ifd1->fBestQualityScale.As_real64(), ifd2->fBestQualityScale.As_real64()))
414             qCDebug(DIGIKAM_TESTS_LOG).noquote() << QString::fromLatin1("    BestQualityScale: %1 %2").arg(ifd1->fBestQualityScale.As_real64()).arg(ifd2->fBestQualityScale.As_real64());
415     
416         if (0 != memcmp(ifd1->fBitsPerSample, ifd2->fBitsPerSample, kMaxSamplesPerPixel * sizeof(uint32)))
417             qCDebug(DIGIKAM_TESTS_LOG).noquote() << QString::fromLatin1("    BitsPerSample");
418     
>>>     CID 1596408:  Memory - corruptions  (OVERRUN)
>>>     Overrunning array "ifd1->fBlackLevel" of 2048 bytes by passing it to a function which accesses it at byte offset 2559 using argument "2560UL".
419         if (0 != memcmp(ifd1->fBlackLevel, ifd2->fBlackLevel, kMaxBlackPattern * kMaxBlackPattern * kMaxSamplesPerPixel * sizeof(real64)))
420             qCDebug(DIGIKAM_TESTS_LOG).noquote() << QString::fromLatin1("    BlackLevel");
421     
422         if (ifd1->fBlackLevelDeltaHCount != ifd2->fBlackLevelDeltaHCount)
423             qCDebug(DIGIKAM_TESTS_LOG).noquote() << QString::fromLatin1("    BlackLevelDeltaHCount: %1 %2").arg(ifd1->fBlackLevelDeltaHCount).arg(ifd2->fBlackLevelDeltaHCount);
424     

** CID 1596407:  Memory - corruptions  (OVERRUN)
/home/gilles/devel/GIT/8.x/core/tests/dngwriter/dngcompare_cli.cpp: 658 in compareIfd(dng_ifd *, dng_ifd *)()


________________________________________________________________________________________________________
*** CID 1596407:  Memory - corruptions  (OVERRUN)
/home/gilles/devel/GIT/8.x/core/tests/dngwriter/dngcompare_cli.cpp: 658 in compareIfd(dng_ifd *, dng_ifd *)()
652         if (ifd1->fUsesStrips != ifd2->fUsesStrips)
653             qCDebug(DIGIKAM_TESTS_LOG).noquote() << QString::fromLatin1("    UsesStrips: %1 %2").arg(ifd1->fUsesStrips).arg(ifd2->fUsesStrips);
654     
655         if (ifd1->fUsesTiles != ifd2->fUsesTiles)
656             qCDebug(DIGIKAM_TESTS_LOG).noquote() << QString::fromLatin1("    UsesTiles: %1 %2").arg(ifd1->fUsesTiles).arg(ifd2->fUsesTiles);
657     
>>>     CID 1596407:  Memory - corruptions  (OVERRUN)
>>>     Overrunning array "ifd2->fWhiteLevel" of 32 bytes by passing it to a function which accesses it at byte offset 39 using argument "40UL".
658         if (0 != memcmp(ifd1->fWhiteLevel, ifd2->fWhiteLevel, kMaxSamplesPerPixel * sizeof(real64)))
659             qCDebug(DIGIKAM_TESTS_LOG).noquote() << QString::fromLatin1("    WhiteLevel");
660     
661         if (!AreSame(ifd1->fXResolution, ifd2->fXResolution))
662             qCDebug(DIGIKAM_TESTS_LOG).noquote() << QString::fromLatin1("    XResolution: %1 %2").arg(ifd1->fXResolution).arg(ifd2->fXResolution);
663     

** CID 1596406:    (REVERSE_NEGATIVE)
/home/gilles/devel/GIT/8.x/core/libs/rawengine/libraw/src/metadata/tiff.cpp: 1992 in LibRaw::apply_tiff()()
/home/gilles/devel/GIT/8.x/core/libs/rawengine/libraw/src/metadata/tiff.cpp: 1953 in LibRaw::apply_tiff()()


________________________________________________________________________________________________________
*** CID 1596406:    (REVERSE_NEGATIVE)
/home/gilles/devel/GIT/8.x/core/libs/rawengine/libraw/src/metadata/tiff.cpp: 1992 in LibRaw::apply_tiff()()
1986     
1987     #if 0
1988       if (raw < 0 && is_raw)
1989           is_raw = 0;
1990     #endif
1991     
>>>     CID 1596406:    (REVERSE_NEGATIVE)
>>>     You might be using variable "raw" before verifying that it is >= 0.
1992       if (raw >= 0 && !load_raw)
1993         switch (tiff_compress)
1994         {
1995         case 32767:
1996           if (!dng_version &&
1997               INT64(tiff_ifd[raw].bytes) == INT64(raw_width) * INT64(raw_height))
/home/gilles/devel/GIT/8.x/core/libs/rawengine/libraw/src/metadata/tiff.cpp: 1953 in LibRaw::apply_tiff()()
1947             raw = i;
1948           }
1949         }
1950         if (is_raw == 1 && ties)
1951           is_raw = ties;
1952       }
>>>     CID 1596406:    (REVERSE_NEGATIVE)
>>>     You might be using variable "raw" before verifying that it is >= 0.
1953       if (is_NikonTransfer && raw >= 0)
1954       {
1955         if (tiff_ifd[raw].bps == 16)
1956         {
1957           if (tiff_compress == 1)
1958           {

** CID 1596405:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/gilles/devel/GIT/8.x/core/libs/dngwriter/extra/dng_sdk/dng_preview.h: 92 in dng_preview::SetImage(dng_host &, const dng_image *)()


________________________________________________________________________________________________________
*** CID 1596405:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/gilles/devel/GIT/8.x/core/libs/dngwriter/extra/dng_sdk/dng_preview.h: 92 in dng_preview::SetImage(dng_host &, const dng_image *)()
86             void SetImage (dng_host &host,
87                            const dng_image *image)
88                 {
89     
90                 std::shared_ptr<const dng_image> temp (image);
91     
>>>     CID 1596405:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
>>>     "temp" is passed-by-value as parameter to "SetImage" when it could be moved instead.
92                 SetImage (host, temp);
93     
94                 }
95     
96             uint32 ImageWidth () const
97                 {

** CID 1596404:  Null pointer dereferences  (NULL_RETURNS)
/home/gilles/devel/GIT/8.x/core/libs/dngwriter/extra/xmp_sdk/XMPCore/source/XMPUtils-FileInfo.cpp: 1041 in UpdateDateDifference(XMP_Node *, const XMP_Node &)()


________________________________________________________________________________________________________
*** CID 1596404:  Null pointer dereferences  (NULL_RETURNS)
/home/gilles/devel/GIT/8.x/core/libs/dngwriter/extra/xmp_sdk/XMPCore/source/XMPUtils-FileInfo.cpp: 1041 in UpdateDateDifference(XMP_Node *, const XMP_Node &)()
1035     
1036         XMP_DateTime propDate;
1037         XMP_DateTime rangeDate;
1038     
1039         if ( propNode.value.empty() ) return;   // ! Ignore missing dates.
1040         XMPUtils::ConvertToDate ( propNode.value.c_str(), &propDate );
>>>     CID 1596404:  Null pointer dereferences  (NULL_RETURNS)
>>>     Dereferencing a pointer that might be "nullptr" "oldestNode->value" when calling "c_str". [Note: The source code implementation of the function has been overridden by a builtin model.]
1041         XMPUtils::ConvertToDate ( oldestNode->value.c_str(), &rangeDate );
1042     
1043         if ( XMPUtils::CompareDateTime ( propDate, rangeDate ) == -1 ) {
1044             oldestNode->value = propNode.value;
1045         } else {
1046             XMPUtils::ConvertToDate ( newestNode->value.c_str(), &rangeDate );

** CID 1596403:  Integer handling issues  (DIVIDE_BY_ZERO)


________________________________________________________________________________________________________
*** CID 1596403:  Integer handling issues  (DIVIDE_BY_ZERO)
/home/gilles/devel/GIT/8.x/core/libs/dngwriter/extra/dng_sdk/dng_image_writer.cpp: 6787 in MakeGainMapIFD(const dng_image &, const dng_lossy_compressed_image *, unsigned int)()
6781     
6782                 }
6783     
6784             else
6785                 {
6786     
>>>     CID 1596403:  Integer handling issues  (DIVIDE_BY_ZERO)
>>>     In function call "FindStripSize", division by expression "ifd.fImageWidth" which may be zero has undefined behavior.
6787                 ifd.FindStripSize (128 * 1024);
6788     
6789                 // Deflate/ZIP.
6790     
6791                 if (ifd.fCompression == ccDeflate)
6792                     {

** CID 1596402:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/gilles/devel/GIT/8.x/core/libs/dngwriter/extra/dng_sdk/dng_preview.h: 70 in dng_preview::SetImage(dng_host &, std::shared_ptr<const dng_image>)()


________________________________________________________________________________________________________
*** CID 1596402:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/gilles/devel/GIT/8.x/core/libs/dngwriter/extra/dng_sdk/dng_preview.h: 70 in dng_preview::SetImage(dng_host &, std::shared_ptr<const dng_image>)()
64                 }
65     
66             void SetImage (dng_host &host,
67                            std::shared_ptr<const dng_image> image)
68                 {
69     
>>>     CID 1596402:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
>>>     "image" is copied in a call to copy assignment "operator =", when it could be moved instead.
70                 fImage = image;
71     
72                 SetIFDInfo (host, *fImage);
73     
74                 }
75     


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=u001.AxU2LYlgjL6eX23u9ErQy-2BKADyCpvUKOL6EWmZljiu4yJUfIaFVfulX1EnArvLvmGJ18AyhOhOJnWywYkUuR-2BHL458rbL5b5DiAzhSjilZ8-3DUtiq_wUwU8mg96yc-2FA1IAMQ6mJ-2FFdQ9EM-2BFY-2BXFbSpXNYnfyWUz42vjwuQ-2Be9M-2Be3WxTk8hAYYa1DLnlrTkMM1a39G5KeR8VsY4fmkph5XEWK0hnVl6RhaiDfc3UqrGSzTnhgzUgeb1SQBF-2B4VEbnQXPVmu1Sx1A-2B61z5J0d4PaT1hTb0dzy1cng-2B7L1Zup8QSK5yWTmTBIfXskxZhhtoZF7kBg-3D-3D



More information about the Digikam-devel mailing list