A malformed spreadsheet could trigger a very large allocation.
Can be overruled by users via IOUtils.setByteArrayMaxOverride().
Fixes https://issues.oss-fuzz.com/issues/476431391
* Support rendering transparent bitmaps in presentations.
Add PictureShape.getAlpha() method and implementations for HSLF and
XSLF. Then make use of it in DrawPictureShape to apply the right alpha
value to the picture being drawn.
Fixed a bug in BitmapImageRenderer that considered alpha value 0 as
"fully opaque", when it means "fully transparent" instead.
Finally, added a test for this feature in TestDrawPictureShape for XSLF.
A test for HSLF could not be created because it was not possible to
generate a test file with today's tools; MS Office removes the
bitmap transparency effect when saving as .ppt, and LibreOffice blends
it into the bitmap.
* Address reviewer comments.
* Add comment about default alpha value.
* Prevent NPE in XSLFPictureShape.getAlpha().
* Change wording in comments to avoid the word "percentage".
* Use static vars for extreme alpha values.
These can be embedded in slideshows and POI supports
some handling of them.
Also Tika uses this code to extract some textual information
from such images.
These can be embedded in slideshows and POI supports
some handling of them.
Also Tika uses this code to extract some textual information
from such images.
When retrieving picture data
When retrieving text in slides
When handling XSLFTableStyles
In EmbeddedExtractor if ShapeName is not set
In HSSF with invalid EscherSpRecord
In HSSF with invalid RecordStreams
When drawing arcs for shapes in slides
In HSSFPicture.getPictureIndex
Adjust "opens" for tests in poi-ooxml
Either handle it gracefully or throw
IllegalStateException instead for broken files
The current implementation calls updateHeaders() very often
causing cloning a sheet to take very long with high CPU.
We can optimize a number of things here:
* Use getTableColumnArray() as the List-based methods
have very costly implementations of hasNext()/next()
* Avoid some duplicated calls to updateHeaders()
There are likely more aggressive optimizations like
only calling updateHeaders() once after cloning,
but this would require more invasive changes in this
rarely used code-area.
* Add getter for body elements in XWPFSDTContent.
This getter allows to navigate the POI objects stored inside a
XWPFSDTContent object without resorting to navigating XML.
* Address comments in review.
* Allow to load a word document with chartex chart
ChartEx (new charts introduced in Office 2016) will raise exceptions in underlying XML parsing, we catch them here in order to still be able to load the document
* spacing
some extra spaces were unbearable and could have prevented the pull request
* add test
* Update POIXMLDocumentPart.java
* Update POIXMLDocumentPart.java
* Update POIXMLDocumentPart.java
* reduce risk of swallowing zip bomb exceptions
* Update POIXMLDocumentPart.java
---------
Co-authored-by: PJ Fanning <pjfanning@users.noreply.github.com>