New Defects reported by Coverity Scan for digiKam

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

New Defects reported by Coverity Scan for digiKam

scan-admin

Hi,

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

Defect(s) Reported-by: Coverity Scan

       
** CID 997051: Uninitialized scalar variable (UNINIT)
/mnt/devel/GIT/3.x/core/libs/dimg/filters/transform/autocrop.cpp: 878
http://scan5.coverity.com:8080//sourcebrowser.htm?projectId=10358#mergedDefectId=997051


________________________________________________________________________
CID 997051: Uninitialized scalar variable (UNINIT)

/mnt/devel/GIT/3.x/core/libs/dimg/filters/transform/autocrop.cpp: 842 ( var_decl)
   839            // --- Step 2 -- Search between local minima
   840            kDebug() << "In local minima function";
   841            //We need to find the maxima between the first two local minima from either side
>>> Declaring variable "blackpointCount" without initializer.
   842            int blackpointCount[threshold.width()];
   843            int leftminima     = 0;
   844            int rightminima    = (threshold.width()-1);
   845            int topCropLine    = 0;
   846            int bottomCropLine = threshold.height()-1;
 

/mnt/devel/GIT/3.x/core/libs/dimg/filters/transform/autocrop.cpp: 878 ( uninit_use)
   875    
   876            for(j=1;j<threshold.width();j++)
   877            {
>>> CID 997051: Uninitialized scalar variable (UNINIT)
>>> Using uninitialized value "blackpointCount[j]".
   878                if((blackpointCount[j]>blackpointCount[j-1]) && (blackpointCount[j]<(0.2*threshold.height())))
   879                {
   880                    leftminima = j-1;
   881                    break;
   882                }
 
________________________________________________________________________
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: [hidden email]

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
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel
Reply | Threaded
Open this post in threaded view
|

Re: New Defects reported by Coverity Scan for digiKam

Sayantan Datta
Hi,

The patch file is added. I added a few lines to initialize the array before using it.

-----------------------------------------------------------------
Sayantan Datta
Junior Year
National Institute of Technology, Durgapur
Phone : (+91) 9564370661
IRC : kenzo450D on #fedora, #nitdgplug, #kde


On Sat, Apr 6, 2013 at 5:25 PM, <[hidden email]> wrote:

Hi,

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

Defect(s) Reported-by: Coverity Scan


** CID 997051: Uninitialized scalar variable (UNINIT)
/mnt/devel/GIT/3.x/core/libs/dimg/filters/transform/autocrop.cpp: 878
http://scan5.coverity.com:8080//sourcebrowser.htm?projectId=10358#mergedDefectId=997051


________________________________________________________________________
CID 997051: Uninitialized scalar variable (UNINIT)

/mnt/devel/GIT/3.x/core/libs/dimg/filters/transform/autocrop.cpp: 842 ( var_decl)
   839            // --- Step 2 -- Search between local minima
   840            kDebug() << "In local minima function";
   841            //We need to find the maxima between the first two local minima from either side
>>> Declaring variable "blackpointCount" without initializer.
   842            int blackpointCount[threshold.width()];
   843            int leftminima     = 0;
   844            int rightminima    = (threshold.width()-1);
   845            int topCropLine    = 0;
   846            int bottomCropLine = threshold.height()-1;


/mnt/devel/GIT/3.x/core/libs/dimg/filters/transform/autocrop.cpp: 878 ( uninit_use)
   875
   876            for(j=1;j<threshold.width();j++)
   877            {
>>> CID 997051: Uninitialized scalar variable (UNINIT)
>>> Using uninitialized value "blackpointCount[j]".
   878                if((blackpointCount[j]>blackpointCount[j-1]) && (blackpointCount[j]<(0.2*threshold.height())))
   879                {
   880                    leftminima = j-1;
   881                    break;
   882                }

________________________________________________________________________
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: [hidden email]

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
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel


_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel

polishautocrop.patch (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: New Defects reported by Coverity Scan for digiKam

Gilles Caulier-4


2013/4/6 Sayantan Datta <[hidden email]>
Hi,

The patch file is added. I added a few lines to initialize the array before using it.

-----------------------------------------------------------------
Sayantan Datta
Junior Year
National Institute of Technology, Durgapur
Phone : <a href="tel:%28%2B91%29%209564370661" value="+919564370661" target="_blank">(+91) 9564370661
IRC : kenzo450D on #fedora, #nitdgplug, #kde


On Sat, Apr 6, 2013 at 5:25 PM, <[hidden email]> wrote:

Hi,

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

Defect(s) Reported-by: Coverity Scan


** CID 997051: Uninitialized scalar variable (UNINIT)
/mnt/devel/GIT/3.x/core/libs/dimg/filters/transform/autocrop.cpp: 878
http://scan5.coverity.com:8080//sourcebrowser.htm?projectId=10358#mergedDefectId=997051


________________________________________________________________________
CID 997051: Uninitialized scalar variable (UNINIT)

/mnt/devel/GIT/3.x/core/libs/dimg/filters/transform/autocrop.cpp: 842 ( var_decl)
   839            // --- Step 2 -- Search between local minima
   840            kDebug() << "In local minima function";
   841            //We need to find the maxima between the first two local minima from either side
>>> Declaring variable "blackpointCount" without initializer.
   842            int blackpointCount[threshold.width()];
   843            int leftminima     = 0;
   844            int rightminima    = (threshold.width()-1);
   845            int topCropLine    = 0;
   846            int bottomCropLine = threshold.height()-1;


/mnt/devel/GIT/3.x/core/libs/dimg/filters/transform/autocrop.cpp: 878 ( uninit_use)
   875
   876            for(j=1;j<threshold.width();j++)
   877            {
>>> CID 997051: Uninitialized scalar variable (UNINIT)
>>> Using uninitialized value "blackpointCount[j]".
   878                if((blackpointCount[j]>blackpointCount[j-1]) && (blackpointCount[j]<(0.2*threshold.height())))
   879                {
   880                    leftminima = j-1;
   881                    break;
   882                }

________________________________________________________________________
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: [hidden email]

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
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel


_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel



_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel