diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2022-09-19 14:22:32 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-09-20 13:20:00 +0200 |
commit | d0c6b4f7a326fc1d3177f88cde4431e56cae2e66 (patch) | |
tree | c2d08ac6c8b51a849935c5be75008227473d5200 | |
parent | 139e95a317441867e8ca564aea36a47061ec8765 (diff) |
tdf#150992: fix crash popart filter to an SVG image
part of bt:
6 0x00007f018c80186f in BitmapPalette::operator[](unsigned short) const (this=0x5576a198fe48, nIndex=176) at vcl/source/bitmap/bitmappalette.cxx:139
7 0x00007f018c3d1fce in BitmapInfoAccess::GetPaletteColor(unsigned short) const (this=0x5576a2bbc520, nColor=176) at include/vcl/BitmapInfoAccess.hxx:121
8 0x00007f018c85b63f in BitmapPopArtFilter::execute(BitmapEx const&) const (this=0x7fffb7394728, rBitmapEx=...) at vcl/source/bitmap/BitmapPopArtFilter.cxx:73
9 0x00007f018c83e66b in BitmapFilter::Filter(BitmapEx&, BitmapFilter const&) (rBmpEx=..., rFilter=...) at vcl/source/bitmap/bitmapfilter.cxx:22
10 0x00007f01905e5bd4 in SvxGraphicFilter::ExecuteGrfFilterSlot(SfxRequest const&, GraphicObject&) (rReq=..., rFilterObject=...) at svx/source/dialog/grfflt.cxx:202
some gdb info
(gdb) p nIndex
$1 = 176
(gdb) p mpImpl->GetBitmapData().size()
$2 = 34
full bt here:
https://bugs.documentfoundation.org/attachment.cgi?id=182499
See https://bugs.documentfoundation.org/show_bug.cgi?id=150992#c2 for some comments
the main thing that makes me think that the order is reversed is the "nLastEntry" treatment.
Indeed with the current sort, mnCount with 0 come first nLastEntry = nEntryCount - 1 (unless there's no color at all)
Change-Id: I3b89f2f4d6f115ea9f6752c49bad776a33f0b020
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140153
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
(cherry picked from commit 8dbbc1ca6dfe75affe13dda92bdf82b6b38f1a37)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140160
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 2c7052a76e5348981883ca95cf3c0b079ded5068)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140165
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | vcl/source/bitmap/BitmapPopArtFilter.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/vcl/source/bitmap/BitmapPopArtFilter.cxx b/vcl/source/bitmap/BitmapPopArtFilter.cxx index a575a4e06f5a..d644fa3716ad 100644 --- a/vcl/source/bitmap/BitmapPopArtFilter.cxx +++ b/vcl/source/bitmap/BitmapPopArtFilter.cxx @@ -55,7 +55,7 @@ BitmapEx BitmapPopArtFilter::execute(BitmapEx const& rBitmapEx) const // sort table std::sort(aPopArtTable.begin(), aPopArtTable.end(), [](const PopArtEntry& lhs, const PopArtEntry& rhs) { - return lhs.mnCount < rhs.mnCount; + return lhs.mnCount > rhs.mnCount; }); // get last used entry |