New Defects reported by Coverity Scan for digiKam

scan-admin at coverity.com scan-admin at coverity.com
Sat Jan 11 17:04:12 GMT 2025


Hi,

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

118 new defect(s) introduced to digiKam found with Coverity Scan.
112 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 118 defect(s)


** CID 1638489:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)


________________________________________________________________________________________________________
*** CID 1638489:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/gilles/devel/GIT/8.x/core/libs/widgets/text/donlinetranslator_yandex.cpp: 282 in Digikam::DOnlineTranslator::slotParseYandexDictionary()()
276     
277                 for (const QJsonValue& wordTranslation : std::as_const(translationsArray))
278                 {
279                     translations.append(wordTranslation.toObject().value(QStringLiteral("text")).toString());
280                 }
281     
>>>     CID 1638489:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
>>>     "word" is passed-by-value as parameter to "QString::QString(QString const &)", when it could be moved instead.
282                 d->translationOptions[typeOfSpeech].append({word, gender, translations});
283             }
284         }
285     }
286     
287     void DOnlineTranslator::buildYandexStateMachine()

** CID 1638488:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/gilles/devel/GIT/8.x/core/libs/dngwriter/extra/dng_sdk/dng_big_table.cpp: 4526 in dng_masked_rgb_table_render_data::PrepareRGBtoRGBTableData(dng_host &)()


________________________________________________________________________________________________________
*** CID 1638488:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/gilles/devel/GIT/8.x/core/libs/dngwriter/extra/dng_sdk/dng_big_table.cpp: 4526 in dng_masked_rgb_table_render_data::PrepareRGBtoRGBTableData(dng_host &)()
4520         for (const auto &x : fMaskedTables)
4521             {
4522     
4523             dng_rgb_to_rgb_table_data_sptr ptr
4524                 (host.Make_dng_rgb_to_rgb_table_data (x.first->Table ()));
4525     
>>>     CID 1638488:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
>>>     "ptr" is copied and then passed-by-reference as parameter to STL insertion function "std::vector<std::shared_ptr<dng_rgb_to_rgb_table_data>, std::allocator<std::shared_ptr<dng_rgb_to_rgb_table_data> > >::push_back(std::vector<std::shared_ptr<dng_rgb_to_rgb_table_data>, std::allocator<std::shared_ptr<dng_rgb_to_rgb_table_data> > >::value_type const &)", when it could be moved instead.
4526             fMaskedTableData.push_back (ptr);
4527     
4528             }
4529     
4530         if (fBackgroundTable)
4531             {

** CID 1638487:    (LOCK)
/home/gilles/devel/GIT/8.x/core/libs/mlfoundation/sharedqueue.h: 80 in Digikam::SharedQueue<Digikam::MLPipelinePackageFoundation *>::push_back(Digikam::MLPipelinePackageFoundation *&)()
/home/gilles/devel/GIT/8.x/core/libs/mlfoundation/sharedqueue.h: 80 in Digikam::SharedQueue<Digikam::MLPipelinePackageFoundation *>::push_back(Digikam::MLPipelinePackageFoundation *&)()


________________________________________________________________________________________________________
*** CID 1638487:    (LOCK)
/home/gilles/devel/GIT/8.x/core/libs/mlfoundation/sharedqueue.h: 80 in Digikam::SharedQueue<Digikam::MLPipelinePackageFoundation *>::push_back(Digikam::MLPipelinePackageFoundation *&)()
74                 back_.wait(mlock);
75             }
76     
77             queue_.push_back(item);
78             mlock.unlock();          // Unlock before notificiation to minimize mutex con.
79             front_.notify_one();     // Notify one waiting thread.
>>>     CID 1638487:    (LOCK)
>>>     "~unique_lock" unlocks "mlock" while it is unlocked. [Note: The source code implementation of the function has been overridden by a builtin model.]
80         }
81     
82         void push_back(T&& item)
83         {
84             std::unique_lock<std::mutex> mlock(mutex_);
85     
/home/gilles/devel/GIT/8.x/core/libs/mlfoundation/sharedqueue.h: 80 in Digikam::SharedQueue<Digikam::MLPipelinePackageFoundation *>::push_back(Digikam::MLPipelinePackageFoundation *&)()
74                 back_.wait(mlock);
75             }
76     
77             queue_.push_back(item);
78             mlock.unlock();          // Unlock before notificiation to minimize mutex con.
79             front_.notify_one();     // Notify one waiting thread.
>>>     CID 1638487:    (LOCK)
>>>     "~unique_lock" unlocks "mlock" while it is unlocked. [Note: The source code implementation of the function has been overridden by a builtin model.]
80         }
81     
82         void push_back(T&& item)
83         {
84             std::unique_lock<std::mutex> mlock(mutex_);
85     

** CID 1638486:  Null pointer dereferences  (FORWARD_NULL)


________________________________________________________________________________________________________
*** CID 1638486:  Null pointer dereferences  (FORWARD_NULL)
/home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/storage/DownloadRegion.cpp: 378 in Marble::DownloadRegion::validTileLevels(Marble::TileType) const()
372             if (
373                 (layer->backend() == QString::fromUtf8("vectortile") && tileType == VectorTileType) ||
374                 (layer->backend() == QString::fromUtf8("texture")    && tileType == TextureTileType)
375                )
376             {
377                 GeoSceneTileDataset* const dataset = dynamic_cast<GeoSceneTileDataset*>(layer->datasets().first());
>>>     CID 1638486:  Null pointer dereferences  (FORWARD_NULL)
>>>     Passing null pointer "dataset" to "tileLevels", which dereferences it.
378                 validTileLevels                    = dataset->tileLevels();
379     
380                 break;
381             }
382         }
383     

