New Defects reported by Coverity Scan for LibreOffice
scan-admin at coverity.com
scan-admin at coverity.com
Fri Aug 8 06:41:43 UTC 2025
Hi,
Please find the latest report on new defect(s) introduced to LibreOffice found with Coverity Scan.
6 new defect(s) introduced to LibreOffice found with Coverity Scan.
63 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 6 of 6 defect(s)
** CID 1662043: (UNINIT)
/vcl/source/bitmap/BitmapTools.cxx: 1143 in vcl::bitmap::CanvasCairoExtractBitmapData(const Bitmap &, unsigned char *&, bool &, long &, long &)()
/vcl/source/bitmap/BitmapTools.cxx: 1185 in vcl::bitmap::CanvasCairoExtractBitmapData(const Bitmap &, unsigned char *&, bool &, long &, long &)()
_____________________________________________________________________________________________
*** CID 1662043: (UNINIT)
/vcl/source/bitmap/BitmapTools.cxx: 1143 in vcl::bitmap::CanvasCairoExtractBitmapData(const Bitmap &, unsigned char *&, bool &, long &, long &)()
1137 data[ nOff++ ] = premultiply_table[nAlpha][pReadScan[ 1 ]];
1138 data[ nOff++ ] = premultiply_table[nAlpha][pReadScan[ 0 ]];
1139 #endif
1140 pReadScan += 4;
1141 #else
1142 if( bIsAlpha )
>>> CID 1662043: (UNINIT)
>>> Using uninitialized value "data[nOff + 3L]".
1143 nAlpha = data[ nOff + 3 ];
1144 else
1145 nAlpha = data[ nOff + 3 ] = 255;
1146 #if ENABLE_WASM_STRIP_PREMULTIPLY
1147 data[ nOff++ ] = vcl::bitmap::premultiply(*pReadScan++, nAlpha);
1148 data[ nOff++ ] = vcl::bitmap::premultiply(*pReadScan++, nAlpha);
/vcl/source/bitmap/BitmapTools.cxx: 1185 in vcl::bitmap::CanvasCairoExtractBitmapData(const Bitmap &, unsigned char *&, bool &, long &, long &)()
1179 data[ nOff++ ] = premultiply_table[nAlpha][*pReadScan++];
1180 data[ nOff++ ] = premultiply_table[nAlpha][*pReadScan++];
1181 #endif
1182 pReadScan++;
1183 #else
1184 if( bIsAlpha )
>>> CID 1662043: (UNINIT)
>>> Using uninitialized value "data[nOff + 3L]".
1185 nAlpha = data[ nOff + 3 ];
1186 else
1187 nAlpha = data[ nOff + 3 ] = 255;
1188 #if ENABLE_WASM_STRIP_PREMULTIPLY
1189 data[ nOff++ ] = vcl::bitmap::premultiply(pReadScan[ 2 ], nAlpha);
1190 data[ nOff++ ] = vcl::bitmap::premultiply(pReadScan[ 1 ], nAlpha);
** CID 1662042: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
_____________________________________________________________________________________________
*** CID 1662042: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/vcl/source/gdi/pdfwriter_impl.cxx: 10058 in vcl::PDFWriterImpl::createBitmapEmit(const Bitmap &, const Graphic &, std::__cxx11::list<vcl::pdf::BitmapEmit, std::allocator<vcl::pdf::BitmapEmit>> &, vcl::pdf::ResourceDict &, std::__cxx11::list<vcl::pdf::StreamRedirect, std::allocator<vcl::pdf::StreamRedirect>> &)()
10052 std::list<BitmapEmit>::const_iterator it = std::find_if(rBitmaps.begin(), rBitmaps.end(),
10053 [&](const BitmapEmit& arg) { return aID == arg.m_aID; });
10054 if (it == rBitmaps.end())
10055 {
10056 rBitmaps.push_front(BitmapEmit());
10057 rBitmaps.front().m_aID = aID;
>>> CID 1662042: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "aBitmap" is copied in call to copy assignment for class "Bitmap", when it could be moved instead.
10058 rBitmaps.front().m_aBitmap = aBitmap;
10059 if (!rGraphic.getVectorGraphicData() || rGraphic.getVectorGraphicData()->getType() != VectorGraphicDataType::Pdf || m_aContext.UseReferenceXObject)
10060 rBitmaps.front().m_nObject = createObject();
10061 createEmbeddedFile(rGraphic, rBitmaps.front().m_aReferenceXObject, rBitmaps.front().m_nObject);
10062 it = rBitmaps.begin();
10063 }
** CID 1662041: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
_____________________________________________________________________________________________
*** CID 1662041: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/vcl/source/image/ImplImageTree.cxx: 400 in <unnamed>::loadDiskCachedVersion(std::basic_string_view<char16_t, std::char_traits<char16_t>>, ImageRequestParameters &)()
394 if (!urlExists(sUrl))
395 return false;
396 SvFileStream aFileStream(sUrl, StreamMode::READ);
397 vcl::PngImageReader aPNGReader(aFileStream);
398 Bitmap aTmp;
399 aPNGReader.read(aTmp);
>>> CID 1662041: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "aTmp" is copied in call to copy assignment for class "Bitmap", when it could be moved instead.
400 rParameters.mrBitmap = aTmp;
401 return true;
402 }
403
404 void cacheBitmapToDisk(std::u16string_view sVariant, ImageRequestParameters const & rParameters)
405 {
** CID 1662040: (COPY_INSTEAD_OF_MOVE)
_____________________________________________________________________________________________
*** CID 1662040: (COPY_INSTEAD_OF_MOVE)
/vcl/source/image/ImplImageTree.cxx: 192 in <unnamed>::loadImageFromStream(const std::shared_ptr<SvStream> &, const rtl::OUString &, ImageRequestParameters &)()
186 // tdf#153421. Do not scale, individual crop handles are created from it using pixel unit.
187 if (rPath.endsWith("cropmarkers.svg"))
188 vcl::bitmap::loadFromSvg(*xStream, rPath, aTmp, 1.0);
189 else
190 #endif
191 vcl::bitmap::loadFromSvg(*xStream, rPath, aTmp, aScalePercentage / 100.0);
>>> CID 1662040: (COPY_INSTEAD_OF_MOVE)
>>> "aTmp" is copied in call to copy assignment for class "Bitmap", when it could be moved instead.
192 rParameters.mrBitmap = aTmp;
193
194 if (bConvertToDarkTheme)
195 BitmapFilter::Filter(rParameters.mrBitmap, BitmapLightenFilter());
196
197 return;
/vcl/source/image/ImplImageTree.cxx: 179 in <unnamed>::loadImageFromStream(const std::shared_ptr<SvStream> &, const rtl::OUString &, ImageRequestParameters &)()
173
174 if (rPath.endsWith(".png"))
175 {
176 vcl::PngImageReader aPNGReader(*xStream);
177 Bitmap aTmp;
178 aPNGReader.read(aTmp);
>>> CID 1662040: (COPY_INSTEAD_OF_MOVE)
>>> "aTmp" is copied in call to copy assignment for class "Bitmap", when it could be moved instead.
179 rParameters.mrBitmap = aTmp;
180 }
181 else if (rPath.endsWith(".svg"))
182 {
183 rParameters.mbWriteImageToCache = true; // We always want to cache a SVG image
184 Bitmap aTmp;
** CID 1662039: Concurrent data access violations (BAD_CHECK_OF_WAIT_COND)
/ucb/source/ucp/webdav-curl/SerfLockStore.cxx: 79 in http_dav_ucp::TickerThread::execute()()
_____________________________________________________________________________________________
*** CID 1662039: Concurrent data access violations (BAD_CHECK_OF_WAIT_COND)
/ucb/source/ucp/webdav-curl/SerfLockStore.cxx: 79 in http_dav_ucp::TickerThread::execute()()
73 m_rLockStore.m_aCondition.wait(
74 aGuard, [this] { return !m_rLockStore.m_aLockInfoMap.empty() || m_bFinish; });
75 }
76 else
77 {
78 // Wait until the next deadline or a notification
>>> CID 1662039: Concurrent data access violations (BAD_CHECK_OF_WAIT_COND)
>>> A wait is performed without a loop. If there is a spurious wakeup, the condition may not be satisfied. [Note: The source code implementation of the function has been overridden by a builtin model.]
79 m_rLockStore.m_aCondition.wait_for(aGuard, sleep_duration);
80 }
81 }
82
83 SAL_INFO("ucb.ucp.webdav", "TickerThread: stop.");
84 }
** CID 1662038: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
_____________________________________________________________________________________________
*** CID 1662038: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/vcl/source/image/ImplImage.cxx: 108 in ImplImage::loadStockAtScale(SalGraphics *, Bitmap &)()
102 {
103 SAL_WARN_IF(!bOptional, "vcl",
104 "Failed to load scaled image from " << maStockName << " at " << fScale);
105 return false;
106 }
107 }
>>> CID 1662038: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "aBitmap" is copied in call to copy assignment for class "Bitmap", when it could be moved instead.
108 rBitmap = aBitmap;
109 return true;
110 }
111
112 Size ImplImage::getSizePixel()
113 {
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://scan.coverity.com/projects/libreoffice?tab=overview
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20250808/d17b8055/attachment.htm>
More information about the LibreOffice
mailing list