[Kde-imaging] New Defects reported by Coverity Scan for digiKam
scan-admin at coverity.com
scan-admin at coverity.com
Sat Mar 30 20:44:14 UTC 2013
Hi,
Please find the latest report on new defect(s) introduced to digiKam found with Coverity SCAN
Defect(s) Reported-by: Coverity Scan
** CID 995779: Uninitialized pointer field (UNINIT_CTOR)
/mnt/devel/GIT/3.x/extra/libkface/libkface/image_p.h: 54
http://scan5.coverity.com:8080//sourcebrowser.htm?projectId=10358#mergedDefectId=995779
** CID 995778: Uninitialized pointer field (UNINIT_CTOR)
/mnt/devel/GIT/3.x/extra/libkface/libface/FaceDetect.cpp: 208
http://scan5.coverity.com:8080//sourcebrowser.htm?projectId=10358#mergedDefectId=995778
** CID 995777: Nesting level does not match indentation (NESTING_INDENT_MISMATCH)
/mnt/devel/GIT/3.x/extra/libkface/libkface/image_p.h: 60
http://scan5.coverity.com:8080//sourcebrowser.htm?projectId=10358#mergedDefectId=995777
** CID 995776: Pointer comparison with string literal (BAD_COMPARE)
/mnt/devel/GIT/3.x/extra/libkface/libkface/database.cpp: 336
http://scan5.coverity.com:8080//sourcebrowser.htm?projectId=10358#mergedDefectId=995776
** CID 747842: Logically dead code (DEADCODE)
/usr/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector.h: 192
http://scan5.coverity.com:8080//sourcebrowser.htm?projectId=10358#mergedDefectId=747842
** CID 747841: Logically dead code (DEADCODE)
/usr/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector.h: 107
http://scan5.coverity.com:8080//sourcebrowser.htm?projectId=10358#mergedDefectId=747841
________________________________________________________________________
CID 995779: Uninitialized pointer field (UNINIT_CTOR)
/mnt/devel/GIT/3.x/extra/libkface/libkface/image_p.h: 63 ( member_decl)
60 cvReleaseImage(&originalImage);
61 }
62
>>> Class member declaration for "originalImage".
63 IplImage* originalImage;
64 IplImage* image;
65 QSize originalSize;
66 };
67
/mnt/devel/GIT/3.x/extra/libkface/libkface/image_p.h: 54 ( uninit_member)
51 {
52 // this code is called of we want to detach()
53 image = cvCloneImage(other.image);
>>> CID 995779: Uninitialized pointer field (UNINIT_CTOR)
>>> Non-static class member "originalImage" is not initialized in this constructor nor in any functions that it calls.
54 }
55
56 ~ImagePriv()
57 {
58 if (image)
________________________________________________________________________
CID 995778: Uninitialized pointer field (UNINIT_CTOR)
/mnt/devel/GIT/3.x/extra/libkface/libface/FaceDetect.cpp: 224 ( member_decl)
221
222 double speedVsAccuracy;
223 double sensitivityVsSpecificity;
>>> Class member declaration for "coloredImage".
224 const IplImage* coloredImage;
225 FaceDetect::requestedColorMode colorMode;
226 };
227
228 FaceDetect::FaceDetect(const string& cascadeDir)
/mnt/devel/GIT/3.x/extra/libkface/libface/FaceDetect.cpp: 208 ( uninit_member)
205
206 speedVsAccuracy = 0.8;
207 sensitivityVsSpecificity = 0.8;
>>> CID 995778: Uninitialized pointer field (UNINIT_CTOR)
>>> Non-static class member "coloredImage" is not initialized in this constructor nor in any functions that it calls.
208 }
209
210 Haarcascades* cascadeSet;
211 CvMemStorage* storage;
212 double scaleFactor; // Keeps the scaling factor of the internal image.
________________________________________________________________________
CID 995777: Nesting level does not match indentation (NESTING_INDENT_MISMATCH)
/mnt/devel/GIT/3.x/extra/libkface/libkface/image_p.h: 58 ( parent)
55
56 ~ImagePriv()
57 {
>>> This 'if' statement is the parent, indented to column 9.
58 if (image)
59 cvReleaseImage(&image);
60 cvReleaseImage(&originalImage);
61 }
62
/mnt/devel/GIT/3.x/extra/libkface/libkface/image_p.h: 59 ( nephew)
56 ~ImagePriv()
57 {
58 if (image)
>>> This statement is nested within its parent, indented to column 13.
59 cvReleaseImage(&image);
60 cvReleaseImage(&originalImage);
61 }
62
63 IplImage* originalImage;
/mnt/devel/GIT/3.x/extra/libkface/libkface/image_p.h: 60 ( uncle)
57 {
58 if (image)
59 cvReleaseImage(&image);
>>> CID 995777: Nesting level does not match indentation (NESTING_INDENT_MISMATCH)
>>> This statement is indented to column 13, as if it were nested within the preceding parent statement, but it is not.
60 cvReleaseImage(&originalImage);
61 }
62
63 IplImage* originalImage;
64 IplImage* image;
________________________________________________________________________
CID 995776: Pointer comparison with string literal (BAD_COMPARE)
/mnt/devel/GIT/3.x/extra/libkface/libkface/database.cpp: 336 ( string_lit_comparison)
333
334 void Database::setColorMode(const char *mode)
335 {
>>> CID 995776: Pointer comparison with string literal (BAD_COMPARE)
>>> Comparing string literal ""grayscale"" to "mode" via direct pointer comparison is unsafe. Use strcmp or wcscmp instead.
336 if(mode == "grayscale")
337 {
338 d->colorMode = grayscale;
339 }
340 else
________________________________________________________________________
CID 747842: Logically dead code (DEADCODE)
/usr/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector.h: 107 ( assignment)
104 const Index peeledSize = peels>1 ? alignedStart + ((alignedSize-alignedStart) & ~PeelAlignedMask) : alignedStart;
105
106 const Index alignmentStep = LhsPacketSize>1 ? (LhsPacketSize - lhsStride % LhsPacketSize) & LhsPacketAlignedMask : 0;
>>> Assigning: "alignmentPattern" = "(alignmentStep == 0L) ? AllAligned : ((alignmentStep == 1L) ? EvenAligned : FirstAligned)".
107 Index alignmentPattern = alignmentStep==0 ? AllAligned
108 : alignmentStep==(LhsPacketSize/2) ? EvenAligned
109 : FirstAligned;
110
111 // we cannot assume the first element is aligned because of sub-matrices
/usr/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector.h: 150 ( assignment)
147 {
148 alignedStart = 0;
149 alignedSize = size;
>>> Assigning: "alignmentPattern" = "0L".
150 alignmentPattern = AllAligned;
151 }
152
153 Index offset1 = (FirstAligned && alignmentStep==1?3:1);
154 Index offset3 = (FirstAligned && alignmentStep==1?1:3);
/usr/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector.h: 132 ( assignment)
129 if (skipColumns==LhsPacketSize)
130 {
131 // nothing can be aligned, no need to skip any column
>>> Assigning: "alignmentPattern" = "3L".
132 alignmentPattern = NoneAligned;
133 skipColumns = 0;
134 }
135 else
136 {
/usr/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector.h: 184 ( equality_cond)
181 {
182 switch(alignmentPattern)
183 {
>>> Jumping to case "0L".
184 case AllAligned:
185 for (Index j = alignedStart; j<alignedSize; j+=ResPacketSize)
186 _EIGEN_ACCUMULATE_PACKETS(d,d,d);
187 break;
188 case EvenAligned:
/usr/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector.h: 188 ( equality_cond)
185 for (Index j = alignedStart; j<alignedSize; j+=ResPacketSize)
186 _EIGEN_ACCUMULATE_PACKETS(d,d,d);
187 break;
>>> Jumping to case "1L".
188 case EvenAligned:
189 for (Index j = alignedStart; j<alignedSize; j+=ResPacketSize)
190 _EIGEN_ACCUMULATE_PACKETS(d,du,d);
191 break;
192 case FirstAligned:
/usr/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector.h: 182 ( intervals)
179
180 if (alignedSize>alignedStart)
181 {
>>> When switching on "alignmentPattern", the value of "alignmentPattern" must be in one of the following intervals: {[0,1], [3,+inf)}.
182 switch(alignmentPattern)
183 {
184 case AllAligned:
185 for (Index j = alignedStart; j<alignedSize; j+=ResPacketSize)
186 _EIGEN_ACCUMULATE_PACKETS(d,d,d);
/usr/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector.h: 192 ( dead_error_condition)
189 for (Index j = alignedStart; j<alignedSize; j+=ResPacketSize)
190 _EIGEN_ACCUMULATE_PACKETS(d,du,d);
191 break;
>>> The switch value "alignmentPattern" cannot be "2L".
192 case FirstAligned:
193 if(peels>1)
194 {
195 LhsPacket A00, A01, A02, A03, A10, A11, A12, A13;
196 ResPacket T0, T1;
/usr/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector.h: 192 ( dead_error_begin)
189 for (Index j = alignedStart; j<alignedSize; j+=ResPacketSize)
190 _EIGEN_ACCUMULATE_PACKETS(d,du,d);
191 break;
>>> CID 747842: Logically dead code (DEADCODE)
>>> Execution cannot reach this statement "case 2L:".
192 case FirstAligned:
193 if(peels>1)
194 {
195 LhsPacket A00, A01, A02, A03, A10, A11, A12, A13;
196 ResPacket T0, T1;
________________________________________________________________________
CID 747841: Logically dead code (DEADCODE)
/usr/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector.h: 106 ( assignment)
103 Index alignedSize = ResPacketSize>1 ? alignedStart + ((size-alignedStart) & ~ResPacketAlignedMask) : 0;
104 const Index peeledSize = peels>1 ? alignedStart + ((alignedSize-alignedStart) & ~PeelAlignedMask) : alignedStart;
105
>>> Assigning: "alignmentStep" = "true ? 2L - lhsStride % 2L & 1L : 0L".
106 const Index alignmentStep = LhsPacketSize>1 ? (LhsPacketSize - lhsStride % LhsPacketSize) & LhsPacketAlignedMask : 0;
107 Index alignmentPattern = alignmentStep==0 ? AllAligned
108 : alignmentStep==(LhsPacketSize/2) ? EvenAligned
109 : FirstAligned;
110
/usr/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector.h: 107 ( const)
104 const Index peeledSize = peels>1 ? alignedStart + ((alignedSize-alignedStart) & ~PeelAlignedMask) : alignedStart;
105
106 const Index alignmentStep = LhsPacketSize>1 ? (LhsPacketSize - lhsStride % LhsPacketSize) & LhsPacketAlignedMask : 0;
>>> At condition "alignmentStep == 1L", the value of "alignmentStep" must be equal to 1.
107 Index alignmentPattern = alignmentStep==0 ? AllAligned
108 : alignmentStep==(LhsPacketSize/2) ? EvenAligned
109 : FirstAligned;
110
111 // we cannot assume the first element is aligned because of sub-matrices
/usr/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector.h: 107 ( dead_error_condition)
104 const Index peeledSize = peels>1 ? alignedStart + ((alignedSize-alignedStart) & ~PeelAlignedMask) : alignedStart;
105
106 const Index alignmentStep = LhsPacketSize>1 ? (LhsPacketSize - lhsStride % LhsPacketSize) & LhsPacketAlignedMask : 0;
>>> The condition "alignmentStep == 1L" must be true.
107 Index alignmentPattern = alignmentStep==0 ? AllAligned
108 : alignmentStep==(LhsPacketSize/2) ? EvenAligned
109 : FirstAligned;
110
111 // we cannot assume the first element is aligned because of sub-matrices
/usr/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector.h: 107 ( dead_error_line)
104 const Index peeledSize = peels>1 ? alignedStart + ((alignedSize-alignedStart) & ~PeelAlignedMask) : alignedStart;
105
106 const Index alignmentStep = LhsPacketSize>1 ? (LhsPacketSize - lhsStride % LhsPacketSize) & LhsPacketAlignedMask : 0;
>>> CID 747841: Logically dead code (DEADCODE)
>>> Execution cannot reach this expression "FirstAligned" inside statement "alignmentPattern = ((alignm...".
107 Index alignmentPattern = alignmentStep==0 ? AllAligned
108 : alignmentStep==(LhsPacketSize/2) ? EvenAligned
109 : FirstAligned;
110
111 // we cannot assume the first element is aligned because of sub-matrices
________________________________________________________________________
To view the defects in Coverity Scan visit, http://scan5.coverity.com:8080
If you don't have a username, you can request one by emailing: scan-admin at coverity.com
To unsubscribe from the email notification for new defects, http://scan.coverity.com/email_unsubscribe.html
If you are project owner, you can subscribe your team member by accessing http://scan.coverity.com/email_subscription.html
More information about the Kde-imaging
mailing list