** CID 1638485:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/gilles/devel/GIT/8.x/core/libs/dngwriter/extra/dng_sdk/dng_preview.cpp: 984 in dng_preview_list::Append(AutoPtr<dng_preview> &)()


________________________________________________________________________________________________________
*** CID 1638485:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/gilles/devel/GIT/8.x/core/libs/dngwriter/extra/dng_sdk/dng_preview.cpp: 984 in dng_preview_list::Append(AutoPtr<dng_preview> &)()
978     
979         if (preview.Get ())
980             {
981     
982             std::shared_ptr<const dng_preview> entry (preview.Release ());
983     
>>>     CID 1638485:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
>>>     "entry" is copied and then passed-by-reference as parameter to STL insertion function "std::vector<std::shared_ptr<dng_preview const>, std::allocator<std::shared_ptr<dng_preview const> > >::push_back(std::vector<std::shared_ptr<dng_preview const>, std::allocator<std::shared_ptr<dng_preview const> > >::value_type const &)", when it could be moved instead.
984             fPreview.push_back (entry);
985     
986             }
987     
988         }
989     

** CID 1638484:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/gilles/devel/GIT/8.x/core/libs/facesengine/preprocessing/shape-predictor/shapepredictor.cpp: 234 in Digikam::RedEye::normalizingTform(const cv::Rect_<int> &)()


________________________________________________________________________________________________________
*** CID 1638484:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/gilles/devel/GIT/8.x/core/libs/facesengine/preprocessing/shape-predictor/shapepredictor.cpp: 234 in Digikam::RedEye::normalizingTform(const cv::Rect_<int> &)()
228         pt2[1]      = 0;
229         std::vector<float> pt3(2);
230         pt3[0]      = 1;
231         pt3[1]      = 1;
232         from_points.push_back(tlcorner);
233         to_points.push_back(pt1);
>>>     CID 1638484:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
>>>     "trcorner" is copied and then passed-by-reference as parameter to STL insertion function "std::vector<std::vector<float, std::allocator<float> >, std::allocator<std::vector<float, std::allocator<float> > > >::push_back(std::vector<std::vector<float, std::allocator<float> >, std::allocator<std::vector<float, std::allocator<float> > > >::value_type const &)", when it could be moved instead.
234         from_points.push_back(trcorner);
235         to_points.push_back(pt2);
236         from_points.push_back(brcorner);
237         to_points.push_back(pt3);
238     
239         return (findAffineTransform(from_points, to_points));

** CID 1638483:    (COPY_INSTEAD_OF_MOVE)


