New Defects reported by Coverity Scan for LibreOffice
scan-admin at coverity.com
scan-admin at coverity.com
Thu Dec 29 08:17:20 UTC 2022
Hi,
Please find the latest report on new defect(s) introduced to LibreOffice found with Coverity Scan.
4 new defect(s) introduced to LibreOffice found with Coverity Scan.
New defect(s) Reported-by: Coverity Scan
Showing 4 of 4 defect(s)
** CID 1518244: Integer handling issues (NEGATIVE_RETURNS)
________________________________________________________________________________________________________
*** CID 1518244: Integer handling issues (NEGATIVE_RETURNS)
/sw/source/uibase/sidebar/ThemePanel.cxx: 224 in <unnamed>::changeColor(SwTextFormatColl *, const svx::ColorSet &, <unnamed>::StyleRedefinition *)()
218 void changeColor(SwTextFormatColl* pCollection, svx::ColorSet const& rColorSet, StyleRedefinition* /*pRedefinition*/)
219 {
220 SvxColorItem aColorItem(pCollection->GetColor());
221 auto nThemeIndex = aColorItem.GetThemeColor().GetThemeIndex();
222 if (nThemeIndex >= 0)
223 {
>>> CID 1518244: Integer handling issues (NEGATIVE_RETURNS)
>>> "svx::convertToThemeColorType(nThemeIndex)" is passed to a parameter that cannot be negative.
224 Color aColor = rColorSet.getColor(svx::convertToThemeColorType(nThemeIndex));
225 aColor.ApplyTintOrShade(aColorItem.GetThemeColor().GetTintOrShade());
226 aColorItem.SetValue(aColor);
227 pCollection->SetFormatAttr(aColorItem);
228 }
229 }
** CID 1518243: Integer handling issues (NEGATIVE_RETURNS)
________________________________________________________________________________________________________
*** CID 1518243: Integer handling issues (NEGATIVE_RETURNS)
/sd/source/filter/eppt/pptx-epptooxml.cxx: 2190 in oox::core::PowerPointExport::WriteColorSets(const std::shared_ptr<sax_fastparser::FastSerializerHelper> &, svx::Theme *)()
2184
2185 for (int nId = PredefinedClrSchemeId::dk1; nId < PredefinedClrSchemeId::Count; nId++)
2186 {
2187 sal_Int32 nToken = aPredefinedClrTokens[static_cast<PredefinedClrSchemeId>(nId)];
2188 pFS->startElementNS(XML_a, nToken);
2189 svx::ThemeColorType eType = svx::convertToThemeColorType(nId);
>>> CID 1518243: Integer handling issues (NEGATIVE_RETURNS)
>>> "eType" is passed to a parameter that cannot be negative.
2190 pFS->singleElementNS(XML_a, XML_srgbClr, XML_val, I32SHEX(static_cast<sal_Int32>(pColorSet->getColor(eType))));
2191 pFS->endElementNS(XML_a, nToken);
2192 }
2193
2194 return true;
2195 }
** CID 1518242: Control flow issues (DEADCODE)
/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx: 178 in <unnamed>::createBitmapData(const BitmapEx &)()
________________________________________________________________________________________________________
*** CID 1518242: Control flow issues (DEADCODE)
/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx: 178 in <unnamed>::createBitmapData(const BitmapEx &)()
172 std::vector<sal_uInt8> aData(nStride * rSizePixel.Height());
173
174 if (bAlpha)
175 {
176 Bitmap aSrcAlpha(rBitmapEx.GetAlpha().GetBitmap());
177 Bitmap::ScopedReadAccess pReadAccess(const_cast<Bitmap&>(rBitmapEx.GetBitmap()));
>>> CID 1518242: Control flow issues (DEADCODE)
>>> Execution cannot reach the expression "NULL" inside this statement: "pAlphaReadAccess.ScopedBitm...".
178 Bitmap::ScopedReadAccess pAlphaReadAccess(bAlpha ? aSrcAlpha.AcquireReadAccess() : nullptr,
179 aSrcAlpha);
180 const tools::Long nHeight(pReadAccess->Height());
181 const tools::Long nWidth(pReadAccess->Width());
182
183 for (tools::Long y = 0; y < nHeight; ++y)
** CID 1518241: (NEGATIVE_RETURNS)
________________________________________________________________________________________________________
*** CID 1518241: (NEGATIVE_RETURNS)
/sw/source/uibase/sidebar/ThemePanel.cxx: 400 in <unnamed>::GenerateColorPreview(const svx::ColorSet &)()
394
395 for (sal_uInt32 i = 0; i < 12; i += 2)
396 {
397 pVirtualDev->SetFillColor(rColorSet.getColor(svx::convertToThemeColorType(i)));
398 pVirtualDev->DrawRect(tools::Rectangle(x, y1, x + SIZE, y1 + SIZE));
399
>>> CID 1518241: (NEGATIVE_RETURNS)
>>> "svx::convertToThemeColorType(i + 1U)" is passed to a parameter that cannot be negative.
400 pVirtualDev->SetFillColor(rColorSet.getColor(svx::convertToThemeColorType(i + 1)));
401 pVirtualDev->DrawRect(tools::Rectangle(x, y2, x + SIZE, y2 + SIZE));
402
403 x += SIZE + BORDER;
404 if (i == 2 || i == 8)
405 x += BORDER;
/sw/source/uibase/sidebar/ThemePanel.cxx: 397 in <unnamed>::GenerateColorPreview(const svx::ColorSet &)()
391
392 pVirtualDev->SetLineColor(COL_LIGHTGRAY);
393 pVirtualDev->SetFillColor();
394
395 for (sal_uInt32 i = 0; i < 12; i += 2)
396 {
>>> CID 1518241: (NEGATIVE_RETURNS)
>>> "svx::convertToThemeColorType(i)" is passed to a parameter that cannot be negative.
397 pVirtualDev->SetFillColor(rColorSet.getColor(svx::convertToThemeColorType(i)));
398 pVirtualDev->DrawRect(tools::Rectangle(x, y1, x + SIZE, y1 + SIZE));
399
400 pVirtualDev->SetFillColor(rColorSet.getColor(svx::convertToThemeColorType(i + 1)));
401 pVirtualDev->DrawRect(tools::Rectangle(x, y2, x + SIZE, y2 + SIZE));
402
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50ypSs1kiFPuCn2xFdlMIFBirii0zZ9j2-2F9F2XPBcBm2BNgi9duPy3v-2FzgFDd2LJ-2BDKI-3DMLtP_OTq2XUZbbipYjyLSo6GRo-2FpVxQ9OzkDINu9UTS-2FQhSdO0F0jQniitrGlNxDIzPJiDLZhcYABB15pzDA0Yl5uY7wW6u4nI-2FqsfP57rKNPJXajtRofHnQMbo3WMCJbR-2Fy96zpd1aONLr34zeBMS3atjczQQZFcS1JS-2Bg8lPlIj7WnQZHpLDaGAmisPNy-2B5MdpxlWC0SV87X-2FdFuDqbk-2Fbu8H2-2Fy4Hd4-2FNO4FPzl4JaBKU-3D
More information about the LibreOffice
mailing list