New Defects reported by Coverity Scan for digiKam
scan-admin at coverity.com
scan-admin at coverity.com
Wed Aug 17 09:48:43 BST 2016
Hi,
Please find the latest report on new defect(s) introduced to digiKam found with Coverity Scan.
19 new defect(s) introduced to digiKam found with Coverity Scan.
8 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 19 of 19 defect(s)
** CID 1369601: Code maintainability issues (UNUSED_VALUE)
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 559 in Digikam::CalSystemPrivate::julianDayToDate(long long, int *, int *, int *) const()
________________________________________________________________________________________________________
*** CID 1369601: Code maintainability issues (UNUSED_VALUE)
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 559 in Digikam::CalSystemPrivate::julianDayToDate(long long, int *, int *, int *) const()
553 qint64 i = (4000 * (l + 1)) / 1461001;
554 l = l - (1461 * i) / 4 + 1;
555 qint64 j = ((l - 1) / 31) * (1 - l / 185) + (l / 185) * ((l - 156) / 30 + 5) - l / 366;
556 dd = l - 31 * j + ((j + 2) / 8) * (j - 5);
557 l = j / 11;
558 mm = j + 2 - 12 * l;
>>> CID 1369601: Code maintainability issues (UNUSED_VALUE)
>>> Assigning value from "100LL * (n - 49LL) + l + i - 78LL" to "yy" here, but that stored value is overwritten before it can be used.
559 yy = 100 * (n - 49) + l + i - 78;
560 }
561
562 case CalSystem::IslamicCivilCalendar:
563 {
564 // Formula from the "Explanatory Supplement to the Astronomical Almanac"
** CID 1369600: Code maintainability issues (UNUSED_VALUE)
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 572 in Digikam::CalSystemPrivate::julianDayToDate(long long, int *, int *, int *) const()
________________________________________________________________________________________________________
*** CID 1369600: Code maintainability issues (UNUSED_VALUE)
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 572 in Digikam::CalSystemPrivate::julianDayToDate(long long, int *, int *, int *) const()
566 // Derived from Fliegel & Van Flandern 1968
567 qint64 l = jd - epoch() + 10632;
568 qint64 n = (l - 1) / 10631;
569 l = l - 10631 * n + 354;
570 int j = ((10985 - l) / 5316) * ((50 * l) / 17719) + (l / 5670) * ((43 * l) / 15238);
571 l = l - ((30 - j) / 15) * ((17719 * j) / 50) - (j / 16) * ((15238 * j) / 43) + 29;
>>> CID 1369600: Code maintainability issues (UNUSED_VALUE)
>>> Assigning value from "30LL * n + j - 30LL" to "yy" here, but that stored value is overwritten before it can be used.
572 yy = (30 * n) + j - 30;
573 mm = (24 * l) / 709;
574 dd = l - ((709 * mm) / 24);
575 }
576
577 case CalSystem::JulianCalendar:
** CID 1369599: Code maintainability issues (UNUSED_VALUE)
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 668 in Digikam::CalSystemPrivate::julianDayFromDate(int, int, int) const()
________________________________________________________________________________________________________
*** CID 1369599: Code maintainability issues (UNUSED_VALUE)
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 668 in Digikam::CalSystemPrivate::julianDayFromDate(int, int, int) const()
662
663 case CalSystem::IndianNationalCalendar:
664 {
665 // Formula from the "Explanatory Supplement to the Astronomical Almanac"
666 // Revised Edition 2006 section 12.94 pp 605-606, US Naval Observatory
667 // Originally from the "Report of the Calendar Reform Committee" 1955, Indian Government
>>> CID 1369599: Code maintainability issues (UNUSED_VALUE)
>>> Assigning value from "365 * year + (year + 78 - 1 / month) / 4 + 31 * month - (month + 9) / 11 - month / 7 * (month - 7) - 3 * ((year + 78 - 1 / month) / 100 + 1) / 4 + day + 1749579" to "jd" here, but that stored value is overwritten before it can be used.
668 jd = 365 * year
669 + (year + 78 - 1 / month) / 4
670 + 31 * month
671 - (month + 9) / 11
672 - (month / 7) * (month - 7)
673 - (3 * ((year + 78 - 1 / month) / 100 + 1)) / 4
** CID 1369598: (UNUSED_VALUE)
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 656 in Digikam::CalSystemPrivate::julianDayFromDate(int, int, int) const()
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 683 in Digikam::CalSystemPrivate::julianDayFromDate(int, int, int) const()
________________________________________________________________________________________________________
*** CID 1369598: (UNUSED_VALUE)
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 656 in Digikam::CalSystemPrivate::julianDayFromDate(int, int, int) const()
650
651 case CalSystem::CopticCalendar:
652 case CalSystem::EthiopicCalendar:
653 case CalSystem::EthiopicAmeteAlemCalendar:
654 {
655 // Formula derived from first principles by John Layt
>>> CID 1369598: (UNUSED_VALUE)
>>> Assigning value from "this->epoch() - 1LL + (year - 1) * 365 + year / 4 + (month - 1) * 30 + day" to "jd" here, but that stored value is overwritten before it can be used.
656 jd = epoch() - 1
657 + ((year - 1) * 365)
658 + (year / 4)
659 + ((month - 1) * 30)
660 + day;
661 }
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 683 in Digikam::CalSystemPrivate::julianDayFromDate(int, int, int) const()
677
678 case CalSystem::IslamicCivilCalendar:
679 {
680 // Formula from the "Explanatory Supplement to the Astronomical Almanac"
681 // Revised Edition 2006 section ??? pp ???, US Naval Observatory
682 // Derived from Fliegel & Van Flandern 1968
>>> CID 1369598: (UNUSED_VALUE)
>>> Assigning value from "(3 + 11 * year) / 30 + 354 * year + 30 * month - (month - 1) / 2 + day + this->epoch() - 385LL" to "jd" here, but that stored value is overwritten before it can be used.
683 jd = (3 + (11 * year)) / 30
684 + 354 * year
685 + 30 * month
686 - (month - 1) / 2
687 + day
688 + epoch()
** CID 1369597: (UNUSED_VALUE)
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 556 in Digikam::CalSystemPrivate::julianDayToDate(long long, int *, int *, int *) const()
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 558 in Digikam::CalSystemPrivate::julianDayToDate(long long, int *, int *, int *) const()
________________________________________________________________________________________________________
*** CID 1369597: (UNUSED_VALUE)
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 556 in Digikam::CalSystemPrivate::julianDayToDate(long long, int *, int *, int *) const()
550 qint64 l = jd + 68518;
551 qint64 n = (4 * l) / 146097;
552 l = l - (146097 * n + 3) / 4;
553 qint64 i = (4000 * (l + 1)) / 1461001;
554 l = l - (1461 * i) / 4 + 1;
555 qint64 j = ((l - 1) / 31) * (1 - l / 185) + (l / 185) * ((l - 156) / 30 + 5) - l / 366;
>>> CID 1369597: (UNUSED_VALUE)
>>> Assigning value from "l - 31LL * j + (j + 2LL) / 8LL * (j - 5LL)" to "dd" here, but that stored value is overwritten before it can be used.
556 dd = l - 31 * j + ((j + 2) / 8) * (j - 5);
557 l = j / 11;
558 mm = j + 2 - 12 * l;
559 yy = 100 * (n - 49) + l + i - 78;
560 }
561
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 558 in Digikam::CalSystemPrivate::julianDayToDate(long long, int *, int *, int *) const()
552 l = l - (146097 * n + 3) / 4;
553 qint64 i = (4000 * (l + 1)) / 1461001;
554 l = l - (1461 * i) / 4 + 1;
555 qint64 j = ((l - 1) / 31) * (1 - l / 185) + (l / 185) * ((l - 156) / 30 + 5) - l / 366;
556 dd = l - 31 * j + ((j + 2) / 8) * (j - 5);
557 l = j / 11;
>>> CID 1369597: (UNUSED_VALUE)
>>> Assigning value from "j + 2LL - 12LL * l" to "mm" here, but that stored value is overwritten before it can be used.
558 mm = j + 2 - 12 * l;
559 yy = 100 * (n - 49) + l + i - 78;
560 }
561
562 case CalSystem::IslamicCivilCalendar:
563 {
** CID 1369596: (UNUSED_VALUE)
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 542 in Digikam::CalSystemPrivate::julianDayToDate(long long, int *, int *, int *) const()
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 541 in Digikam::CalSystemPrivate::julianDayToDate(long long, int *, int *, int *) const()
________________________________________________________________________________________________________
*** CID 1369596: (UNUSED_VALUE)
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 542 in Digikam::CalSystemPrivate::julianDayToDate(long long, int *, int *, int *) const()
536 // Formula derived from first principles by John Layt
537 qint64 s = jd - (epoch() - 365);
538 qint64 l = s / 1461;
539 yy = (l * 4) + qMin((qint64)3, (s % 1461) / 365);
540 qint64 diy = s - (yy * 365) + (yy / 4);
541 mm = (diy / 30) + 1;
>>> CID 1369596: (UNUSED_VALUE)
>>> Assigning value from "diy % 30LL + 1LL" to "dd" here, but that stored value is overwritten before it can be used.
542 dd = (diy % 30) + 1;
543 }
544
545 case CalSystem::IndianNationalCalendar:
546 {
547 // Formula from the "Explanatory Supplement to the Astronomical Almanac"
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 541 in Digikam::CalSystemPrivate::julianDayToDate(long long, int *, int *, int *) const()
535 {
536 // Formula derived from first principles by John Layt
537 qint64 s = jd - (epoch() - 365);
538 qint64 l = s / 1461;
539 yy = (l * 4) + qMin((qint64)3, (s % 1461) / 365);
540 qint64 diy = s - (yy * 365) + (yy / 4);
>>> CID 1369596: (UNUSED_VALUE)
>>> Assigning value from "diy / 30LL + 1LL" to "mm" here, but that stored value is overwritten before it can be used.
541 mm = (diy / 30) + 1;
542 dd = (diy % 30) + 1;
543 }
544
545 case CalSystem::IndianNationalCalendar:
546 {
** CID 1369595: Code maintainability issues (UNUSED_VALUE)
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 574 in Digikam::CalSystemPrivate::julianDayToDate(long long, int *, int *, int *) const()
________________________________________________________________________________________________________
*** CID 1369595: Code maintainability issues (UNUSED_VALUE)
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 574 in Digikam::CalSystemPrivate::julianDayToDate(long long, int *, int *, int *) const()
568 qint64 n = (l - 1) / 10631;
569 l = l - 10631 * n + 354;
570 int j = ((10985 - l) / 5316) * ((50 * l) / 17719) + (l / 5670) * ((43 * l) / 15238);
571 l = l - ((30 - j) / 15) * ((17719 * j) / 50) - (j / 16) * ((15238 * j) / 43) + 29;
572 yy = (30 * n) + j - 30;
573 mm = (24 * l) / 709;
>>> CID 1369595: Code maintainability issues (UNUSED_VALUE)
>>> Assigning value from "l - 709 * mm / 24" to "dd" here, but that stored value is overwritten before it can be used.
574 dd = l - ((709 * mm) / 24);
575 }
576
577 case CalSystem::JulianCalendar:
578 {
579 // Formula from The Calendar FAQ by Claus Tondering
** CID 1369594: Uninitialized variables (UNINIT)
/home/gilles/Devel/5.x/core/libs/facesengine/redeye/redeyecorrectionfilter.cpp: 345 in Digikam::RedEyeCorrectionFilter::correctRedEye(unsigned char *, int, cv::Rect_<int>, cv::Rect_<int>)()
________________________________________________________________________________________________________
*** CID 1369594: Uninitialized variables (UNINIT)
/home/gilles/Devel/5.x/core/libs/facesengine/redeye/redeyecorrectionfilter.cpp: 345 in Digikam::RedEyeCorrectionFilter::correctRedEye(unsigned char *, int, cv::Rect_<int>, cv::Rect_<int>)()
339 //uchar * globalindex = eye.data;
340
341 for(int i = eyerect.y ; i<eyerect.y + eyerect.height; i++)
342 {
343 for(int j = eyerect.x; j<eyerect.x + eyerect.width; j++)
344 {
>>> CID 1369594: Uninitialized variables (UNINIT)
>>> Using uninitialized value "pixeldepth".
345 int pixelindex = (i*imgRect.width + j) * pixeldepth;
346 onebytedata = &(((uchar*) data)[pixelindex]);
347 twobytedata = &(((ushort*) data)[pixelindex]);
348 if(sixteendepth)
349 {
350 float redIntensity = ((float)twobytedata[0] / (((unsigned int)twobytedata[1]
** CID 1369593: Integer handling issues (OVERFLOW_BEFORE_WIDEN)
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 672 in Digikam::CalSystemPrivate::julianDayFromDate(int, int, int) const()
________________________________________________________________________________________________________
*** CID 1369593: Integer handling issues (OVERFLOW_BEFORE_WIDEN)
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 672 in Digikam::CalSystemPrivate::julianDayFromDate(int, int, int) const()
666 // Revised Edition 2006 section 12.94 pp 605-606, US Naval Observatory
667 // Originally from the "Report of the Calendar Reform Committee" 1955, Indian Government
668 jd = 365 * year
669 + (year + 78 - 1 / month) / 4
670 + 31 * month
671 - (month + 9) / 11
>>> CID 1369593: Integer handling issues (OVERFLOW_BEFORE_WIDEN)
>>> Potentially overflowing expression "month / 7 * (month - 7)" with type "int" (32 bits, signed) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type "qint64" (64 bits, signed).
672 - (month / 7) * (month - 7)
673 - (3 * ((year + 78 - 1 / month) / 100 + 1)) / 4
674 + day
675 + 1749579;
676 }
677
** CID 1369592: (OVERFLOW_BEFORE_WIDEN)
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 643 in Digikam::CalSystemPrivate::julianDayFromDate(int, int, int) const()
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 668 in Digikam::CalSystemPrivate::julianDayFromDate(int, int, int) const()
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 701 in Digikam::CalSystemPrivate::julianDayFromDate(int, int, int) const()
________________________________________________________________________________________________________
*** CID 1369592: (OVERFLOW_BEFORE_WIDEN)
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 643 in Digikam::CalSystemPrivate::julianDayFromDate(int, int, int) const()
637 // https://u2389337.ct.sendgrid.net/wf/click?upn=eMT-2BqXhL85kf4kjMp0VpWEb02VZiQ1U50XYRxwowceeAOPGP6YJG-2F4eqbL-2FatVdRKTZ-2B80y8kS6wY74TtvmFC0YGPcJSQpVZaNApILANgH0jjqfcWRQq3KEwi75uD6BX_Vulo-2FzB1zz6bqp-2F-2Bl-2FpBD-2BzKk1Nu56XtBupWJitvnTCi-2FtSqSAVtMm5OfmyUz4q7G29mfKoNo365IjuuNLf1nsXbJ5kDWILvU1leVduPx-2FpL4gnpVq5YdH4M8C9pwhfOyYb-2FFztn5QXRiJR-2B9o8q-2FHw3XG-2F-2BpThqz1rKoVd9t7SOT6KtgDUulXsQEOOQpzoeQf-2F0Z2kGHZvtaQkTfKgzwQ-3D-3D
638 int a = (14 - month) / 12;
639 year = year + 4800 - a;
640 int m = month + (12 * a) - 3;
641 jd = day
642 + (((153 * m) + 2) / 5)
>>> CID 1369592: (OVERFLOW_BEFORE_WIDEN)
>>> Potentially overflowing expression "365 * year" with type "int" (32 bits, signed) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type "qint64" (64 bits, signed).
643 + (365 * year)
644 + (year / 4)
645 - (year / 100)
646 + (year / 400)
647 - 32045;
648 break;
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 668 in Digikam::CalSystemPrivate::julianDayFromDate(int, int, int) const()
662
663 case CalSystem::IndianNationalCalendar:
664 {
665 // Formula from the "Explanatory Supplement to the Astronomical Almanac"
666 // Revised Edition 2006 section 12.94 pp 605-606, US Naval Observatory
667 // Originally from the "Report of the Calendar Reform Committee" 1955, Indian Government
>>> CID 1369592: (OVERFLOW_BEFORE_WIDEN)
>>> Potentially overflowing expression "365 * year" with type "int" (32 bits, signed) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type "qint64" (64 bits, signed).
668 jd = 365 * year
669 + (year + 78 - 1 / month) / 4
670 + 31 * month
671 - (month + 9) / 11
672 - (month / 7) * (month - 7)
673 - (3 * ((year + 78 - 1 / month) / 100 + 1)) / 4
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 701 in Digikam::CalSystemPrivate::julianDayFromDate(int, int, int) const()
695 // https://u2389337.ct.sendgrid.net/wf/click?upn=eMT-2BqXhL85kf4kjMp0VpWEb02VZiQ1U50XYRxwowceeAOPGP6YJG-2F4eqbL-2FatVdRKTZ-2B80y8kS6wY74TtvmFC0YGPcJSQpVZaNApILANgH0jjqfcWRQq3KEwi75uD6BX_Vulo-2FzB1zz6bqp-2F-2Bl-2FpBD-2BzKk1Nu56XtBupWJitvnTCi-2FtSqSAVtMm5OfmyUz4q7fFnBE2GXCYTu-2Bj-2FVocK9NcZ0cwSx-2F89h3UJGDIV7eJz5Ilq6jE0yem7MQmq9n85vKuGzu0KRQd-2BtpEp8DKruWiZxbqNOsGVkX9gZ1i0qmNjVtVssnkpLi7LIo64EcpjEA69sgkoXgH4mD77tpyTBtw-3D-3D
696 int a = (14 - month) / 12;
697 year = year + 4800 - a;
698 int m = month + (12 * a) - 3;
699 jd = day
700 + (((153 * m) + 2) / 5)
>>> CID 1369592: (OVERFLOW_BEFORE_WIDEN)
>>> Potentially overflowing expression "365 * year" with type "int" (32 bits, signed) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type "qint64" (64 bits, signed).
701 + (365 * year)
702 + (year / 4)
703 - 32083;
704 break;
705 }
706
** CID 1369591: Control flow issues (MISSING_BREAK)
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 678 in Digikam::CalSystemPrivate::julianDayFromDate(int, int, int) const()
________________________________________________________________________________________________________
*** CID 1369591: Control flow issues (MISSING_BREAK)
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 678 in Digikam::CalSystemPrivate::julianDayFromDate(int, int, int) const()
672 - (month / 7) * (month - 7)
673 - (3 * ((year + 78 - 1 / month) / 100 + 1)) / 4
674 + day
675 + 1749579;
676 }
677
>>> CID 1369591: Control flow issues (MISSING_BREAK)
>>> The above case falls through to this one.
678 case CalSystem::IslamicCivilCalendar:
679 {
680 // Formula from the "Explanatory Supplement to the Astronomical Almanac"
681 // Revised Edition 2006 section ??? pp ???, US Naval Observatory
682 // Derived from Fliegel & Van Flandern 1968
683 jd = (3 + (11 * year)) / 30
** CID 1369590: Control flow issues (MISSING_BREAK)
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 663 in Digikam::CalSystemPrivate::julianDayFromDate(int, int, int) const()
________________________________________________________________________________________________________
*** CID 1369590: Control flow issues (MISSING_BREAK)
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 663 in Digikam::CalSystemPrivate::julianDayFromDate(int, int, int) const()
657 + ((year - 1) * 365)
658 + (year / 4)
659 + ((month - 1) * 30)
660 + day;
661 }
662
>>> CID 1369590: Control flow issues (MISSING_BREAK)
>>> The above case falls through to this one.
663 case CalSystem::IndianNationalCalendar:
664 {
665 // Formula from the "Explanatory Supplement to the Astronomical Almanac"
666 // Revised Edition 2006 section 12.94 pp 605-606, US Naval Observatory
667 // Originally from the "Report of the Calendar Reform Committee" 1955, Indian Government
668 jd = 365 * year
** CID 1369589: Control flow issues (MISSING_BREAK)
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 562 in Digikam::CalSystemPrivate::julianDayToDate(long long, int *, int *, int *) const()
________________________________________________________________________________________________________
*** CID 1369589: Control flow issues (MISSING_BREAK)
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 562 in Digikam::CalSystemPrivate::julianDayToDate(long long, int *, int *, int *) const()
556 dd = l - 31 * j + ((j + 2) / 8) * (j - 5);
557 l = j / 11;
558 mm = j + 2 - 12 * l;
559 yy = 100 * (n - 49) + l + i - 78;
560 }
561
>>> CID 1369589: Control flow issues (MISSING_BREAK)
>>> The above case falls through to this one.
562 case CalSystem::IslamicCivilCalendar:
563 {
564 // Formula from the "Explanatory Supplement to the Astronomical Almanac"
565 // Revised Edition 2006 section ??? pp ???, US Naval Observatory
566 // Derived from Fliegel & Van Flandern 1968
567 qint64 l = jd - epoch() + 10632;
** CID 1369588: Control flow issues (MISSING_BREAK)
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 545 in Digikam::CalSystemPrivate::julianDayToDate(long long, int *, int *, int *) const()
________________________________________________________________________________________________________
*** CID 1369588: Control flow issues (MISSING_BREAK)
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 545 in Digikam::CalSystemPrivate::julianDayToDate(long long, int *, int *, int *) const()
539 yy = (l * 4) + qMin((qint64)3, (s % 1461) / 365);
540 qint64 diy = s - (yy * 365) + (yy / 4);
541 mm = (diy / 30) + 1;
542 dd = (diy % 30) + 1;
543 }
544
>>> CID 1369588: Control flow issues (MISSING_BREAK)
>>> The above case falls through to this one.
545 case CalSystem::IndianNationalCalendar:
546 {
547 // Formula from the "Explanatory Supplement to the Astronomical Almanac"
548 // Revised Edition 2006 section 12.94 pp 605-606, US Naval Observatory
549 // Originally from the "Report of the Calendar Reform Committee" 1955, Indian Government
550 qint64 l = jd + 68518;
** CID 1369586: Null pointer dereferences (FORWARD_NULL)
/home/gilles/Devel/5.x/core/libs/facesengine/shape-predictor/matrixoperations.h: 37 in pinv(const std::vector<std::vector<float, std::allocator<float>>, std::allocator<std::vector<float, std::allocator<float>>>> &)()
________________________________________________________________________________________________________
*** CID 1369586: Null pointer dereferences (FORWARD_NULL)
/home/gilles/Devel/5.x/core/libs/facesengine/shape-predictor/matrixoperations.h: 37 in pinv(const std::vector<std::vector<float, std::allocator<float>>, std::allocator<std::vector<float, std::allocator<float>>>> &)()
31 cv::Mat B(mat[0].size(),mat.size() ,CV_32FC1);
32 cv::Mat A(mat.size() ,mat[0].size(),CV_32FC1);
33
34 for(unsigned int i =0; i<mat.size();i++)
35 for(unsigned int j =0; j<mat[0].size();j++)
36 {
>>> CID 1369586: Null pointer dereferences (FORWARD_NULL)
>>> Dereferencing null pointer "A.at(i, j)".
37 A.at<float>(i,j) = mat[i][j];
38 }
39
40 cv::invert(A,B,cv::DECOMP_SVD);
41
42 for(int i =0; i<B.rows;i++)
** CID 1369585: Integer handling issues (DIVIDE_BY_ZERO)
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 1443 in Digikam::CalSystem::dateDifference(const QDate &, const QDate &, int *, int *, int *, int *) const()
________________________________________________________________________________________________________
*** CID 1369585: Integer handling issues (DIVIDE_BY_ZERO)
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 1443 in Digikam::CalSystem::dateDifference(const QDate &, const QDate &, int *, int *, int *, int *) const()
1437 dm = (miy0 + m2 - m1 - 1) % miy0;
1438 dd = (dim1 + d2 - d1) % dim1;
1439 }
1440 else
1441 {
1442 dm = (miy0 + m2 - m1 - 1) % miy0;
>>> CID 1369585: Integer handling issues (DIVIDE_BY_ZERO)
>>> In expression "(dim0 + d2 - d1) % dim0", modulo by expression "dim0" which may be zero has undefined behavior.
1443 dd = (dim0 + d2 - d1) % dim0;
1444 }
1445 }
1446 }
1447 }
1448
** CID 1369584: Integer handling issues (DIVIDE_BY_ZERO)
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 1438 in Digikam::CalSystem::dateDifference(const QDate &, const QDate &, int *, int *, int *, int *) const()
________________________________________________________________________________________________________
*** CID 1369584: Integer handling issues (DIVIDE_BY_ZERO)
/home/gilles/Devel/5.x/core/utilities/assistants/calendar/print/calsystem.cpp: 1438 in Digikam::CalSystem::dateDifference(const QDate &, const QDate &, int *, int *, int *, int *) const()
1432 }
1433 else if (month(addMonths(toDate, -1)) == m1 && dim0 < dim1)
1434 {
1435 // Special case where fromDate = leap day and toDate in month following but non-leap year
1436 // e.g. 2000-02-29 to 2001-03-01 needs to use 29 to calculate day number not 28
1437 dm = (miy0 + m2 - m1 - 1) % miy0;
>>> CID 1369584: Integer handling issues (DIVIDE_BY_ZERO)
>>> In expression "(dim1 + d2 - d1) % dim1", modulo by expression "dim1" which may be zero has undefined behavior.
1438 dd = (dim1 + d2 - d1) % dim1;
1439 }
1440 else
1441 {
1442 dm = (miy0 + m2 - m1 - 1) % miy0;
1443 dd = (dim0 + d2 - d1) % dim0;
** CID 1369583: Integer handling issues (CONSTANT_EXPRESSION_RESULT)
/home/gilles/Devel/5.x/core/libs/dimg/loaders/dimgloader.cpp: 166 in Digikam::DImgLoader::checkAllocation(long long)()
________________________________________________________________________________________________________
*** CID 1369583: Integer handling issues (CONSTANT_EXPRESSION_RESULT)
/home/gilles/Devel/5.x/core/libs/dimg/loaders/dimgloader.cpp: 166 in Digikam::DImgLoader::checkAllocation(long long)()
160 m_image->m_priv->width = 0;
161 m_image->m_priv->height = 0;
162 }
163
164 qint64 DImgLoader::checkAllocation(qint64 fullSize)
165 {
>>> CID 1369583: Integer handling issues (CONSTANT_EXPRESSION_RESULT)
>>> "(quint64)fullSize > 18446744073709551615ULL /* std::numeric_limits<unsigned long>::max() */" is always false regardless of the values of its operands. This occurs as the logical operand of if.
166 if ((quint64)fullSize > std::numeric_limits<size_t>::max())
167 {
168 qCWarning(DIGIKAM_DIMG_LOG) << "Cannot allocate buffer of size" << fullSize;
169 return 0;
170 }
171
** CID 1369582: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/core/libs/facesengine/redeye/redeyecorrectionfilter.cpp: 161 in Digikam::RedEyeCorrectionFilter::filterImage()()
________________________________________________________________________________________________________
*** CID 1369582: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/core/libs/facesengine/redeye/redeyecorrectionfilter.cpp: 161 in Digikam::RedEyeCorrectionFilter::filterImage()()
155
156 QList<QString> path = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation,
157 QString::fromLatin1("digikam/facesengine"),
158 QStandardPaths::LocateDirectory);
159 QFile model(*path.begin()+QLatin1String("/shapepredictor.dat"));
160
>>> CID 1369582: Error handling issues (CHECKED_RETURN)
>>> Calling "open" without checking return value (as is done elsewhere 57 out of 58 times).
161 model.open(QIODevice::ReadOnly);
162 QDataStream dataStream(&model);
163 dataStream.setFloatingPointPrecision(QDataStream::SinglePrecision);
164 dataStream>>*temp;
165 d->sp = temp;
166 }
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRZIlZa20oQ0xtvekoaSXYBwgZYh7yqZ4T857KvBwnvzEg-3D-3D_Vulo-2FzB1zz6bqp-2F-2Bl-2FpBD-2BzKk1Nu56XtBupWJitvnTCi-2FtSqSAVtMm5OfmyUz4q7TvEQEtyMb0Glz7jvmYhUf-2FqrfJes-2BOnfeBXNYcSVuKQvCSJhmzzOjNilvjd8CXvr5z4zs7-2FHKkc1XVWUWIdDItqMU0ObsUdvn6teFk1miPytbKicSuuZrV1ldZgfd5lIVRBmDhdPRBtTmXl2xy4P-2Fg-3D-3D
To manage Coverity Scan email notifications for "digikam-devel at kde.org", click https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRbVDbis712qZDP-2FA8y06Nq4g-2BkTwi3e7HlDkvMAkUMj2-2FFhZ2O-2BELTTy-2Fl1ea1gxKqmntchu8-2BeAOkExRtki0102MqL9th0o1rOws5-2F-2FQDFdjkpeJaB-2FdUMxPk-2B7ZQUGV0-3D_Vulo-2FzB1zz6bqp-2F-2Bl-2FpBD-2BzKk1Nu56XtBupWJitvnTCi-2FtSqSAVtMm5OfmyUz4q7lJIZxIoccxVNLedv5ZZC4jM50QNcAtfxJRGFa-2BfTns8pvKr6wY4kma1ypC-2Fb0u2eJZMQW36fm8Io-2FvrHhmtHz1g4MsVL7dhRy39wUq5FlrMay1l7JtuuBgDYQqK9i0M9CQ4wIXtxaPjC-2FPXD4yDnYQ-3D-3D
More information about the Digikam-devel
mailing list