________________________________________________________________________________________________________
*** CID 1638483:    (COPY_INSTEAD_OF_MOVE)
/home/gilles/devel/GIT/8.x/core/libs/database/item/containers/iteminfo_containers.cpp: 92 in Digikam::ItemInfo::imageMetadataContainer() const()
86                         container.focalLength = fieldString;
87                         break;
88                     }
89     
90                     case DatabaseFields::FocalLength35:
91                     {
>>>     CID 1638483:    (COPY_INSTEAD_OF_MOVE)
>>>     "fieldString" is copied in call to copy assignment for class "QString const", when it could be moved instead.
92                         container.focalLength35 = fieldString;
93                         break;
94                     }
95     
96                     case DatabaseFields::ExposureTime:
97                     {
/home/gilles/devel/GIT/8.x/core/libs/database/item/containers/iteminfo_containers.cpp: 68 in Digikam::ItemInfo::imageMetadataContainer() const()
62                         container.make = fieldString;
63                         break;
64                     }
65     
66                     case DatabaseFields::Model:
67                     {
>>>     CID 1638483:    (COPY_INSTEAD_OF_MOVE)
>>>     "fieldString" is copied in call to copy assignment for class "QString const", when it could be moved instead.
68                         container.model = fieldString;
69                         break;
70                     }
71     
72                     case DatabaseFields::Lens:
73                     {
/home/gilles/devel/GIT/8.x/core/libs/database/item/containers/iteminfo_containers.cpp: 128 in Digikam::ItemInfo::imageMetadataContainer() const()
122                         container.flashMode = fieldString;
123                         break;
124                     }
125     
126                     case DatabaseFields::WhiteBalance:
127                     {
>>>     CID 1638483:    (COPY_INSTEAD_OF_MOVE)
>>>     "fieldString" is copied in call to copy assignment for class "QString const", when it could be moved instead.
128                         container.whiteBalance = fieldString;
129                         break;
130                     }
131     
132                     case DatabaseFields::WhiteBalanceColorTemperature:
133                     {
/home/gilles/devel/GIT/8.x/core/libs/database/item/containers/iteminfo_containers.cpp: 80 in Digikam::ItemInfo::imageMetadataContainer() const()
74                         container.lens = fieldString;
75                         break;
76                     }
77     
78                     case DatabaseFields::Aperture:
79                     {
>>>     CID 1638483:    (COPY_INSTEAD_OF_MOVE)
>>>     "fieldString" is copied in call to copy assignment for class "QString const", when it could be moved instead.
80                         container.aperture = fieldString;
81                         break;
82                     }
83     
84                     case DatabaseFields::FocalLength:
85                     {
/home/gilles/devel/GIT/8.x/core/libs/database/item/containers/iteminfo_containers.cpp: 134 in Digikam::ItemInfo::imageMetadataContainer() const()
128                         container.whiteBalance = fieldString;
129                         break;
130                     }
131     
132                     case DatabaseFields::WhiteBalanceColorTemperature:
133                     {
>>>     CID 1638483:    (COPY_INSTEAD_OF_MOVE)
>>>     "fieldString" is copied in call to copy assignment for class "QString const", when it could be moved instead.
134                         container.whiteBalanceColorTemperature = fieldString;
135                         break;
136                     }
137     
138                     case DatabaseFields::SubjectDistance:
139                     {
/home/gilles/devel/GIT/8.x/core/libs/database/item/containers/iteminfo_containers.cpp: 104 in Digikam::ItemInfo::imageMetadataContainer() const()
98                         container.exposureTime = fieldString;
99                         break;
100                     }
101     
102                     case DatabaseFields::ExposureProgram:
103                     {
>>>     CID 1638483:    (COPY_INSTEAD_OF_MOVE)
>>>     "fieldString" is copied in call to copy assignment for class "QString const", when it could be moved instead.
104                         container.exposureProgram = fieldString;
105                         break;
106                     }
107     
108                     case DatabaseFields::ExposureMode:
109                     {
/home/gilles/devel/GIT/8.x/core/libs/database/item/containers/iteminfo_containers.cpp: 74 in Digikam::ItemInfo::imageMetadataContainer() const()
68                         container.model = fieldString;
69                         break;
70                     }
71     
72                     case DatabaseFields::Lens:
73                     {
>>>     CID 1638483:    (COPY_INSTEAD_OF_MOVE)
>>>     "fieldString" is copied in call to copy assignment for class "QString const", when it could be moved instead.
74                         container.lens = fieldString;
75                         break;
76                     }
77     
78                     case DatabaseFields::Aperture:
79                     {
/home/gilles/devel/GIT/8.x/core/libs/database/item/containers/iteminfo_containers.cpp: 146 in Digikam::ItemInfo::imageMetadataContainer() const()
140                         container.subjectDistance = fieldString;
141                         break;
142                     }
143     
144                     case DatabaseFields::SubjectDistanceCategory:
145                     {
>>>     CID 1638483:    (COPY_INSTEAD_OF_MOVE)
>>>     "fieldString" is copied in call to copy assignment for class "QString const", when it could be moved instead.
146                         container.subjectDistanceCategory = fieldString;
147                         break;
148                     }
149     
150                     default:
151                     {
/home/gilles/devel/GIT/8.x/core/libs/database/item/containers/iteminfo_containers.cpp: 62 in Digikam::ItemInfo::imageMetadataContainer() const()
56                 const QString fieldString         = DMetadata::valueToString(fieldValue, mdField);
57     
58                 switch (*it)
59                 {
60                     case DatabaseFields::Make:
61                     {
>>>     CID 1638483:    (COPY_INSTEAD_OF_MOVE)
>>>     "fieldString" is copied in call to copy assignment for class "QString const", when it could be moved instead.
62                         container.make = fieldString;
63                         break;
64                     }
65     
66                     case DatabaseFields::Model:
67                     {
/home/gilles/devel/GIT/8.x/core/libs/database/item/containers/iteminfo_containers.cpp: 140 in Digikam::ItemInfo::imageMetadataContainer() const()
134                         container.whiteBalanceColorTemperature = fieldString;
135                         break;
136                     }
137     
138                     case DatabaseFields::SubjectDistance:
139                     {
>>>     CID 1638483:    (COPY_INSTEAD_OF_MOVE)
>>>     "fieldString" is copied in call to copy assignment for class "QString const", when it could be moved instead.
140                         container.subjectDistance = fieldString;
141                         break;
142                     }
143     
144                     case DatabaseFields::SubjectDistanceCategory:
145                     {
/home/gilles/devel/GIT/8.x/core/libs/database/item/containers/iteminfo_containers.cpp: 122 in Digikam::ItemInfo::imageMetadataContainer() const()
116                         container.sensitivity = fieldString;
117                         break;
118                     }
119     
120                     case DatabaseFields::FlashMode:
121                     {
>>>     CID 1638483:    (COPY_INSTEAD_OF_MOVE)
>>>     "fieldString" is copied in call to copy assignment for class "QString const", when it could be moved instead.
122                         container.flashMode = fieldString;
123                         break;
124                     }
125     
126                     case DatabaseFields::WhiteBalance:
127                     {
/home/gilles/devel/GIT/8.x/core/libs/database/item/containers/iteminfo_containers.cpp: 116 in Digikam::ItemInfo::imageMetadataContainer() const()
110                         container.exposureMode = fieldString;
111                         break;
112                     }
113     
114                     case DatabaseFields::Sensitivity:
115                     {
>>>     CID 1638483:    (COPY_INSTEAD_OF_MOVE)
>>>     "fieldString" is copied in call to copy assignment for class "QString const", when it could be moved instead.
116                         container.sensitivity = fieldString;
117                         break;
118                     }
119     
120                     case DatabaseFields::FlashMode:
121                     {
/home/gilles/devel/GIT/8.x/core/libs/database/item/containers/iteminfo_containers.cpp: 110 in Digikam::ItemInfo::imageMetadataContainer() const()
104                         container.exposureProgram = fieldString;
105                         break;
106                     }
107     
108                     case DatabaseFields::ExposureMode:
109                     {
>>>     CID 1638483:    (COPY_INSTEAD_OF_MOVE)
>>>     "fieldString" is copied in call to copy assignment for class "QString const", when it could be moved instead.
110                         container.exposureMode = fieldString;
111                         break;
112                     }
113     
114                     case DatabaseFields::Sensitivity:
115                     {
/home/gilles/devel/GIT/8.x/core/libs/database/item/containers/iteminfo_containers.cpp: 98 in Digikam::ItemInfo::imageMetadataContainer() const()
92                         container.focalLength35 = fieldString;
93                         break;
94                     }
95     
96                     case DatabaseFields::ExposureTime:
97                     {
>>>     CID 1638483:    (COPY_INSTEAD_OF_MOVE)
>>>     "fieldString" is copied in call to copy assignment for class "QString const", when it could be moved instead.
98                         container.exposureTime = fieldString;
99                         break;
100                     }
101     
102                     case DatabaseFields::ExposureProgram:
103                     {
/home/gilles/devel/GIT/8.x/core/libs/database/item/containers/iteminfo_containers.cpp: 86 in Digikam::ItemInfo::imageMetadataContainer() const()
80                         container.aperture = fieldString;
81                         break;
82                     }
83     
84                     case DatabaseFields::FocalLength:
85                     {
>>>     CID 1638483:    (COPY_INSTEAD_OF_MOVE)
>>>     "fieldString" is copied in call to copy assignment for class "QString const", when it could be moved instead.
86                         container.focalLength = fieldString;
87                         break;
88                     }
89     
90                     case DatabaseFields::FocalLength35:
91                     {

** CID 1638482:  Incorrect expression  (DIVIDE_BY_ZERO)
/home/gilles/devel/GIT/8.x/core/libs/dimg/filters/fx/filmgrainfilter.cpp: 189 in Digikam::FilmGrainFilter::filmgrainMultithreaded(unsigned int, unsigned int)()


________________________________________________________________________________________________________
*** CID 1638482:  Incorrect expression  (DIVIDE_BY_ZERO)
/home/gilles/devel/GIT/8.x/core/libs/dimg/filters/fx/filmgrainfilter.cpp: 189 in Digikam::FilmGrainFilter::filmgrainMultithreaded(unsigned int, unsigned int)()
183                                     adjustYCbCr(matCol, refChromaBlueRange, refChromaBlueNoise, Private::ChromaBlue);
184                                 }
185                             }
186     
187                             if (d->settings.addChrominanceRedNoise)
188                             {
>>>     CID 1638482:  Incorrect expression  (DIVIDE_BY_ZERO)
>>>     In expression "(refChromaRedRange - matChromaRedRange) / refChromaRedRange", division by expression "refChromaRedRange" which may be zero has undefined behavior.
189                                 if (((refChromaRedRange - matChromaRedRange) / refChromaRedRange) > 0.1)
190                                 {
191                                     adjustYCbCr(matCol, matChromaRedRange, matChromaRedNoise, Private::ChromaBlue);
192                                 }
193                                 else
194                                 {

** CID 1638481:    (INTEGER_OVERFLOW)
/home/gilles/devel/GIT/8.x/core/libs/dimg/filters/fx/charcoalfilter.cpp: 210 in Digikam::CharcoalFilter::convolveImageMultithreaded(unsigned int, unsigned int, double *, double)()
/home/gilles/devel/GIT/8.x/core/libs/dimg/filters/fx/charcoalfilter.cpp: 217 in Digikam::CharcoalFilter::convolveImageMultithreaded(unsigned int, unsigned int, double *, double)()


________________________________________________________________________________________________________
*** CID 1638481:    (INTEGER_OVERFLOW)
/home/gilles/devel/GIT/8.x/core/libs/dimg/filters/fx/charcoalfilter.cpp: 210 in Digikam::CharcoalFilter::convolveImageMultithreaded(unsigned int, unsigned int, double *, double)()
204                 k   = normal_kernel;
205                 red = green = blue = alpha = 0;
206                 sy  = y - (kernelWidth / 2);
207     
208                 for (mcy = 0 ; runningFlag() && (mcy < kernelWidth) ; ++mcy, ++sy)
209                 {
>>>     CID 1638481:    (INTEGER_OVERFLOW)
>>>     Expression "my", where "(sy < 0) ? 0U : ((sy > (int)height - 1) ? height - 1U : sy)" is known to be equal to 4294967295, overflows the type of "my", which is type "int".
210                     my = (sy < 0) ? 0
211                                   : (sy > ((int) height - 1)) ? height - 1
212                                                               : sy;
213                     sx = x + (-kernelWidth / 2);
214     
215                     for (mcx = 0 ; runningFlag() && (mcx < kernelWidth) ; ++mcx, ++sx)
/home/gilles/devel/GIT/8.x/core/libs/dimg/filters/fx/charcoalfilter.cpp: 217 in Digikam::CharcoalFilter::convolveImageMultithreaded(unsigned int, unsigned int, double *, double)()
211                                   : (sy > ((int) height - 1)) ? height - 1
212                                                               : sy;
213                     sx = x + (-kernelWidth / 2);
214     
215                     for (mcx = 0 ; runningFlag() && (mcx < kernelWidth) ; ++mcx, ++sx)
216                     {
>>>     CID 1638481:    (INTEGER_OVERFLOW)
>>>     Expression "mx", where "(sx < 0) ? 0U : ((sx > (int)width - 1) ? width - 1U : sx)" is known to be equal to 4294967295, overflows the type of "mx", which is type "int".
217                         mx     = (sx < 0) ? 0
218                                           : (sx > ((int) width - 1)) ? width - 1
219                                                                      : sx;
220                         DColor color(sdata + mx * sdepth + (width * my * sdepth), sixteenBit);
221                         red   += (*k) * (color.red()   * 257.0);
222                         green += (*k) * (color.green() * 257.0);

** CID 1638480:  Insecure data handling  (INTEGER_OVERFLOW)


________________________________________________________________________________________________________
*** CID 1638480:  Insecure data handling  (INTEGER_OVERFLOW)
/home/gilles/devel/GIT/8.x/core/app/views/tableview/tableview.cpp: 427 in Digikam::TableView::nextInfo() const()
421     
422         if (nextDeepRowNumber>=s->tableViewModel->deepRowCount())
423         {
424             return ItemInfo();
425         }
426     
>>>     CID 1638480:  Insecure data handling  (INTEGER_OVERFLOW)
>>>     "nextDeepRowNumber", which might be negative, is passed to "this->s->tableViewModel->deepRowIndex(nextDeepRowNumber)".
427         const QModelIndex nextDeepRowIndex = s->tableViewModel->deepRowIndex(nextDeepRowNumber);
428     
429         return s->tableViewModel->imageInfo(nextDeepRowIndex);
430     }
431     
432     ItemInfo TableView::previousInfo() const

** CID 1638479:  Integer handling issues  (INTEGER_OVERFLOW)
/home/gilles/devel/GIT/8.x/core/dplugins/generic/view/presentation/audio/presentation_audiopage.cpp: 430 in DigikamGenericPresentationPlugin::PresentationAudioPage::slotSoundFilesButtonUp()()


________________________________________________________________________________________________________
*** CID 1638479:  Integer handling issues  (INTEGER_OVERFLOW)
/home/gilles/devel/GIT/8.x/core/dplugins/generic/view/presentation/audio/presentation_audiopage.cpp: 430 in DigikamGenericPresentationPlugin::PresentationAudioPage::slotSoundFilesButtonUp()()
424         {
425             return;
426         }
427     
428         PresentationAudioListItem* const pitem = static_cast<PresentationAudioListItem*>(m_SoundFilesListBox->takeItem(index));
429     
>>>     CID 1638479:  Integer handling issues  (INTEGER_OVERFLOW)
>>>     Expression "index - 1U", where "index" is known to be equal to 0, underflows the type of "index - 1U", which is type "unsigned int".
430         m_SoundFilesListBox->insertItem(index - 1, pitem);
431         m_SoundFilesListBox->setCurrentItem(pitem);
432     
433         updateFileList();
434     }
435     

** CID 1638478:  Integer handling issues  (INTEGER_OVERFLOW)
/home/gilles/devel/GIT/8.x/core/dplugins/generic/view/slideshow/widgets/slideproperties.cpp: 349 in DigikamGenericSlideShowPlugin::SlideProperties::printComments(QPainter &, int &, const QString &)()


________________________________________________________________________________________________________
*** CID 1638478:  Integer handling issues  (INTEGER_OVERFLOW)
/home/gilles/devel/GIT/8.x/core/dplugins/generic/view/slideshow/widgets/slideproperties.cpp: 349 in DigikamGenericSlideShowPlugin::SlideProperties::printComments(QPainter &, int &, const QString &)()
343     
344             if (commentsIndex != (uint)comments.length())
345             {
346                 while (!newLine.endsWith(QLatin1Char(' ')))
347                 {
348                     newLine.truncate(newLine.length() - 1);
>>>     CID 1638478:  Integer handling issues  (INTEGER_OVERFLOW)
>>>     Expression "--commentsIndex", where "commentsIndex" is known to be equal to 0, underflows the type of "--commentsIndex", which is type "uint".
349                     --commentsIndex;
350                 }
351             }
352     
353             commentsByLines.prepend(newLine.trimmed());
354         }

** CID 1638477:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)


________________________________________________________________________________________________________
*** CID 1638477:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/core/MarbleDirs.cpp: 59 in Marble::MarbleDirs::pluginPath(const QString &)()
53         const QString localpath  = pluginLocalPath()  +
54                                    QDir::separator()  +
55                                    relativePath; // local path
56         const QString systempath = pluginSystemPath() +
57                                    QDir::separator()  +
58                                    relativePath; // system path
>>>     CID 1638477:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
>>>     "systempath" is passed-by-value as parameter to "QString::QString(QString const &)", when it could be moved instead.
59         QString fullpath         = systempath;
60     
61         if (QFile::exists(localpath))
62         {
63             fullpath = localpath;
64         }

** CID 1638476:  Integer handling issues  (INTEGER_OVERFLOW)
/home/gilles/devel/GIT/8.x/core/dplugins/generic/tools/mediaserver/upnpsdk/Neptune/Source/Core/NptHttp.cpp: 2878 in _utf8_decode(const char **)()


________________________________________________________________________________________________________
*** CID 1638476:  Integer handling issues  (INTEGER_OVERFLOW)
/home/gilles/devel/GIT/8.x/core/dplugins/generic/tools/mediaserver/upnpsdk/Neptune/Source/Core/NptHttp.cpp: 2878 in _utf8_decode(const char **)()
2872           bytes_left = 3;
2873           min_value  = 0x10000;
2874       } else {
2875           return ~0;
2876       }
2877     
>>>     CID 1638476:  Integer handling issues  (INTEGER_OVERFLOW)
>>>     Expression "bytes_left--", where "bytes_left" is known to be equal to 0, underflows the type of "bytes_left--", which is type "unsigned int".
2878       while (bytes_left--) {
2879           if (**str == 0 || (**str & 0xC0) != 0x80) return ~0;
2880           result = (result << 6) | (*(*str)++ & 0x3F);
2881       }
2882     
2883       if (result < min_value || (result & 0xFFFFF800) == 0xD800 || result > 0x10FFFF) {

** CID 1638475:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)


________________________________________________________________________________________________________
*** CID 1638475:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/gilles/devel/GIT/8.x/core/utilities/geolocation/geoiface/widgets/mapwidget_map.cpp: 918 in Digikam::MapWidget::slotClustersClicked(const QList<int> &)()
912     
913                 /// @todo Isn't this cached in the cluster?
914     
915                 const QVariant representativeIndex   = getClusterRepresentativeMarker(clusterIndex, s->sortKey);
916     
917                 AbstractMarkerTiler::ClickInfo clickInfo;
>>>     CID 1638475:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
>>>     "tileIndices" is copied in call to copy assignment for class "Digikam::TileIndex::List const", when it could be moved instead.
918                 clickInfo.tileIndicesList            = tileIndices;
919                 clickInfo.representativeIndex        = representativeIndex;
920                 clickInfo.groupSelectionState        = currentCluster.groupState;
921                 clickInfo.currentMouseMode           = s->currentMouseMode;
922                 s->markerModel->onIndicesClicked(clickInfo);
923             }

** CID 1638474:    (DIVIDE_BY_ZERO)
/home/gilles/devel/GIT/8.x/core/libs/dimg/filters/greycstoration/cimg/CImg.h: 27186 in Digikam::cimg_library::CImg<float>::SVD<float>(Digikam::cimg_library::CImg<T1> &, Digikam::cimg_library::CImg<T1> &, Digikam::cimg_library::CImg<T1> &, bool, unsigned int, float) const()
/home/gilles/devel/GIT/8.x/core/libs/dimg/filters/greycstoration/cimg/CImg.h: 27202 in Digikam::cimg_library::CImg<float>::SVD<float>(Digikam::cimg_library::CImg<T1> &, Digikam::cimg_library::CImg<T1> &, Digikam::cimg_library::CImg<T1> &, bool, unsigned int, float) const()


________________________________________________________________________________________________________
*** CID 1638474:    (DIVIDE_BY_ZERO)
/home/gilles/devel/GIT/8.x/core/libs/dimg/filters/greycstoration/cimg/CImg.h: 27186 in Digikam::cimg_library::CImg<float>::SVD<float>(Digikam::cimg_library::CImg<T1> &, Digikam::cimg_library::CImg<T1> &, Digikam::cimg_library::CImg<T1> &, bool, unsigned int, float) const()
27180     
27181             cimg_forX(U,i) {
27182               l = i+1; rv1[i] = scale*g; g = s = scale = 0;
27183               if (i<dimy()) {
27184                 for (int k=i; k<dimy(); ++k) scale+= cimg::abs(U(i,k));
27185                 if (scale) {
>>>     CID 1638474:    (DIVIDE_BY_ZERO)
>>>     In expression "U(i, k, 0U, 0U) /= scale", division by expression "scale" which may be zero has undefined behavior.
27186                   for (int k=i; k<dimy(); ++k) { U(i,k)/=scale; s+= U(i,k)*U(i,k); }
27187                   f = U(i,i); g = (t)((f>=0?-1:1)*cimg_std::sqrt(s)); h=f*g-s; U(i,i) = f-g;
27188                   for (int j=l; j<dimx(); ++j) {
27189                     s = 0; for (int k=i; k<dimy(); ++k) s+= U(i,k)*U(j,k);
27190                     f = s/h;
27191                     { for (int k=i; k<dimy(); ++k) U(j,k)+= f*U(i,k); }
/home/gilles/devel/GIT/8.x/core/libs/dimg/filters/greycstoration/cimg/CImg.h: 27202 in Digikam::cimg_library::CImg<float>::SVD<float>(Digikam::cimg_library::CImg<T1> &, Digikam::cimg_library::CImg<T1> &, Digikam::cimg_library::CImg<T1> &, bool, unsigned int, float) const()
27196               S[i]=scale*g;
27197     
27198               g = s = scale = 0;
27199               if (i<dimy() && i!=dimx()-1) {
27200                 for (int k=l; k<dimx(); ++k) scale += cimg::abs(U(k,i));
27201                 if (scale) {
>>>     CID 1638474:    (DIVIDE_BY_ZERO)
>>>     In expression "U(k, i, 0U, 0U) /= scale", division by expression "scale" which may be zero has undefined behavior.
27202                   for (int k=l; k<dimx(); ++k) { U(k,i)/= scale; s+= U(k,i)*U(k,i); }
27203                   f = U(l,i); g = (t)((f>=0?-1:1)*cimg_std::sqrt(s)); h = f*g-s; U(l,i) = f-g;
27204                   { for (int k=l; k<dimx(); ++k) rv1[k]=U(k,i)/h; }
27205                   for (int j=l; j<dimy(); ++j) {
27206                     s = 0; for (int k=l; k<dimx(); ++k) s+= U(k,j)*U(k,i);
27207                     { for (int k=l; k<dimx(); ++k) U(k,j)+= s*rv1[k]; }

** CID 1638473:  Integer handling issues  (INTEGER_OVERFLOW)
/home/gilles/devel/GIT/8.x/core/libs/rawengine/libraw/src/decoders/decoders_dcraw.cpp: 1172 in LibRaw::panasonic_load_raw()()


________________________________________________________________________________________________________
*** CID 1638473:  Integer handling issues  (INTEGER_OVERFLOW)
/home/gilles/devel/GIT/8.x/core/libs/rawengine/libraw/src/decoders/decoders_dcraw.cpp: 1172 in LibRaw::panasonic_load_raw()()
1166               sh = 4 >> (3 - pana_data(2, 0));
1167             if (nonz[i & 1])
1168             {
1169               if ((j = pana_data(8, 0)))
1170               {
1171                 if ((pred[i & 1] -= 0x80 << sh) < 0 || sh == 4)
>>>     CID 1638473:  Integer handling issues  (INTEGER_OVERFLOW)
>>>     Expression "0xffffffffU << sh", where "sh" is known to be equal to 4, overflows the type of "0xffffffffU << sh", which is type "unsigned int".
1172                   pred[i & 1] &= ~((~0u) << sh);
1173                 pred[i & 1] += j << sh;
1174               }
1175             }
1176             else if ((nonz[i & 1] = pana_data(8, 0)) || i > 11)
1177               pred[i & 1] = nonz[i & 1] << 4 | pana_data(4, 0);

** CID 1638472:    (INTEGER_OVERFLOW)
/home/gilles/devel/GIT/8.x/core/libs/rawengine/libraw/src/preprocessing/ext_preprocess.cpp: 58 in LibRaw::bad_pixels(const char *)()
/home/gilles/devel/GIT/8.x/core/libs/rawengine/libraw/src/preprocessing/ext_preprocess.cpp: 58 in LibRaw::bad_pixels(const char *)()


________________________________________________________________________________________________________
*** CID 1638472:    (INTEGER_OVERFLOW)
/home/gilles/devel/GIT/8.x/core/libs/rawengine/libraw/src/preprocessing/ext_preprocess.cpp: 58 in LibRaw::bad_pixels(const char *)()
52         for (tot = n = 0, rad = 1; rad < 3 && n == 0; rad++)
53           for (r = row - rad; r <= row + rad; r++)
54             for (c = col - rad; c <= col + rad; c++)
55               if ((unsigned)r < height && (unsigned)c < width &&
56                   (r != row || c != col) && fcol(r, c) == fcol(row, col))
57               {
>>>     CID 1638472:    (INTEGER_OVERFLOW)
>>>     "r", which might have overflowed, is used in a pointer index in "this->imgdata.image[(r >> this->libraw_internal_data.internal_output_params.shrink) * this->imgdata.sizes.iwidth + (c >> this->libraw_internal_data.internal_output_params.shrink)][this->fcol(r, c)]".
58                 tot += BAYER2(r, c);
59                 n++;
60               }
61         if (n > 0)
62           BAYER2(row, col) = tot / n;
63       }
/home/gilles/devel/GIT/8.x/core/libs/rawengine/libraw/src/preprocessing/ext_preprocess.cpp: 58 in LibRaw::bad_pixels(const char *)()
52         for (tot = n = 0, rad = 1; rad < 3 && n == 0; rad++)
53           for (r = row - rad; r <= row + rad; r++)
54             for (c = col - rad; c <= col + rad; c++)
55               if ((unsigned)r < height && (unsigned)c < width &&
56                   (r != row || c != col) && fcol(r, c) == fcol(row, col))
57               {
>>>     CID 1638472:    (INTEGER_OVERFLOW)
>>>     "c", which might have overflowed, is used in a pointer index in "this->imgdata.image[(r >> this->libraw_internal_data.internal_output_params.shrink) * this->imgdata.sizes.iwidth + (c >> this->libraw_internal_data.internal_output_params.shrink)][this->fcol(r, c)]".
58                 tot += BAYER2(r, c);
59                 n++;
60               }
61         if (n > 0)
62           BAYER2(row, col) = tot / n;
63       }

** CID 1638471:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)


________________________________________________________________________________________________________
*** CID 1638471:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/gilles/devel/GIT/8.x/core/utilities/geolocation/engine/core/MarbleWidgetPopupMenu.cpp: 365 in Marble::MarbleWidgetPopupMenu::Private::setupDialogOsm(Marble::PopupLayer *, const Marble::GeoDataPlacemark *)()
359         bool hasFacilitiesData   = false;
360         const QString wheelchair = data.tagValue(QStringLiteral("wheelchair"));
361     
362         if (!wheelchair.isEmpty())
363         {
364             hasFacilitiesData = true;
>>>     CID 1638471:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
>>>     "wheelchair" is copied in call to copy assignment for class "QString const", when it could be moved instead.
365             doc[QStringLiteral("wheelchair")] = wheelchair;
366         }
367         else
368         {
369             doc[QStringLiteral("wheelchairVisibility")] = none;
370         }

** CID 1638470:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/gilles/devel/GIT/8.x/core/libs/dngwriter/extra/dng_sdk/dng_bmff.cpp: 391 in dng_bmff_io::UpdateBigTables(dng_host &, const dng_big_table_dictionary &, bool)()


________________________________________________________________________________________________________
*** CID 1638470:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/home/gilles/devel/GIT/8.x/core/libs/dngwriter/extra/dng_sdk/dng_bmff.cpp: 391 in dng_bmff_io::UpdateBigTables(dng_host &, const dng_big_table_dictionary &, bool)()
385     
386             memStream.Put (block.Buffer (),
387                            blockSize);
388     
389             temp->fContent.reset (memStream.AsMemoryBlock (host.Allocator ()));
390     
>>>     CID 1638470:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
>>>     "temp" is copied and then passed-by-reference as parameter to STL insertion function "std::vector<std::shared_ptr<dng_bmff_box>, std::allocator<std::shared_ptr<dng_bmff_box> > >::push_back(std::vector<std::shared_ptr<dng_bmff_box>, std::allocator<std::shared_ptr<dng_bmff_box> > >::value_type const &)", when it could be moved instead.
391             fBoxes.push_back (temp);
392     
393             }
394     
395         }
396     


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://scan.coverity.com/projects/digikam?tab=overview



More information about the Digikam-devel mailing list